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 61b8c36b1f28478dead596ea5b9af2d727352666..ff586087d11ee96495e11edf0cd2e4237571d929 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -4687,69 +4687,57 @@ TEST(ForIn) { |
0}, |
{"var x = 'potatoes';\n" |
"for (var p in x) { return p; }", |
- 5 * kPointerSize, |
+ 8 * kPointerSize, |
1, |
- 46, |
+ 39, |
{ |
- B(LdaConstant), U8(0), // |
- B(Star), R(1), // |
- B(JumpIfUndefined), U8(40), // |
- B(JumpIfNull), U8(38), // |
- B(ToObject), // |
- B(Star), R(3), // |
- B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(3), U8(1), // |
- B(ForInPrepare), R(3), // |
- B(JumpIfUndefined), U8(26), // |
- B(Star), R(4), // |
- B(LdaZero), // |
- B(Star), R(3), // |
- B(ForInDone), R(4), // |
- B(JumpIfTrue), U8(17), // |
- B(ForInNext), R(4), R(3), // |
- B(JumpIfUndefined), U8(7), // |
- B(Star), R(0), // |
- B(Star), R(2), // |
- B(Return), // |
- B(Ldar), R(3), // |
- B(Inc), // |
- B(Jump), U8(-19), // |
- B(LdaUndefined), // |
- B(Return), // |
+ B(LdaConstant), U8(0), // |
+ B(Star), R(1), // |
+ B(JumpIfUndefined), U8(33), // |
+ B(JumpIfNull), U8(31), // |
+ B(ForInPrepare), R(3), R(4), R(5), R(6), // |
+ B(LdaZero), // |
+ B(Star), R(7), // |
+ B(ForInDone), R(7), R(6), // |
+ B(JumpIfTrue), U8(18), // |
+ B(ForInNext), R(3), R(4), R(5), R(7), // |
+ B(JumpIfUndefined), U8(7), // |
+ B(Star), R(0), // |
+ B(Star), R(2), // |
+ B(Return), // |
+ B(ForInStep), R(7), // |
+ B(Jump), U8(-19), // |
+ B(LdaUndefined), // |
+ B(Return), // |
}, |
1, |
{InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}}, |
{"var x = 0;\n" |
"for (var p in [1,2,3]) { x += p; }", |
- 5 * kPointerSize, |
+ 8 * kPointerSize, |
1, |
- 52, |
+ 45, |
{ |
- B(LdaZero), // |
- B(Star), R(1), // |
- B(CreateArrayLiteral), U8(0), U8(0), U8(simple_flags), // |
- B(JumpIfUndefined), U8(43), // |
- B(JumpIfNull), U8(41), // |
- B(ToObject), // |
- B(Star), R(3), // |
- B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(3), U8(1), // |
- B(ForInPrepare), R(3), // |
- B(JumpIfUndefined), U8(29), // |
- B(Star), R(4), // |
- B(LdaZero), // |
- B(Star), R(3), // |
- B(ForInDone), R(4), // |
- B(JumpIfTrue), U8(20), // |
- B(ForInNext), R(4), R(3), // |
- B(JumpIfUndefined), U8(10), // |
- B(Star), R(0), // |
- B(Star), R(2), // |
- B(Add), R(1), // |
- B(Star), R(1), // |
- B(Ldar), R(3), // |
- B(Inc), // |
- B(Jump), U8(-22), // |
- B(LdaUndefined), // |
- B(Return), // |
+ B(LdaZero), // |
+ B(Star), R(1), // |
+ B(CreateArrayLiteral), U8(0), U8(0), U8(3), // |
+ B(JumpIfUndefined), U8(36), // |
+ B(JumpIfNull), U8(34), // |
+ B(ForInPrepare), R(3), R(4), R(5), R(6), // |
+ B(LdaZero), // |
+ B(Star), R(7), // |
+ B(ForInDone), R(7), R(6), // |
+ B(JumpIfTrue), U8(21), // |
+ B(ForInNext), R(3), R(4), R(5), R(7), // |
+ B(JumpIfUndefined), U8(10), // |
+ B(Star), R(0), // |
+ B(Star), R(2), // |
+ B(Add), R(1), // |
+ B(Star), R(1), // |
+ B(ForInStep), R(7), // |
+ B(Jump), U8(-22), // |
+ B(LdaUndefined), // |
+ B(Return), // |
}, |
1, |
{InstanceType::FIXED_ARRAY_TYPE}}, |
@@ -4758,86 +4746,74 @@ TEST(ForIn) { |
" if (x['a'] == 10) continue;\n" |
" if (x['a'] == 20) break;\n" |
"}", |
- 4 * kPointerSize, |
+ 7 * kPointerSize, |
1, |
- 81, |
+ 74, |
{ |
- B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), // |
- B(Star), R(0), // |
- B(CreateArrayLiteral), U8(1), U8(1), U8(simple_flags), // |
- B(JumpIfUndefined), U8(69), // |
- B(JumpIfNull), U8(67), // |
- B(ToObject), // |
- B(Star), R(1), // |
- B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(1), U8(1), // |
- B(ForInPrepare), R(1), // |
- B(JumpIfUndefined), U8(55), // |
- B(Star), R(2), // |
- B(LdaZero), // |
- B(Star), R(1), // |
- B(ForInDone), R(2), // |
- B(JumpIfTrue), U8(46), // |
- B(ForInNext), R(2), R(1), // |
- B(JumpIfUndefined), U8(36), // |
- B(Star), R(3), // |
- B(StoreICSloppy), R(0), U8(2), U8(vector->GetIndex(slot4)), // |
- B(LoadICSloppy), R(0), U8(2), U8(vector->GetIndex(slot2)), // |
- B(Star), R(3), // |
- B(LdaSmi8), U8(10), // |
- B(TestEqual), R(3), // |
- B(JumpIfFalse), U8(4), // |
- B(Jump), U8(16), // |
- B(LoadICSloppy), R(0), U8(2), U8(vector->GetIndex(slot3)), // |
- B(Star), R(3), // |
- B(LdaSmi8), U8(20), // |
- B(TestEqual), R(3), // |
- B(JumpIfFalse), U8(4), // |
- B(Jump), U8(7), // |
- B(Ldar), R(1), // |
- B(Inc), // |
- B(Jump), U8(-48), // |
- B(LdaUndefined), // |
- B(Return), // |
+ B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), // |
+ B(Star), R(0), // |
+ B(CreateArrayLiteral), U8(1), U8(1), U8(simple_flags), // |
+ B(JumpIfUndefined), U8(62), // |
+ B(JumpIfNull), U8(60), // |
+ B(ForInPrepare), R(1), R(2), R(3), R(4), // |
+ B(LdaZero), // |
+ B(Star), R(5), // |
+ B(ForInDone), R(5), R(4), // |
+ B(JumpIfTrue), U8(47), // |
+ B(ForInNext), R(1), R(2), R(3), R(5), // |
+ B(JumpIfUndefined), U8(36), // |
+ B(Star), R(6), // |
+ B(StoreICSloppy), R(0), U8(2), U8(vector->GetIndex(slot4)), // |
+ B(LoadICSloppy), R(0), U8(2), U8(vector->GetIndex(slot2)), // |
+ B(Star), R(6), // |
+ B(LdaSmi8), U8(10), // |
+ B(TestEqual), R(6), // |
+ B(JumpIfFalse), U8(4), // |
+ B(Jump), U8(16), // |
+ B(LoadICSloppy), R(0), U8(2), U8(vector->GetIndex(slot3)), // |
+ B(Star), R(6), // |
+ B(LdaSmi8), U8(20), // |
+ B(TestEqual), R(6), // |
+ B(JumpIfFalse), U8(4), // |
+ B(Jump), U8(6), // |
+ B(ForInStep), R(5), // |
+ B(Jump), U8(-48), // |
+ B(LdaUndefined), // |
+ B(Return), // |
}, |
3, |
{InstanceType::FIXED_ARRAY_TYPE, InstanceType::FIXED_ARRAY_TYPE, |
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}}, |
{"var x = [ 10, 11, 12 ] ;\n" |
"for (x[0] in [1,2,3]) { return x[3]; }", |
- 5 * kPointerSize, |
+ 8 * kPointerSize, |
1, |
- 64, |
+ 57, |
{ |
- B(CreateArrayLiteral), U8(0), U8(0), U8(simple_flags), // |
- B(Star), R(0), // |
- B(CreateArrayLiteral), U8(1), U8(1), U8(simple_flags), // |
- B(JumpIfUndefined), U8(52), // |
- B(JumpIfNull), U8(50), // |
- B(ToObject), // |
- B(Star), R(1), // |
- B(CallRuntime), U16(Runtime::kGetPropertyNamesFast), R(1), U8(1), // |
- B(ForInPrepare), R(1), // |
- B(JumpIfUndefined), U8(38), // |
- B(Star), R(2), // |
- B(LdaZero), // |
- B(Star), R(1), // |
- B(ForInDone), R(2), // |
- B(JumpIfTrue), U8(29), // |
- B(ForInNext), R(2), R(1), // |
- B(JumpIfUndefined), U8(19), // |
- B(Star), R(3), // |
- B(LdaZero), // |
- B(Star), R(4), // |
- B(Ldar), R(3), // |
- B(KeyedStoreICSloppy), R(0), R(4), U8(vector->GetIndex(slot3)), // |
- B(LdaSmi8), U8(3), // |
- B(KeyedLoadICSloppy), R(0), U8(vector->GetIndex(slot2)), // |
- B(Return), // |
- B(Ldar), R(1), // |
- B(Inc), // |
- B(Jump), U8(-31), // |
- B(LdaUndefined), // |
- B(Return), // |
+ B(CreateArrayLiteral), U8(0), U8(0), U8(simple_flags), // |
+ B(Star), R(0), // |
+ B(CreateArrayLiteral), U8(1), U8(1), U8(simple_flags), // |
+ B(JumpIfUndefined), U8(45), // |
+ B(JumpIfNull), U8(43), // |
+ B(ForInPrepare), R(1), R(2), R(3), R(4), // |
+ B(LdaZero), // |
+ B(Star), R(5), // |
+ B(ForInDone), R(5), R(4), // |
+ B(JumpIfTrue), U8(30), // |
+ B(ForInNext), R(1), R(2), R(3), R(5), // |
+ B(JumpIfUndefined), U8(19), // |
+ B(Star), R(6), // |
+ B(LdaZero), // |
+ B(Star), R(7), // |
+ B(Ldar), R(6), // |
+ B(KeyedStoreICSloppy), R(0), R(7), U8(vector->GetIndex(slot3)), // |
+ B(LdaSmi8), U8(3), // |
+ B(KeyedLoadICSloppy), R(0), U8(vector->GetIndex(slot2)), // |
+ B(Return), // |
+ B(ForInStep), R(5), // |
+ B(Jump), U8(-31), // |
+ B(LdaUndefined), // |
+ B(Return), // |
}, |
2, |
{InstanceType::FIXED_ARRAY_TYPE, InstanceType::FIXED_ARRAY_TYPE}}, |