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

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

Issue 1437873002: [Interpreter] Add support for Call bytecode to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@mythri_load
Patch Set: Update to directly build bytecode in unittest 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Emit argument creation operations. 92 // Emit argument creation operations.
93 builder.CreateArguments(CreateArgumentsType::kMappedArguments) 93 builder.CreateArguments(CreateArgumentsType::kMappedArguments)
94 .CreateArguments(CreateArgumentsType::kUnmappedArguments); 94 .CreateArguments(CreateArgumentsType::kUnmappedArguments);
95 95
96 // Emit literal creation operations 96 // Emit literal creation operations
97 builder.CreateRegExpLiteral(0, reg) 97 builder.CreateRegExpLiteral(0, reg)
98 .CreateArrayLiteral(0, 0) 98 .CreateArrayLiteral(0, 0)
99 .CreateObjectLiteral(0, 0); 99 .CreateObjectLiteral(0, 0);
100 100
101 // Call operations. 101 // Call operations.
102 builder.Call(reg, reg, 0) 102 builder.Call(reg, reg, 0, 0)
103 .Call(reg, reg, 0, 1024)
103 .CallRuntime(Runtime::kIsArray, reg, 1) 104 .CallRuntime(Runtime::kIsArray, reg, 1)
104 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1); 105 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1);
105 106
106 // Emit binary operator invocations. 107 // Emit binary operator invocations.
107 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 108 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
108 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) 109 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK)
109 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK) 110 .BinaryOperation(Token::Value::MUL, reg, Strength::WEAK)
110 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK) 111 .BinaryOperation(Token::Value::DIV, reg, Strength::WEAK)
111 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK); 112 .BinaryOperation(Token::Value::MOD, reg, Strength::WEAK);
112 113
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 699
699 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 700 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
700 iterator.Advance(); 701 iterator.Advance();
701 CHECK(iterator.done()); 702 CHECK(iterator.done());
702 } 703 }
703 704
704 705
705 } // namespace interpreter 706 } // namespace interpreter
706 } // namespace internal 707 } // namespace internal
707 } // namespace v8 708 } // namespace v8
OLDNEW
« src/interpreter/bytecodes.h ('K') | « test/unittests/compiler/node-test-utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698