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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1410003003: [Interpreter] Add support for JS runtime calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_api_builtin
Patch Set: Fix unittests 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Emit argument creation operations. 87 // Emit argument creation operations.
88 builder.CreateArguments(CreateArgumentsType::kMappedArguments) 88 builder.CreateArguments(CreateArgumentsType::kMappedArguments)
89 .CreateArguments(CreateArgumentsType::kUnmappedArguments); 89 .CreateArguments(CreateArgumentsType::kUnmappedArguments);
90 90
91 // Emit literal creation operations 91 // Emit literal creation operations
92 builder.CreateRegExpLiteral(0, reg) 92 builder.CreateRegExpLiteral(0, reg)
93 .CreateArrayLiteral(0, 0) 93 .CreateArrayLiteral(0, 0)
94 .CreateObjectLiteral(0, 0); 94 .CreateObjectLiteral(0, 0);
95 95
96 // Call operations. 96 // Call operations.
97 builder.Call(reg, reg, 0); 97 builder.Call(reg, reg, 0)
98 builder.CallRuntime(Runtime::kIsArray, reg, 1); 98 .CallRuntime(Runtime::kIsArray, reg, 1)
99 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1);
99 100
100 // Emit binary operator invocations. 101 // Emit binary operator invocations.
101 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 102 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
102 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) 103 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK)
103 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) 104 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK)
104 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) 105 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK)
105 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); 106 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK);
106 107
107 // Emit bitwise operator invocations 108 // Emit bitwise operator invocations
108 builder.BinaryOperation(Token::Value::BIT_OR, reg, Strength::WEAK) 109 builder.BinaryOperation(Token::Value::BIT_OR, reg, Strength::WEAK)
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 677
677 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 678 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
678 iterator.Advance(); 679 iterator.Advance();
679 CHECK(iterator.done()); 680 CHECK(iterator.done());
680 } 681 }
681 682
682 683
683 } // namespace interpreter 684 } // namespace interpreter
684 } // namespace internal 685 } // namespace internal
685 } // namespace v8 686 } // namespace v8
OLDNEW
« src/interpreter/bytecode-generator.cc ('K') | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698