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

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

Issue 1323463005: [Interpreter] Add support for JS calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add MIPS port contributed by akos.palfi@imgtec.com Created 5 years, 3 months 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 | « test/unittests/compiler/interpreter-assembler-unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "test/unittests/test-utils.h" 8 #include "test/unittests/test-utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 27 matching lines...) Expand all
38 // Emit accumulator transfers. 38 // Emit accumulator transfers.
39 Register reg(0); 39 Register reg(0);
40 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); 40 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg);
41 41
42 // Emit load / store property operations. 42 // Emit load / store property operations.
43 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) 43 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY)
44 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) 44 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY)
45 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) 45 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY)
46 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY); 46 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY);
47 47
48 // Call operations.
49 builder.Call(reg, reg, 0);
50
48 // Emit binary operators invocations. 51 // Emit binary operators invocations.
49 builder.BinaryOperation(Token::Value::ADD, reg) 52 builder.BinaryOperation(Token::Value::ADD, reg)
50 .BinaryOperation(Token::Value::SUB, reg) 53 .BinaryOperation(Token::Value::SUB, reg)
51 .BinaryOperation(Token::Value::MUL, reg) 54 .BinaryOperation(Token::Value::MUL, reg)
52 .BinaryOperation(Token::Value::DIV, reg) 55 .BinaryOperation(Token::Value::DIV, reg)
53 .BinaryOperation(Token::Value::MOD, reg); 56 .BinaryOperation(Token::Value::MOD, reg);
54 57
55 // Emit control flow. Return must be the last instruction. 58 // Emit control flow. Return must be the last instruction.
56 builder.Return(); 59 builder.Return();
57 60
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 .LoadLiteral(heap_num_2_copy); 176 .LoadLiteral(heap_num_2_copy);
174 177
175 Handle<BytecodeArray> array = builder.ToBytecodeArray(); 178 Handle<BytecodeArray> array = builder.ToBytecodeArray();
176 // Should only have one entry for each identical constant. 179 // Should only have one entry for each identical constant.
177 CHECK_EQ(array->constant_pool()->length(), 3); 180 CHECK_EQ(array->constant_pool()->length(), 3);
178 } 181 }
179 182
180 } // namespace interpreter 183 } // namespace interpreter
181 } // namespace internal 184 } // namespace internal
182 } // namespace v8 185 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/interpreter-assembler-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698