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

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

Issue 1403353002: [Interpreter] Move globals to use idx16 operand for slot id. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 Node* accumulator = __ GetAccumulator(); 181 Node* accumulator = __ GetAccumulator();
182 __ StoreRegister(accumulator, reg_index); 182 __ StoreRegister(accumulator, reg_index);
183 __ Dispatch(); 183 __ Dispatch();
184 } 184 }
185 185
186 186
187 // LdaGlobal <slot_index> 187 // LdaGlobal <slot_index>
188 // 188 //
189 // Load the global at |slot_index| into the accumulator. 189 // Load the global at |slot_index| into the accumulator.
190 void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) { 190 void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) {
191 Node* slot_index = __ BytecodeOperandIdx8(0); 191 Node* slot_index = __ BytecodeOperandIdx16(0);
192 Node* smi_slot_index = __ SmiTag(slot_index); 192 Node* smi_slot_index = __ SmiTag(slot_index);
193 Node* result = __ CallRuntime(Runtime::kLoadGlobalViaContext, smi_slot_index); 193 Node* result = __ CallRuntime(Runtime::kLoadGlobalViaContext, smi_slot_index);
194 __ SetAccumulator(result); 194 __ SetAccumulator(result);
195 __ Dispatch(); 195 __ Dispatch();
196 } 196 }
197 197
198 198
199 // StaGlobalSloppy <slot_index> 199 // StaGlobalSloppy <slot_index>
200 // 200 //
201 // Store the global at |slot_index| with the value in the the accumulator in 201 // Store the global at |slot_index| with the value in the the accumulator in
202 // sloppy mode. 202 // sloppy mode.
203 void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) { 203 void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
204 Node* slot_index = __ BytecodeOperandIdx8(0); 204 Node* slot_index = __ BytecodeOperandIdx16(0);
205 Node* smi_slot_index = __ SmiTag(slot_index); 205 Node* smi_slot_index = __ SmiTag(slot_index);
206 Node* value = __ GetAccumulator(); 206 Node* value = __ GetAccumulator();
207 __ CallRuntime(Runtime::kStoreGlobalViaContext_Sloppy, smi_slot_index, value); 207 __ CallRuntime(Runtime::kStoreGlobalViaContext_Sloppy, smi_slot_index, value);
208 __ Dispatch(); 208 __ Dispatch();
209 } 209 }
210 210
211 211
212 // StaGlobalStrict <slot_index> 212 // StaGlobalStrict <slot_index>
213 // 213 //
214 // Store the global at |slot_index| with the value in the the accumulator in 214 // Store the global at |slot_index| with the value in the the accumulator in
215 // strict mode. 215 // strict mode.
216 void Interpreter::DoStaGlobalStrict(compiler::InterpreterAssembler* assembler) { 216 void Interpreter::DoStaGlobalStrict(compiler::InterpreterAssembler* assembler) {
217 Node* slot_index = __ BytecodeOperandIdx8(0); 217 Node* slot_index = __ BytecodeOperandIdx16(0);
218 Node* smi_slot_index = __ SmiTag(slot_index); 218 Node* smi_slot_index = __ SmiTag(slot_index);
219 Node* value = __ GetAccumulator(); 219 Node* value = __ GetAccumulator();
220 __ CallRuntime(Runtime::kStoreGlobalViaContext_Strict, smi_slot_index, value); 220 __ CallRuntime(Runtime::kStoreGlobalViaContext_Strict, smi_slot_index, value);
221 __ Dispatch(); 221 __ Dispatch();
222 } 222 }
223 223
224 224
225 // LdaContextSlot <context> <slot_index> 225 // LdaContextSlot <context> <slot_index>
226 // 226 //
227 // Load the object in |slot_index| of |context| into the accumulator. 227 // Load the object in |slot_index| of |context| into the accumulator.
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 // 859 //
860 // Return the value in the accumulator. 860 // Return the value in the accumulator.
861 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 861 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
862 __ Return(); 862 __ Return();
863 } 863 }
864 864
865 865
866 } // namespace interpreter 866 } // namespace interpreter
867 } // namespace internal 867 } // namespace internal
868 } // namespace v8 868 } // 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