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

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

Issue 1321663003: [Interpreter] Add support for loading literals from the constant pool. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_const_pool_1
Patch Set: Review comments 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 | « src/interpreter/bytecodes.cc ('k') | src/utils.h » ('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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/interpreter-assembler.h" 8 #include "src/compiler/interpreter-assembler.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/interpreter/bytecode-generator.h" 10 #include "src/interpreter/bytecode-generator.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // 99 //
100 // Load an 8-bit integer literal into the accumulator as a Smi. 100 // Load an 8-bit integer literal into the accumulator as a Smi.
101 void Interpreter::DoLdaSmi8(compiler::InterpreterAssembler* assembler) { 101 void Interpreter::DoLdaSmi8(compiler::InterpreterAssembler* assembler) {
102 Node* raw_int = __ BytecodeOperandImm8(0); 102 Node* raw_int = __ BytecodeOperandImm8(0);
103 Node* smi_int = __ SmiTag(raw_int); 103 Node* smi_int = __ SmiTag(raw_int);
104 __ SetAccumulator(smi_int); 104 __ SetAccumulator(smi_int);
105 __ Dispatch(); 105 __ Dispatch();
106 } 106 }
107 107
108 108
109 // LdaConstant <idx>
110 //
111 // Load constant literal at |idx| in the constant pool into the accumulator.
112 void Interpreter::DoLdaConstant(compiler::InterpreterAssembler* assembler) {
113 Node* index = __ BytecodeOperandIdx(0);
114 Node* constant = __ LoadConstantPoolEntry(index);
115 __ SetAccumulator(constant);
116 __ Dispatch();
117 }
118
119
109 // LdaUndefined 120 // LdaUndefined
110 // 121 //
111 // Load Undefined into the accumulator. 122 // Load Undefined into the accumulator.
112 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { 123 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) {
113 Node* undefined_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable( 124 Node* undefined_value = __ HeapConstant(Unique<HeapObject>::CreateImmovable(
114 isolate_->factory()->undefined_value())); 125 isolate_->factory()->undefined_value()));
115 __ SetAccumulator(undefined_value); 126 __ SetAccumulator(undefined_value);
116 __ Dispatch(); 127 __ Dispatch();
117 } 128 }
118 129
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // 251 //
241 // Return the value in register 0. 252 // Return the value in register 0.
242 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 253 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
243 __ Return(); 254 __ Return();
244 } 255 }
245 256
246 257
247 } // namespace interpreter 258 } // namespace interpreter
248 } // namespace internal 259 } // namespace internal
249 } // namespace v8 260 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698