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

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

Issue 1456483002: [Interpreter] Add New, CallRuntime and CallJSRuntime support to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@rmcilroy-0001-globals
Patch Set: Rebase 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
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 393 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
394 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 394 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
395 } 395 }
396 } 396 }
397 397
398 398
399 TEST(LogicalExpressions) { 399 TEST(LogicalExpressions) {
400 InitializedHandleScope handle_scope; 400 InitializedHandleScope handle_scope;
401 BytecodeGeneratorHelper helper; 401 BytecodeGeneratorHelper helper;
402 402
403
404 ExpectedSnippet<int> snippets[] = { 403 ExpectedSnippet<int> snippets[] = {
405 {"var x = 0; return x || 3;", 404 {"var x = 0; return x || 3;",
406 1 * kPointerSize, 405 1 * kPointerSize,
407 1, 406 1,
408 8, 407 8,
409 {B(LdaZero), // 408 {B(LdaZero), //
410 B(Star), R(0), // 409 B(Star), R(0), //
411 B(JumpIfToBooleanTrue), U8(4), // 410 B(JumpIfToBooleanTrue), U8(4), //
412 B(LdaSmi8), U8(3), // 411 B(LdaSmi8), U8(3), //
413 B(Return)}, 412 B(Return)},
(...skipping 4847 matching lines...) Expand 10 before | Expand all | Expand 10 after
5261 for (size_t i = 0; i < arraysize(snippets); i++) { 5260 for (size_t i = 0; i < arraysize(snippets); i++) {
5262 Handle<BytecodeArray> bytecode_array = 5261 Handle<BytecodeArray> bytecode_array =
5263 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet); 5262 helper.MakeBytecodeForFunctionBody(snippets[i].code_snippet);
5264 CheckBytecodeArrayEqual(snippets[i], bytecode_array); 5263 CheckBytecodeArrayEqual(snippets[i], bytecode_array);
5265 } 5264 }
5266 } 5265 }
5267 5266
5268 } // namespace interpreter 5267 } // namespace interpreter
5269 } // namespace internal 5268 } // namespace internal
5270 } // namespace v8 5269 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-bytecode-graph-builder.cc ('k') | test/unittests/compiler/bytecode-graph-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698