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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 1412683011: [Interpreter] Enable assignments in expressions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Sync test bytecode sequences to avoid unnecessary Ldar/Star instructions. 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/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.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 #include "src/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/interpreter-assembler.h" 9 #include "src/compiler/interpreter-assembler.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // 193 //
194 // Store accumulator to register <dst>. 194 // Store accumulator to register <dst>.
195 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { 195 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) {
196 Node* reg_index = __ BytecodeOperandReg(0); 196 Node* reg_index = __ BytecodeOperandReg(0);
197 Node* accumulator = __ GetAccumulator(); 197 Node* accumulator = __ GetAccumulator();
198 __ StoreRegister(accumulator, reg_index); 198 __ StoreRegister(accumulator, reg_index);
199 __ Dispatch(); 199 __ Dispatch();
200 } 200 }
201 201
202 202
203 // Mov <src> <dst>
204 //
205 // Stores the value of register <src> to register <dst>.
206 void Interpreter::DoMov(compiler::InterpreterAssembler* assembler) {
207 Node* src_index = __ BytecodeOperandReg(0);
208 Node* src_value = __ LoadRegister(src_index);
209 Node* dst_index = __ BytecodeOperandReg(1);
210 __ StoreRegister(src_value, dst_index);
211 __ Dispatch();
212 }
213
214
203 void Interpreter::DoLoadGlobal(Callable ic, 215 void Interpreter::DoLoadGlobal(Callable ic,
204 compiler::InterpreterAssembler* assembler) { 216 compiler::InterpreterAssembler* assembler) {
205 // Get the global object. 217 // Get the global object.
206 Node* context = __ GetContext(); 218 Node* context = __ GetContext();
207 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX); 219 Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX);
208 220
209 // Load the global via the LoadIC. 221 // Load the global via the LoadIC.
210 Node* code_target = __ HeapConstant(ic.code()); 222 Node* code_target = __ HeapConstant(ic.code());
211 Node* constant_index = __ BytecodeOperandIdx(0); 223 Node* constant_index = __ BytecodeOperandIdx(0);
212 Node* name = __ LoadConstantPoolEntry(constant_index); 224 Node* name = __ LoadConstantPoolEntry(constant_index);
213 Node* raw_slot = __ BytecodeOperandIdx(1); 225 Node* raw_slot = __ BytecodeOperandIdx(1);
214 Node* smi_slot = __ SmiTag(raw_slot); 226 Node* smi_slot = __ SmiTag(raw_slot);
215 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 227 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
216 Node* result = __ CallIC(ic.descriptor(), code_target, global, name, smi_slot, 228 Node* result = __ CallIC(ic.descriptor(), code_target, global, name, smi_slot,
217 type_feedback_vector); 229 type_feedback_vector);
218 __ SetAccumulator(result); 230 __ SetAccumulator(result);
219
220 __ Dispatch(); 231 __ Dispatch();
221 } 232 }
222 233
223 234
224 // LdaGlobalSloppy <name_index> <slot> 235 // LdaGlobalSloppy <name_index> <slot>
225 // 236 //
226 // Load the global with name in constant pool entry <name_index> into the 237 // Load the global with name in constant pool entry <name_index> into the
227 // accumulator using FeedBackVector slot <slot> in sloppy mode. 238 // accumulator using FeedBackVector slot <slot> in sloppy mode.
228 void Interpreter::DoLdaGlobalSloppy(compiler::InterpreterAssembler* assembler) { 239 void Interpreter::DoLdaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
229 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF, 240 Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3); 1476 Node* cache_length = __ LoadFixedArrayElement(for_in_state, 3);
1466 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length); 1477 Node* result = __ CallRuntime(Runtime::kForInDone, index, cache_length);
1467 __ SetAccumulator(result); 1478 __ SetAccumulator(result);
1468 __ Dispatch(); 1479 __ Dispatch();
1469 } 1480 }
1470 1481
1471 1482
1472 } // namespace interpreter 1483 } // namespace interpreter
1473 } // namespace internal 1484 } // namespace internal
1474 } // namespace v8 1485 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698