-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: v8/v8@6.1.534.38...6.1.534.42 PR-URL: nodejs/node#15521 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
- Loading branch information
Showing
7 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2017 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --allow-natives-syntax | ||
|
||
const maxLength = 268435440; | ||
const s = 'A'.repeat(maxLength); | ||
|
||
function foo(s) { | ||
let x = s.indexOf("", maxLength); | ||
return x === maxLength; | ||
} | ||
|
||
assertTrue(foo(s)); | ||
assertTrue(foo(s)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertTrue(foo(s)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2017 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --allow-natives-syntax | ||
|
||
const maxLength = 268435440; | ||
const s = 'A'.repeat(maxLength); | ||
|
||
function foo(s) { | ||
let x = s.lastIndexOf("", maxLength); | ||
return x === maxLength; | ||
} | ||
|
||
assertTrue(foo(s)); | ||
assertTrue(foo(s)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertTrue(foo(s)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2017 the V8 project authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Flags: --expose-wasm | ||
|
||
'use strict'; | ||
|
||
load("test/mjsunit/wasm/wasm-constants.js"); | ||
load("test/mjsunit/wasm/wasm-module-builder.js"); | ||
|
||
var builder = new WasmModuleBuilder(); | ||
builder.addImportedTable("x", "table", 1, 10000000); | ||
builder.addFunction("main", kSig_i_i) | ||
.addBody([ | ||
kExprI32Const, 0, | ||
kExprGetLocal, 0, | ||
kExprCallIndirect, 0, kTableZero]) | ||
.exportAs("main"); | ||
let module = new WebAssembly.Module(builder.toBuffer()); | ||
let table = new WebAssembly.Table({element: "anyfunc", | ||
initial: 1, maximum:1000000}); | ||
let instance = new WebAssembly.Instance(module, {x: {table:table}}); | ||
|
||
table.grow(0x40001); | ||
|
||
let instance2 = new WebAssembly.Instance(module, {x: {table:table}}); | ||
|
||
try { | ||
instance2.exports.main(402982); // should be OOB | ||
} catch (e) { | ||
print("Correctly caught: ", e); | ||
} |