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

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

Issue 1419273008: [Interpreter] Add support for new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_thisfunc
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 unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 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 5170 matching lines...) Expand 10 before | Expand all | Expand 10 after
5181 }}, 5181 }},
5182 }; 5182 };
5183 5183
5184 for (size_t i = 0; i < arraysize(snippets); i++) { 5184 for (size_t i = 0; i < arraysize(snippets); i++) {
5185 Handle<BytecodeArray> bytecode_array = 5185 Handle<BytecodeArray> bytecode_array =
5186 helper.MakeBytecodeForFunction(snippets[i].code_snippet); 5186 helper.MakeBytecodeForFunction(snippets[i].code_snippet);
5187 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 5187 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
5188 } 5188 }
5189 } 5189 }
5190 5190
5191
5192 TEST(NewTarget) {
5193 InitializedHandleScope handle_scope;
5194 BytecodeGeneratorHelper helper;
5195
5196 ExpectedSnippet<int> snippets[] = {
5197 {"return new.target;",
5198 1 * kPointerSize,
5199 1,
5200 10,
5201 {
5202 B(CallRuntime), U16(Runtime::kGetOriginalConstructor), R(0), //
5203 U8(0), //
5204 B(Star), R(0), //
5205 B(Ldar), R(0), //
5206 B(Return), //
5207 }},
5208 };
5209
5210 for (size_t i = 0; i < arraysize(snippets); i++) {
5211 Handle<BytecodeArray> bytecode_array =
5212 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
5213 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
5214 }
5215 }
5216
5191 } // namespace interpreter 5217 } // namespace interpreter
5192 } // namespace internal 5218 } // namespace internal
5193 } // namespace v8 5219 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698