OLD | NEW |
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 // TODO(rmcilroy): Remove this define after this flag is turned on globally | 5 // TODO(rmcilroy): Remove this define after this flag is turned on globally |
6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 5181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5192 TEST(NewTarget) { | 5192 TEST(NewTarget) { |
5193 InitializedHandleScope handle_scope; | 5193 InitializedHandleScope handle_scope; |
5194 BytecodeGeneratorHelper helper; | 5194 BytecodeGeneratorHelper helper; |
5195 | 5195 |
5196 ExpectedSnippet<int> snippets[] = { | 5196 ExpectedSnippet<int> snippets[] = { |
5197 {"return new.target;", | 5197 {"return new.target;", |
5198 1 * kPointerSize, | 5198 1 * kPointerSize, |
5199 1, | 5199 1, |
5200 10, | 5200 10, |
5201 { | 5201 { |
5202 B(CallRuntime), U16(Runtime::kGetOriginalConstructor), R(0), // | 5202 B(CallRuntime), U16(Runtime::kGetNewTarget), R(0), U8(0), // |
5203 U8(0), // | 5203 B(Star), R(0), // |
5204 B(Star), R(0), // | 5204 B(Ldar), R(0), // |
5205 B(Ldar), R(0), // | 5205 B(Return), // |
5206 B(Return), // | |
5207 }}, | 5206 }}, |
5208 }; | 5207 }; |
5209 | 5208 |
5210 for (size_t i = 0; i < arraysize(snippets); i++) { | 5209 for (size_t i = 0; i < arraysize(snippets); i++) { |
5211 Handle<BytecodeArray> bytecode_array = | 5210 Handle<BytecodeArray> bytecode_array = |
5212 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); | 5211 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); |
5213 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 5212 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
5214 } | 5213 } |
5215 } | 5214 } |
5216 | 5215 |
5217 } // namespace interpreter | 5216 } // namespace interpreter |
5218 } // namespace internal | 5217 } // namespace internal |
5219 } // namespace v8 | 5218 } // namespace v8 |
OLD | NEW |