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

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

Issue 1361113002: [Interpreter] Add support for loading globals in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments and fix ASAN Created 5 years, 2 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 | « 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // 184 //
185 // Store accumulator to register <dst>. 185 // Store accumulator to register <dst>.
186 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { 186 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) {
187 Node* reg_index = __ BytecodeOperandReg(0); 187 Node* reg_index = __ BytecodeOperandReg(0);
188 Node* accumulator = __ GetAccumulator(); 188 Node* accumulator = __ GetAccumulator();
189 __ StoreRegister(accumulator, reg_index); 189 __ StoreRegister(accumulator, reg_index);
190 __ Dispatch(); 190 __ Dispatch();
191 } 191 }
192 192
193 193
194 // LdaGlobal <slot_index>
195 //
196 // Load the global at |slot_index| into the accumulator.
197 void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) {
198 Node* slot_index = __ BytecodeOperandIdx(0);
199 Node* smi_slot_index = __ SmiTag(slot_index);
200 Node* result = __ CallRuntime(Runtime::kLoadGlobalViaContext, smi_slot_index);
201 __ SetAccumulator(result);
202 __ Dispatch();
203 }
204
205
194 void Interpreter::DoPropertyLoadIC(Callable ic, 206 void Interpreter::DoPropertyLoadIC(Callable ic,
195 compiler::InterpreterAssembler* assembler) { 207 compiler::InterpreterAssembler* assembler) {
196 Node* code_target = __ HeapConstant(ic.code()); 208 Node* code_target = __ HeapConstant(ic.code());
197 Node* reg_index = __ BytecodeOperandReg(0); 209 Node* reg_index = __ BytecodeOperandReg(0);
198 Node* object = __ LoadRegister(reg_index); 210 Node* object = __ LoadRegister(reg_index);
199 Node* name = __ GetAccumulator(); 211 Node* name = __ GetAccumulator();
200 Node* raw_slot = __ BytecodeOperandIdx(1); 212 Node* raw_slot = __ BytecodeOperandIdx(1);
201 Node* smi_slot = __ SmiTag(raw_slot); 213 Node* smi_slot = __ SmiTag(raw_slot);
202 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); 214 Node* type_feedback_vector = __ LoadTypeFeedbackVector();
203 Node* result = __ CallIC(ic.descriptor(), code_target, object, name, smi_slot, 215 Node* result = __ CallIC(ic.descriptor(), code_target, object, name, smi_slot,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // 354 //
343 // Return the value in register 0. 355 // Return the value in register 0.
344 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 356 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
345 __ Return(); 357 __ Return();
346 } 358 }
347 359
348 360
349 } // namespace interpreter 361 } // namespace interpreter
350 } // namespace internal 362 } // namespace internal
351 } // namespace v8 363 } // 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