Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Unified Diff: test/cctest/compiler/test-run-bytecode-graph-builder.cc

Issue 2683733002: Revert of Reland: [Parse] ParseInfo owns the parsing Zone. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/compiler/test-loop-assignment-analysis.cc ('k') | test/cctest/parsing/test-preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
index d9bcd20d2a7c72955535a8d6713a8a76a8316ad5..ea7fcd64492ae06cdd0ddb182bcabfcca4cad766 100644
--- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
+++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
@@ -74,9 +74,9 @@
class BytecodeGraphTester {
public:
- BytecodeGraphTester(Isolate* isolate, const char* script,
+ BytecodeGraphTester(Isolate* isolate, Zone* zone, const char* script,
const char* filter = kFunctionName)
- : isolate_(isolate), script_(script) {
+ : isolate_(isolate), zone_(zone), script_(script) {
i::FLAG_ignition = true;
i::FLAG_always_opt = false;
i::FLAG_allow_natives_syntax = true;
@@ -108,6 +108,7 @@
private:
Isolate* isolate_;
+ Zone* zone_;
const char* script_;
Handle<JSFunction> GetFunction(const char* functionName) {
@@ -122,7 +123,7 @@
// TODO(mstarzinger): We should be able to prime CompilationInfo without
// having to instantiate a ParseInfo first. Fix this!
- ParseInfo parse_info(handle(function->shared()));
+ ParseInfo parse_info(zone_, handle(function->shared()));
CompilationInfo compilation_info(&parse_info, function);
compilation_info.SetOptimizing();
@@ -186,6 +187,7 @@
TEST(BytecodeGraphBuilderReturnStatements) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -210,7 +212,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -221,6 +223,7 @@
TEST(BytecodeGraphBuilderPrimitiveExpressions) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -236,7 +239,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -247,6 +250,7 @@
TEST(BytecodeGraphBuilderTwoParameterTests) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<2> snippets[] = {
@@ -293,7 +297,7 @@
SNPrintF(script, "function %s(p1, p2) { %s }\n%s(0, 0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0), snippets[i].parameter(1))
@@ -306,6 +310,7 @@
TEST(BytecodeGraphBuilderNamedLoad) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -336,7 +341,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -348,6 +353,7 @@
TEST(BytecodeGraphBuilderKeyedLoad) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<2> snippets[] = {
@@ -391,7 +397,7 @@
SNPrintF(script, "function %s(p1, p2) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0), snippets[i].parameter(1))
@@ -403,6 +409,7 @@
void TestBytecodeGraphBuilderNamedStore(size_t shard) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -440,7 +447,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -453,6 +460,7 @@
void TestBytecodeGraphBuilderKeyedStore(size_t shard) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<2> snippets[] = {
@@ -498,7 +506,7 @@
SNPrintF(script, "function %s(p1, p2) { %s };\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -511,6 +519,7 @@
TEST(BytecodeGraphBuilderPropertyCall) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -532,7 +541,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s({func() {}});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -544,6 +553,7 @@
TEST(BytecodeGraphBuilderCallNew) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -570,7 +580,7 @@
};
for (size_t i = 0; i < arraysize(snippets); i++) {
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -581,6 +591,7 @@
TEST(BytecodeGraphBuilderCreateClosure) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -607,7 +618,7 @@
};
for (size_t i = 0; i < arraysize(snippets); i++) {
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -618,6 +629,7 @@
TEST(BytecodeGraphBuilderCallRuntime) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -633,7 +645,7 @@
};
for (size_t i = 0; i < arraysize(snippets); i++) {
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -644,6 +656,7 @@
TEST(BytecodeGraphBuilderInvokeIntrinsic) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -654,7 +667,7 @@
};
for (size_t i = 0; i < arraysize(snippets); i++) {
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -665,6 +678,7 @@
void TestBytecodeGraphBuilderGlobals(size_t shard) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -703,7 +717,7 @@
for (size_t i = 0; i < arraysize(snippets); i++) {
if ((i % 2) != shard) continue;
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -720,6 +734,7 @@
TEST(BytecodeGraphBuilderToName) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -752,7 +767,7 @@
SNPrintF(script, "function %s() { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -763,6 +778,7 @@
TEST(BytecodeGraphBuilderLogicalNot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -782,7 +798,7 @@
SNPrintF(script, "function %s(p1) { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -794,6 +810,7 @@
TEST(BytecodeGraphBuilderTypeOf) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -818,7 +835,7 @@
SNPrintF(script, "function %s(p1) { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -830,6 +847,7 @@
TEST(BytecodeGraphBuilderCountOperation) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -871,7 +889,7 @@
SNPrintF(script, "function %s(p1) { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -883,6 +901,7 @@
TEST(BytecodeGraphBuilderDelete) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -909,7 +928,7 @@
SNPrintF(script, "function %s(p1) { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -921,6 +940,7 @@
TEST(BytecodeGraphBuilderDeleteGlobal) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -961,7 +981,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s %s({});", snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -972,6 +992,7 @@
TEST(BytecodeGraphBuilderDeleteLookupSlot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
// TODO(mythria): Add more tests when we have support for LdaLookupSlot.
@@ -997,7 +1018,7 @@
SNPrintF(script, "%s %s %s", function_prologue, snippets[i].code_snippet,
function_epilogue);
- BytecodeGraphTester tester(isolate, script.start(), "t");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "t");
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1008,6 +1029,7 @@
TEST(BytecodeGraphBuilderLookupSlot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
const char* function_prologue = "var f;"
@@ -1037,7 +1059,7 @@
SNPrintF(script, "%s %s %s", function_prologue, snippets[i].code_snippet,
function_epilogue);
- BytecodeGraphTester tester(isolate, script.start(), "t");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "t");
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1047,6 +1069,7 @@
TEST(BytecodeGraphBuilderLookupContextSlot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
// Testing with eval called in the current context.
@@ -1064,7 +1087,7 @@
inner_eval_prologue, inner_eval_snippets[i].code_snippet,
inner_eval_epilogue, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*inner_eval_snippets[i].return_value()));
@@ -1086,7 +1109,7 @@
outer_eval_prologue, outer_eval_snippets[i].code_snippet,
outer_eval_epilogue, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*outer_eval_snippets[i].return_value()));
@@ -1096,6 +1119,7 @@
TEST(BytecodeGraphBuilderLookupGlobalSlot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
// Testing with eval called in the current context.
@@ -1113,7 +1137,7 @@
inner_eval_prologue, inner_eval_snippets[i].code_snippet,
inner_eval_epilogue, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*inner_eval_snippets[i].return_value()));
@@ -1135,7 +1159,7 @@
outer_eval_prologue, outer_eval_snippets[i].code_snippet,
outer_eval_epilogue, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*outer_eval_snippets[i].return_value()));
@@ -1145,6 +1169,7 @@
TEST(BytecodeGraphBuilderLookupSlotWide) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
const char* function_prologue =
@@ -1176,7 +1201,7 @@
SNPrintF(script, "%s %s %s", function_prologue, snippets[i].code_snippet,
function_epilogue);
- BytecodeGraphTester tester(isolate, script.start(), "t");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "t");
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1187,6 +1212,7 @@
TEST(BytecodeGraphBuilderCallLookupSlot) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0> snippets[] = {
{"g = function(){ return 2 }; eval(''); return g();",
@@ -1204,7 +1230,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1215,6 +1241,7 @@
TEST(BytecodeGraphBuilderEval) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1255,7 +1282,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1266,6 +1293,7 @@
TEST(BytecodeGraphBuilderEvalParams) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<1> snippets[] = {
{"var x = 10; return eval('x + p1;');",
@@ -1282,7 +1310,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "function %s(p1) { %s }\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -1294,6 +1322,7 @@
TEST(BytecodeGraphBuilderEvalGlobal) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1309,7 +1338,7 @@
};
for (size_t i = 0; i < arraysize(snippets); i++) {
- BytecodeGraphTester tester(isolate, snippets[i].code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippets[i].code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1371,6 +1400,7 @@
TEST(BytecodeGraphBuilderCompare) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
Handle<Object> lhs_values[] = {
factory->NewNumberFromInt(10), factory->NewHeapNumber(3.45),
@@ -1389,7 +1419,7 @@
SNPrintF(script, "function %s(p1, p2) { %s }\n%s({}, {});", kFunctionName,
get_code_snippet(kCompareOperators[i]), kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>();
for (size_t j = 0; j < arraysize(lhs_values); j++) {
for (size_t k = 0; k < arraysize(rhs_values); k++) {
@@ -1407,6 +1437,7 @@
TEST(BytecodeGraphBuilderTestIn) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<2> snippets[] = {
@@ -1442,7 +1473,7 @@
SNPrintF(script, "function %s(p1, p2) { %s }\n%s({}, {});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0), snippets[i].parameter(1))
@@ -1455,6 +1486,7 @@
TEST(BytecodeGraphBuilderTestInstanceOf) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -1473,7 +1505,7 @@
SNPrintF(script, "function %s(p1) { %s }\n%s({});", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -1484,6 +1516,7 @@
TEST(BytecodeGraphBuilderTryCatch) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0> snippets[] = {
{"var a = 1; try { a = 2 } catch(e) { a = 3 }; return a;",
@@ -1502,7 +1535,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1512,6 +1545,7 @@
TEST(BytecodeGraphBuilderTryFinally1) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0> snippets[] = {
{"var a = 1; try { a = a + 1; } finally { a = a + 2; }; return a;",
@@ -1539,7 +1573,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1549,6 +1583,7 @@
TEST(BytecodeGraphBuilderTryFinally2) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0, const char*> snippets[] = {
{"var a = 1; try { a = 2; throw 23; } finally { a = 3 }; return a;",
@@ -1562,7 +1597,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
v8::Local<v8::String> message = tester.CheckThrowsReturnMessage()->Get();
v8::Local<v8::String> expected_string = v8_str(snippets[i].return_value());
CHECK(
@@ -1574,6 +1609,7 @@
TEST(BytecodeGraphBuilderThrow) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
// TODO(mythria): Add more tests when real try-catch and deoptimization
// information are supported.
@@ -1590,7 +1626,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
v8::Local<v8::String> message = tester.CheckThrowsReturnMessage()->Get();
v8::Local<v8::String> expected_string = v8_str(snippets[i].return_value());
CHECK(
@@ -1603,6 +1639,7 @@
TEST(BytecodeGraphBuilderContext) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1650,7 +1687,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s", snippets[i].code_snippet);
- BytecodeGraphTester tester(isolate, script.start(), "f");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "f");
auto callable = tester.GetCallable<>("f");
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1661,6 +1698,7 @@
TEST(BytecodeGraphBuilderLoadContext) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -1714,7 +1752,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s", snippets[i].code_snippet);
- BytecodeGraphTester tester(isolate, script.start(), "*");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "*");
auto callable = tester.GetCallable<Handle<Object>>("f");
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -1726,6 +1764,7 @@
TEST(BytecodeGraphBuilderCreateArgumentsNoParameters) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1745,7 +1784,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s\n%s();", snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1756,6 +1795,7 @@
TEST(BytecodeGraphBuilderCreateArguments) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<3> snippets[] = {
@@ -1787,7 +1827,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s\n%s();", snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable =
tester.GetCallable<Handle<Object>, Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
@@ -1801,6 +1841,7 @@
TEST(BytecodeGraphBuilderCreateRestArguments) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<3> snippets[] = {
@@ -1829,7 +1870,7 @@
ScopedVector<char> script(1024);
SNPrintF(script, "%s\n%s();", snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable =
tester.GetCallable<Handle<Object>, Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
@@ -1843,6 +1884,7 @@
TEST(BytecodeGraphBuilderRegExpLiterals) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1867,7 +1909,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1878,6 +1920,7 @@
TEST(BytecodeGraphBuilderArrayLiterals) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1906,7 +1949,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1917,6 +1960,7 @@
TEST(BytecodeGraphBuilderObjectLiterals) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -1969,7 +2013,7 @@
ScopedVector<char> script(4096);
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -1980,6 +2024,7 @@
TEST(BytecodeGraphBuilderIf) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -2077,7 +2122,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -2089,6 +2134,7 @@
TEST(BytecodeGraphBuilderConditionalOperator) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<1> snippets[] = {
@@ -2107,7 +2153,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -2119,6 +2165,7 @@
TEST(BytecodeGraphBuilderSwitch) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
const char* switch_code =
@@ -2154,7 +2201,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -2165,6 +2212,7 @@
TEST(BytecodeGraphBuilderSwitchMerge) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
const char* switch_code =
@@ -2202,7 +2250,7 @@
SNPrintF(script, "function %s(p1) { %s };\n%s(0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0)).ToHandleChecked();
@@ -2213,6 +2261,7 @@
TEST(BytecodeGraphBuilderNestedSwitch) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
const char* switch_code =
@@ -2260,7 +2309,7 @@
SNPrintF(script, "function %s(p1, p2) { %s };\n%s(0, 0);", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<Handle<Object>, Handle<Object>>();
Handle<Object> return_value =
callable(snippets[i].parameter(0), snippets[i].parameter(1))
@@ -2273,6 +2322,7 @@
TEST(BytecodeGraphBuilderBreakableBlocks) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2302,7 +2352,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2313,6 +2363,7 @@
TEST(BytecodeGraphBuilderWhile) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2350,7 +2401,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2361,6 +2412,7 @@
TEST(BytecodeGraphBuilderDo) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2398,7 +2450,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2409,6 +2461,7 @@
TEST(BytecodeGraphBuilderFor) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2491,7 +2544,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2502,6 +2555,7 @@
TEST(BytecodeGraphBuilderForIn) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
{"var sum = 0;\n"
@@ -2562,7 +2616,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2573,6 +2627,7 @@
TEST(BytecodeGraphBuilderForOf) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
{" var r = 0;\n"
@@ -2654,7 +2709,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2690,7 +2745,8 @@
HandleAndZoneScope scope;
auto isolate = scope.main_isolate();
auto factory = isolate->factory();
- BytecodeGraphTester tester(isolate, script.c_str());
+ auto zone = scope.main_zone();
+ BytecodeGraphTester tester(isolate, zone, script.c_str());
auto callable = tester.GetCallable<Handle<Object>>();
for (int a = 0; a < 3; a++) {
Handle<Object> return_val =
@@ -2708,6 +2764,7 @@
FLAG_harmony_do_expressions = true;
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
{"var a = do {}; return a;", {factory->undefined_value()}},
@@ -2725,7 +2782,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2737,6 +2794,7 @@
TEST(BytecodeGraphBuilderWithStatement) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0> snippets[] = {
{"with({x:42}) return x;", {handle(Smi::FromInt(42), isolate)}},
@@ -2763,7 +2821,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2773,6 +2831,7 @@
TEST(BytecodeGraphBuilderConstDeclaration) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2809,7 +2868,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2821,7 +2880,7 @@
SNPrintF(script, "function %s() {'use strict'; %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2831,6 +2890,7 @@
TEST(BytecodeGraphBuilderConstDeclarationLookupSlots) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
Factory* factory = isolate->factory();
ExpectedSnippet<0> snippets[] = {
@@ -2850,7 +2910,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2862,7 +2922,7 @@
SNPrintF(script, "function %s() {'use strict'; %s }\n%s();", kFunctionName,
snippets[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*snippets[i].return_value()));
@@ -2872,6 +2932,7 @@
TEST(BytecodeGraphBuilderConstInLookupContextChain) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
const char* prologue =
"function OuterMost() {\n"
@@ -2909,7 +2970,7 @@
SNPrintF(script, "%s %s %s", prologue, const_decl[i].code_snippet,
epilogue);
- BytecodeGraphTester tester(isolate, script.start(), "*");
+ BytecodeGraphTester tester(isolate, zone, script.start(), "*");
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
CHECK(return_value->SameValue(*const_decl[i].return_value()));
@@ -2919,6 +2980,7 @@
TEST(BytecodeGraphBuilderIllegalConstDeclaration) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
ExpectedSnippet<0, const char*> illegal_const_decl[] = {
{"const x = x = 10 + 3; return x;",
@@ -2941,7 +3003,7 @@
SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
illegal_const_decl[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
v8::Local<v8::String> message = tester.CheckThrowsReturnMessage()->Get();
v8::Local<v8::String> expected_string =
v8_str(illegal_const_decl[i].return_value());
@@ -2956,7 +3018,7 @@
SNPrintF(script, "function %s() {'use strict'; %s }\n%s();", kFunctionName,
illegal_const_decl[i].code_snippet, kFunctionName);
- BytecodeGraphTester tester(isolate, script.start());
+ BytecodeGraphTester tester(isolate, zone, script.start());
v8::Local<v8::String> message = tester.CheckThrowsReturnMessage()->Get();
v8::Local<v8::String> expected_string =
v8_str(illegal_const_decl[i].return_value());
@@ -2974,6 +3036,7 @@
TEST(BytecodeGraphBuilderDebuggerStatement) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
v8::Debug::SetDebugEventListener(CcTest::isolate(), DebugEventCounter);
@@ -2984,7 +3047,7 @@
"f();",
{isolate->factory()->undefined_value()}};
- BytecodeGraphTester tester(isolate, snippet.code_snippet);
+ BytecodeGraphTester tester(isolate, zone, snippet.code_snippet);
auto callable = tester.GetCallable<>();
Handle<Object> return_value = callable().ToHandleChecked();
« no previous file with comments | « test/cctest/compiler/test-loop-assignment-analysis.cc ('k') | test/cctest/parsing/test-preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698