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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1471913004: Revert of [Interpreter] Add CreateClosure to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
Index: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index d1b3d71e21fda563a37a297c06a2191549885af7..4177e07dc28697ef27aff8b72e260384f69828e2 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -2665,7 +2665,7 @@
"return delete a[1];",
2 * kPointerSize,
1,
- 28,
+ 29,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -2673,7 +2673,8 @@
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(1), U8(0), //
+ B(LdaConstant), U8(1), //
+ B(CreateClosure), U8(0), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
B(Star), R(1), //
B(LdaSmi8), U8(1), //
@@ -2794,21 +2795,23 @@
{"return function(){ }",
0,
1,
- 4,
- {
- B(CreateClosure), U8(0), U8(0), //
- B(Return) //
+ 5,
+ {
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
+ B(Return) //
},
1,
{InstanceType::SHARED_FUNCTION_INFO_TYPE}},
{"return (function(){ })()",
2 * kPointerSize,
1,
- 14,
+ 15,
{
B(LdaUndefined), //
B(Star), R(1), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(0), //
B(Call), R(0), R(1), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
@@ -2818,11 +2821,12 @@
{"return (function(x){ return x; })(1)",
3 * kPointerSize,
1,
- 18,
+ 19,
{
B(LdaUndefined), //
B(Star), R(1), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(Star), R(2), //
@@ -3100,12 +3104,13 @@
{"return { func: function() { } };",
1 * kPointerSize,
1,
- 17,
+ 18,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(CreateClosure), U8(2), U8(0), //
+ B(LdaConstant), U8(2), //
+ B(CreateClosure), U8(0), //
B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
@@ -3117,12 +3122,13 @@
{"return { func(a) { return a; } };",
1 * kPointerSize,
1,
- 17,
+ 18,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(CreateClosure), U8(2), U8(0), //
+ B(LdaConstant), U8(2), //
+ B(CreateClosure), U8(0), //
B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
@@ -3134,14 +3140,15 @@
{"return { get a() { return 2; } };",
5 * kPointerSize,
1,
- 30,
+ 31,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(LdaConstant), U8(1), //
B(Star), R(1), //
- B(CreateClosure), U8(2), U8(0), //
+ B(LdaConstant), U8(2), //
+ B(CreateClosure), U8(0), //
B(Star), R(2), //
B(LdaNull), //
B(Star), R(3), //
@@ -3159,16 +3166,18 @@
{"return { get a() { return this.x; }, set a(val) { this.x = val } };",
5 * kPointerSize,
1,
- 32,
+ 34,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
B(LdaConstant), U8(1), //
B(Star), R(1), //
- B(CreateClosure), U8(2), U8(0), //
+ B(LdaConstant), U8(2), //
+ B(CreateClosure), U8(0), //
B(Star), R(2), //
- B(CreateClosure), U8(3), U8(0), //
+ B(LdaConstant), U8(3), //
+ B(CreateClosure), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3185,7 +3194,7 @@
{"return { set b(val) { this.y = val } };",
5 * kPointerSize,
1,
- 30,
+ 31,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
@@ -3194,7 +3203,8 @@
B(Star), R(1), //
B(LdaNull), //
B(Star), R(2), //
- B(CreateClosure), U8(2), U8(0), //
+ B(LdaConstant), U8(2), //
+ B(CreateClosure), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3329,7 +3339,7 @@
{"var n = 'name'; return { [n]: 'val', get a() { }, set a(b) {} };",
5 * kPointerSize,
1,
- 67,
+ 69,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
@@ -3348,7 +3358,8 @@
B(LdaConstant), U8(3), //
B(ToName), //
B(Star), R(2), //
- B(CreateClosure), U8(4), U8(0), //
+ B(LdaConstant), U8(4), //
+ B(CreateClosure), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3357,7 +3368,8 @@
B(LdaConstant), U8(3), //
B(ToName), //
B(Star), R(2), //
- B(CreateClosure), U8(5), U8(0), //
+ B(LdaConstant), U8(5), //
+ B(CreateClosure), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3394,7 +3406,7 @@
{"var a = { func: function() { } };",
5 * kPointerSize,
1,
- 49,
+ 50,
{
B(LdaConstant), U8(0), //
B(Star), R(1), //
@@ -3408,7 +3420,8 @@
B(LdaConstant), U8(2), //
B(CreateObjectLiteral), U8(0), U8(has_function_flags), //
B(Star), R(4), //
- B(CreateClosure), U8(4), U8(1), //
+ B(LdaConstant), U8(4), //
+ B(CreateClosure), U8(1), //
B(StoreICSloppy), R(4), U8(3), U8(5), //
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), //
B(Ldar), R(4), //
@@ -3650,12 +3663,13 @@
{"var a; return function() { a = 1; };",
1 * kPointerSize,
1,
- 11,
+ 12,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -3663,14 +3677,15 @@
{"var a = 1; return function() { a = 2; };",
1 * kPointerSize,
1,
- 16,
+ 17,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -3678,7 +3693,7 @@
{"var a = 1; var b = 2; return function() { a = 2; b = 3 };",
1 * kPointerSize,
1,
- 21,
+ 22,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3687,7 +3702,8 @@
B(StaContextSlot), R(0), U8(first_context_slot), //
B(LdaSmi8), U8(2), //
B(StaContextSlot), R(0), U8(first_context_slot + 1), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -3695,14 +3711,15 @@
{"var a; (function() { a = 2; })(); return a;",
3 * kPointerSize,
1,
- 24,
+ 25,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(LdaUndefined), //
B(Star), R(2), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(1), //
B(Call), R(1), R(2), U8(0), U8(vector->GetIndex(slot)), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
@@ -3713,7 +3730,7 @@
{"'use strict'; let a = 1; { let b = 2; return function() { a + b; }; }",
4 * kPointerSize,
1,
- 44,
+ 45,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3732,7 +3749,8 @@
B(StaContextSlot), R(1), U8(first_context_slot), //
B(LdaSmi8), U8(2), //
B(StaContextSlot), R(1), U8(first_context_slot), //
- B(CreateClosure), U8(1), U8(0), //
+ B(LdaConstant), U8(1), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
2,
@@ -3759,14 +3777,15 @@
{"function f(arg1) { return function() { arg1 = 2; }; }",
1 * kPointerSize,
2,
- 16,
+ 17,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(Ldar), R(helper.kLastParamIndex), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -3774,14 +3793,15 @@
{"function f(arg1) { var a = function() { arg1 = 2; }; return arg1; }",
2 * kPointerSize,
2,
- 21,
+ 22,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(1), //
B(Ldar), R(helper.kLastParamIndex), //
B(StaContextSlot), R(1), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(Return), //
@@ -3791,7 +3811,7 @@
{"function f(a1, a2, a3, a4) { return function() { a1 = a3; }; }",
1 * kPointerSize,
5,
- 21,
+ 22,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3800,7 +3820,8 @@
B(StaContextSlot), R(0), U8(first_context_slot + 1), //
B(Ldar), R(helper.kLastParamIndex -1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -3808,14 +3829,15 @@
{"function f() { var self = this; return function() { self = 2; }; }",
1 * kPointerSize,
1,
- 16,
+ 17,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(Ldar), R(helper.kLastParamIndex), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Return), //
},
1,
@@ -4053,14 +4075,15 @@
{"var a = 1; var b = function() { return a }; return ++a;",
2 * kPointerSize,
1,
- 26,
+ 27,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
B(PushContext), R(1), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(1), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(ToNumber), //
@@ -4073,14 +4096,15 @@
{"var a = 1; var b = function() { return a }; return a--;",
3 * kPointerSize,
1,
- 30,
+ 31,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
B(PushContext), R(1), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(1), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(ToNumber), //
@@ -4290,14 +4314,15 @@
{"var a = 1; (function f() { return a; }); a |= 24;",
2 * kPointerSize,
1,
- 29,
+ 30,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), R(closure), //
U8(1), //
B(PushContext), R(0), //
B(LdaSmi8), U8(1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(CreateClosure), U8(0), U8(0), //
+ B(LdaConstant), U8(0), //
+ B(CreateClosure), U8(0), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
B(Star), R(1), //
B(LdaSmi8), U8(24), //
« no previous file with comments | « test/cctest/compiler/test-run-bytecode-graph-builder.cc ('k') | test/unittests/compiler/bytecode-graph-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698