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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1689573004: [interpreter] Support for ES6 super keyword. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "src/interpreter/bytecode-generator.h" 9 #include "src/interpreter/bytecode-generator.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 5030 matching lines...) Expand 10 before | Expand all | Expand 10 after
5041 B(New), R(0), R(0), U8(0), // 5041 B(New), R(0), R(0), U8(0), //
5042 B(Return), // 5042 B(Return), //
5043 }, 5043 },
5044 1, 5044 1,
5045 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}}, 5045 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
5046 {"function bar(x) { this.value = 18; this.x = x;}\n" 5046 {"function bar(x) { this.value = 18; this.x = x;}\n"
5047 "function f() { return new bar(3); }\n" 5047 "function f() { return new bar(3); }\n"
5048 "f()", 5048 "f()",
5049 2 * kPointerSize, 5049 2 * kPointerSize,
5050 1, 5050 1,
5051 15, 5051 17,
5052 { 5052 {
5053 B(StackCheck), // 5053 B(StackCheck), //
5054 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), // 5054 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
5055 B(Star), R(0), // 5055 B(Star), R(0), //
5056 B(LdaSmi8), U8(3), // 5056 B(LdaSmi8), U8(3), //
5057 B(Star), R(1), // 5057 B(Star), R(1), //
5058 B(Ldar), R(0), //
5058 B(New), R(0), R(1), U8(1), // 5059 B(New), R(0), R(1), U8(1), //
5059 B(Return), // 5060 B(Return), //
5060 }, 5061 },
5061 1, 5062 1,
5062 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}}, 5063 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
5063 {"function bar(w, x, y, z) {\n" 5064 {"function bar(w, x, y, z) {\n"
5064 " this.value = 18;\n" 5065 " this.value = 18;\n"
5065 " this.x = x;\n" 5066 " this.x = x;\n"
5066 " this.y = y;\n" 5067 " this.y = y;\n"
5067 " this.z = z;\n" 5068 " this.z = z;\n"
5068 "}\n" 5069 "}\n"
5069 "function f() { return new bar(3, 4, 5); }\n" 5070 "function f() { return new bar(3, 4, 5); }\n"
5070 "f()", 5071 "f()",
5071 4 * kPointerSize, 5072 4 * kPointerSize,
5072 1, 5073 1,
5073 23, 5074 25,
5074 { 5075 {
5075 B(StackCheck), // 5076 B(StackCheck), //
5076 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), // 5077 B(LdaGlobalSloppy), U8(0), U8(vector->GetIndex(slot2)), //
5077 B(Star), R(0), // 5078 B(Star), R(0), //
5078 B(LdaSmi8), U8(3), // 5079 B(LdaSmi8), U8(3), //
5079 B(Star), R(1), // 5080 B(Star), R(1), //
5080 B(LdaSmi8), U8(4), // 5081 B(LdaSmi8), U8(4), //
5081 B(Star), R(2), // 5082 B(Star), R(2), //
5082 B(LdaSmi8), U8(5), // 5083 B(LdaSmi8), U8(5), //
5083 B(Star), R(3), // 5084 B(Star), R(3), //
5085 B(Ldar), R(0), //
5084 B(New), R(0), R(1), U8(3), // 5086 B(New), R(0), R(1), U8(3), //
5085 B(Return), // 5087 B(Return), //
5086 }, 5088 },
5087 1, 5089 1,
5088 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}}, 5090 {InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
5089 }; 5091 };
5090 // clang-format on 5092 // clang-format on
5091 5093
5092 for (size_t i = 0; i < arraysize(snippets); i++) { 5094 for (size_t i = 0; i < arraysize(snippets); i++) {
5093 Handle<BytecodeArray> bytecode_array = 5095 Handle<BytecodeArray> bytecode_array =
(...skipping 4131 matching lines...) Expand 10 before | Expand all | Expand 10 after
9225 }; 9227 };
9226 // clang-format on 9228 // clang-format on
9227 9229
9228 for (size_t i = 0; i < arraysize(snippets); i++) { 9230 for (size_t i = 0; i < arraysize(snippets); i++) {
9229 Handle<BytecodeArray> bytecode_array = 9231 Handle<BytecodeArray> bytecode_array =
9230 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 9232 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
9231 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 9233 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
9232 } 9234 }
9233 } 9235 }
9234 9236
9237 // TODO(oth): Add tests for super keyword.
9238
9235 } // namespace interpreter 9239 } // namespace interpreter
9236 } // namespace internal 9240 } // namespace internal
9237 } // namespace v8 9241 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698