| 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 4b1b9d9b1d380f6fd8f37de7f4edd1b4b72185b9..a73cabab080e53bf65e06b302dac66b8c3c50d38 100644
|
| --- a/test/cctest/interpreter/test-bytecode-generator.cc
|
| +++ b/test/cctest/interpreter/test-bytecode-generator.cc
|
| @@ -959,7 +959,7 @@ TEST(LoadUnallocated) {
|
| for (size_t i = 0; i < arraysize(snippets); i++) {
|
| Handle<BytecodeArray> bytecode_array =
|
| helper.MakeBytecode(snippets[i].code_snippet, "f");
|
| - CheckBytecodeArrayEqual(snippets[i], bytecode_array, true);
|
| + CheckBytecodeArrayEqual(snippets[i], bytecode_array);
|
| }
|
| }
|
|
|
| @@ -1016,7 +1016,7 @@ TEST(StoreUnallocated) {
|
| for (size_t i = 0; i < arraysize(snippets); i++) {
|
| Handle<BytecodeArray> bytecode_array =
|
| helper.MakeBytecode(snippets[i].code_snippet, "f");
|
| - CheckBytecodeArrayEqual(snippets[i], bytecode_array, true);
|
| + CheckBytecodeArrayEqual(snippets[i], bytecode_array);
|
| }
|
| }
|
|
|
| @@ -1068,7 +1068,7 @@ TEST(CallRuntime) {
|
| for (size_t i = 0; i < arraysize(snippets); i++) {
|
| Handle<BytecodeArray> bytecode_array =
|
| helper.MakeBytecode(snippets[i].code_snippet, "f");
|
| - CheckBytecodeArrayEqual(snippets[i], bytecode_array, true);
|
| + CheckBytecodeArrayEqual(snippets[i], bytecode_array);
|
| }
|
| }
|
|
|
| @@ -1250,39 +1250,108 @@ TEST(DeclareGlobals) {
|
|
|
| ExpectedSnippet<int> snippets[] = {
|
| {"var a = 1;",
|
| - 4 * kPointerSize,
|
| + 5 * kPointerSize,
|
| 1,
|
| - 30,
|
| + 45,
|
| {
|
| - B(LdaConstant), U8(0), //
|
| - B(Star), R(1), //
|
| - B(LdaZero), //
|
| - B(Star), R(2), //
|
| - B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2), //
|
| - B(LdaConstant), U8(1), //
|
| - B(Star), R(1), //
|
| - B(LdaZero), //
|
| - B(Star), R(2), //
|
| - B(LdaSmi8), U8(1), //
|
| - B(Star), R(3), //
|
| - B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(1), //
|
| - U8(3), //
|
| - B(LdaUndefined), //
|
| - B(Return) //
|
| + B(Ldar), R(Register::function_closure().index()), //
|
| + B(Star), R(2), //
|
| + B(LdaConstant), U8(0), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kNewScriptContext), R(2), U8(2), //
|
| + B(PushContext), R(1), //
|
| + B(LdaConstant), U8(1), //
|
| + B(Star), R(2), //
|
| + B(LdaZero), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kDeclareGlobals), R(2), U8(2), //
|
| + B(LdaConstant), U8(2), //
|
| + B(Star), R(2), //
|
| + B(LdaZero), //
|
| + B(Star), R(3), //
|
| + B(LdaSmi8), U8(1), //
|
| + B(Star), R(4), //
|
| + B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(2), //
|
| + U8(3), //
|
| + B(LdaUndefined), //
|
| + B(Return) //
|
| },
|
| -1},
|
| {"function f() {}",
|
| - 2 * kPointerSize,
|
| + 3 * kPointerSize,
|
| 1,
|
| - 14,
|
| + 29,
|
| + {
|
| + B(Ldar), R(Register::function_closure().index()), //
|
| + B(Star), R(1), //
|
| + B(LdaConstant), U8(0), //
|
| + B(Star), R(2), //
|
| + B(CallRuntime), U16(Runtime::kNewScriptContext), R(1), U8(2), //
|
| + B(PushContext), R(0), //
|
| + B(LdaConstant), U8(1), //
|
| + B(Star), R(1), //
|
| + B(LdaZero), //
|
| + B(Star), R(2), //
|
| + B(CallRuntime), U16(Runtime::kDeclareGlobals), R(1), U8(2), //
|
| + B(LdaUndefined), //
|
| + B(Return) //
|
| + },
|
| + -1},
|
| + {"var a = 1;\na=2;",
|
| + 5 * kPointerSize,
|
| + 1,
|
| + 52,
|
| + {
|
| + B(Ldar), R(Register::function_closure().index()), //
|
| + B(Star), R(2), //
|
| + B(LdaConstant), U8(0), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kNewScriptContext), R(2), U8(2), //
|
| + B(PushContext), R(1), //
|
| + B(LdaConstant), U8(1), //
|
| + B(Star), R(2), //
|
| + B(LdaZero), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kDeclareGlobals), R(2), U8(2), //
|
| + B(LdaConstant), U8(2), //
|
| + B(Star), R(2), //
|
| + B(LdaZero), //
|
| + B(Star), R(3), //
|
| + B(LdaSmi8), U8(1), //
|
| + B(Star), R(4), //
|
| + B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(2), //
|
| + U8(3), //
|
| + B(LdaSmi8), U8(2), //
|
| + B(StaGlobal), _, //
|
| + B(Star), R(0), //
|
| + B(Ldar), R(0), //
|
| + B(Return) //
|
| + },
|
| + -1},
|
| + {"function f() {}\nf();",
|
| + 4 * kPointerSize,
|
| + 1,
|
| + 43,
|
| {
|
| - B(LdaConstant), U8(0), //
|
| - B(Star), R(0), //
|
| - B(LdaZero), //
|
| - B(Star), R(1), //
|
| - B(CallRuntime), U16(Runtime::kDeclareGlobals), R(0), U8(2), //
|
| - B(LdaUndefined), //
|
| - B(Return) //
|
| + B(Ldar), R(Register::function_closure().index()), //
|
| + B(Star), R(2), //
|
| + B(LdaConstant), U8(0), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kNewScriptContext), R(2), U8(2), //
|
| + B(PushContext), R(1), //
|
| + B(LdaConstant), U8(1), //
|
| + B(Star), R(2), //
|
| + B(LdaZero), //
|
| + B(Star), R(3), //
|
| + B(CallRuntime), U16(Runtime::kDeclareGlobals), R(2), U8(2), //
|
| + B(LdaUndefined), //
|
| + B(Star), R(3), //
|
| + B(LdaGlobal), _, //
|
| + B(Star), R(2), //
|
| + B(Call), R(2), R(3), U8(0), //
|
| + B(Star), R(0), //
|
| + B(Ldar), R(0), //
|
| + B(Return) //
|
| },
|
| -1},
|
| };
|
|
|