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

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

Issue 1474103002: Re-reland "[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 7c9893b9307a0223c4a0d0592d55c1f516951b6d..ccddb38b34294ba21625e88028503d479f946ce7 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -2665,7 +2665,7 @@ TEST(Delete) {
"return delete a[1];",
2 * kPointerSize,
1,
- 29,
+ 28,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -2673,8 +2673,7 @@ TEST(Delete) {
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(LdaConstant), U8(1), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(1), U8(0), //
B(LdaContextSlot), R(0), U8(first_context_slot), //
B(Star), R(1), //
B(LdaSmi8), U8(1), //
@@ -2795,23 +2794,21 @@ TEST(FunctionLiterals) {
{"return function(){ }",
0,
1,
- 5,
+ 4,
{
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
- B(Return) //
+ B(CreateClosure), U8(0), U8(0), //
+ B(Return) //
},
1,
{InstanceType::SHARED_FUNCTION_INFO_TYPE}},
{"return (function(){ })()",
2 * kPointerSize,
1,
- 15,
+ 14,
{
B(LdaUndefined), //
B(Star), R(1), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Star), R(0), //
B(Call), R(0), R(1), U8(0), U8(vector->GetIndex(slot)), //
B(Return) //
@@ -2821,12 +2818,11 @@ TEST(FunctionLiterals) {
{"return (function(x){ return x; })(1)",
3 * kPointerSize,
1,
- 19,
+ 18,
{
B(LdaUndefined), //
B(Star), R(1), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Star), R(0), //
B(LdaSmi8), U8(1), //
B(Star), R(2), //
@@ -3099,13 +3095,12 @@ TEST(ObjectLiterals) {
{"return { func: function() { } };",
1 * kPointerSize,
1,
- 18,
+ 17,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(LdaConstant), U8(2), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(2), U8(0), //
B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
@@ -3117,13 +3112,12 @@ TEST(ObjectLiterals) {
{"return { func(a) { return a; } };",
1 * kPointerSize,
1,
- 18,
+ 17,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(LdaConstant), U8(2), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(2), U8(0), //
B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
@@ -3135,15 +3129,14 @@ TEST(ObjectLiterals) {
{"return { get a() { return 2; } };",
5 * kPointerSize,
1,
- 31,
+ 30,
{
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(LdaConstant), U8(2), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(2), U8(0), //
B(Star), R(2), //
B(LdaNull), //
B(Star), R(3), //
@@ -3161,18 +3154,16 @@ TEST(ObjectLiterals) {
{"return { get a() { return this.x; }, set a(val) { this.x = val } };",
5 * kPointerSize,
1,
- 34,
+ 32,
{
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(LdaConstant), U8(2), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(2), U8(0), //
B(Star), R(2), //
- B(LdaConstant), U8(3), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(3), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3189,7 +3180,7 @@ TEST(ObjectLiterals) {
{"return { set b(val) { this.y = val } };",
5 * kPointerSize,
1,
- 31,
+ 30,
{
B(LdaConstant), U8(0), //
B(CreateObjectLiteral), U8(0), U8(deep_elements_flags), //
@@ -3198,8 +3189,7 @@ TEST(ObjectLiterals) {
B(Star), R(1), //
B(LdaNull), //
B(Star), R(2), //
- B(LdaConstant), U8(2), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(2), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3334,7 +3324,7 @@ TEST(ObjectLiterals) {
{"var n = 'name'; return { [n]: 'val', get a() { }, set a(b) {} };",
5 * kPointerSize,
1,
- 69,
+ 67,
{
B(LdaConstant), U8(0), //
B(Star), R(0), //
@@ -3353,8 +3343,7 @@ TEST(ObjectLiterals) {
B(LdaConstant), U8(3), //
B(ToName), //
B(Star), R(2), //
- B(LdaConstant), U8(4), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(4), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3363,8 +3352,7 @@ TEST(ObjectLiterals) {
B(LdaConstant), U8(3), //
B(ToName), //
B(Star), R(2), //
- B(LdaConstant), U8(5), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(5), U8(0), //
B(Star), R(3), //
B(LdaZero), //
B(Star), R(4), //
@@ -3401,7 +3389,7 @@ TEST(TopLevelObjectLiterals) {
{"var a = { func: function() { } };",
5 * kPointerSize,
1,
- 50,
+ 49,
{
B(LdaConstant), U8(0), //
B(Star), R(1), //
@@ -3415,8 +3403,7 @@ TEST(TopLevelObjectLiterals) {
B(LdaConstant), U8(2), //
B(CreateObjectLiteral), U8(0), U8(has_function_flags), //
B(Star), R(4), //
- B(LdaConstant), U8(4), //
- B(CreateClosure), U8(1), //
+ B(CreateClosure), U8(4), U8(1), //
B(StoreICSloppy), R(4), U8(3), U8(5), //
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), //
B(Ldar), R(4), //
@@ -3658,13 +3645,12 @@ TEST(ContextVariables) {
{"var a; return function() { a = 1; };",
1 * kPointerSize,
1,
- 12,
+ 11,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -3672,15 +3658,14 @@ TEST(ContextVariables) {
{"var a = 1; return function() { a = 2; };",
1 * kPointerSize,
1,
- 17,
+ 16,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -3688,7 +3673,7 @@ TEST(ContextVariables) {
{"var a = 1; var b = 2; return function() { a = 2; b = 3 };",
1 * kPointerSize,
1,
- 22,
+ 21,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3697,8 +3682,7 @@ TEST(ContextVariables) {
B(StaContextSlot), R(0), U8(first_context_slot), //
B(LdaSmi8), U8(2), //
B(StaContextSlot), R(0), U8(first_context_slot + 1), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -3706,15 +3690,14 @@ TEST(ContextVariables) {
{"var a; (function() { a = 2; })(); return a;",
3 * kPointerSize,
1,
- 25,
+ 24,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
B(PushContext), R(0), //
B(LdaUndefined), //
B(Star), R(2), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), 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), //
@@ -3725,7 +3708,7 @@ TEST(ContextVariables) {
{"'use strict'; let a = 1; { let b = 2; return function() { a + b; }; }",
4 * kPointerSize,
1,
- 45,
+ 44,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3744,8 +3727,7 @@ TEST(ContextVariables) {
B(StaContextSlot), R(1), U8(first_context_slot), //
B(LdaSmi8), U8(2), //
B(StaContextSlot), R(1), U8(first_context_slot), //
- B(LdaConstant), U8(1), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(1), U8(0), //
B(Return), //
},
2,
@@ -3772,15 +3754,14 @@ TEST(ContextParameters) {
{"function f(arg1) { return function() { arg1 = 2; }; }",
1 * kPointerSize,
2,
- 17,
+ 16,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -3788,15 +3769,14 @@ TEST(ContextParameters) {
{"function f(arg1) { var a = function() { arg1 = 2; }; return arg1; }",
2 * kPointerSize,
2,
- 22,
+ 21,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(Return), //
@@ -3806,7 +3786,7 @@ TEST(ContextParameters) {
{"function f(a1, a2, a3, a4) { return function() { a1 = a3; }; }",
1 * kPointerSize,
5,
- 22,
+ 21,
{
B(CallRuntime), U16(Runtime::kNewFunctionContext), //
R(closure), U8(1), //
@@ -3815,8 +3795,7 @@ TEST(ContextParameters) {
B(StaContextSlot), R(0), U8(first_context_slot + 1), //
B(Ldar), R(helper.kLastParamIndex -1), //
B(StaContextSlot), R(0), U8(first_context_slot), //
- B(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -3824,15 +3803,14 @@ TEST(ContextParameters) {
{"function f() { var self = this; return function() { self = 2; }; }",
1 * kPointerSize,
1,
- 17,
+ 16,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Return), //
},
1,
@@ -4070,15 +4048,14 @@ TEST(CountOperators) {
{"var a = 1; var b = function() { return a }; return ++a;",
2 * kPointerSize,
1,
- 27,
+ 26,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(ToNumber), //
@@ -4091,15 +4068,14 @@ TEST(CountOperators) {
{"var a = 1; var b = function() { return a }; return a--;",
3 * kPointerSize,
1,
- 31,
+ 30,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), U8(0), //
B(Star), R(0), //
B(LdaContextSlot), R(1), U8(first_context_slot), //
B(ToNumber), //
@@ -4309,15 +4285,14 @@ TEST(CompoundExpressions) {
{"var a = 1; (function f() { return a; }); a |= 24;",
2 * kPointerSize,
1,
- 30,
+ 29,
{
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(LdaConstant), U8(0), //
- B(CreateClosure), U8(0), //
+ B(CreateClosure), U8(0), 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/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698