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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 2343633002: [interpreter] Add a fast path for dynamic local load (Closed)
Patch Set: Disable clang format for the new test Created 4 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
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/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 #include "src/globals.h" 7 #include "src/globals.h"
8 #include "src/interpreter/bytecode-array-writer.h" 8 #include "src/interpreter/bytecode-array-writer.h"
9 #include "src/interpreter/bytecode-dead-code-optimizer.h" 9 #include "src/interpreter/bytecode-dead-code-optimizer.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot( 288 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot(
289 const Handle<String> name, TypeofMode typeof_mode) { 289 const Handle<String> name, TypeofMode typeof_mode) {
290 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF) 290 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
291 ? Bytecode::kLdaLookupSlotInsideTypeof 291 ? Bytecode::kLdaLookupSlotInsideTypeof
292 : Bytecode::kLdaLookupSlot; 292 : Bytecode::kLdaLookupSlot;
293 size_t name_index = GetConstantPoolEntry(name); 293 size_t name_index = GetConstantPoolEntry(name);
294 Output(bytecode, UnsignedOperand(name_index)); 294 Output(bytecode, UnsignedOperand(name_index));
295 return *this; 295 return *this;
296 } 296 }
297 297
298 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupContextSlot(
299 const Handle<String> name, TypeofMode typeof_mode, int slot_index,
300 int depth) {
301 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
302 ? Bytecode::kLdaLookupContextSlotInsideTypeof
303 : Bytecode::kLdaLookupContextSlot;
304 size_t name_index = GetConstantPoolEntry(name);
305 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(slot_index),
306 UnsignedOperand(depth));
307 return *this;
308 }
309
298 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot( 310 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
299 const Handle<String> name, LanguageMode language_mode) { 311 const Handle<String> name, LanguageMode language_mode) {
300 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode); 312 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode);
301 size_t name_index = GetConstantPoolEntry(name); 313 size_t name_index = GetConstantPoolEntry(name);
302 Output(bytecode, UnsignedOperand(name_index)); 314 Output(bytecode, UnsignedOperand(name_index));
303 return *this; 315 return *this;
304 } 316 }
305 317
306 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( 318 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
307 Register object, const Handle<Name> name, int feedback_slot) { 319 Register object, const Handle<Name> name, int feedback_slot) {
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 return Bytecode::kTailCall; 1014 return Bytecode::kTailCall;
1003 default: 1015 default:
1004 UNREACHABLE(); 1016 UNREACHABLE();
1005 } 1017 }
1006 return Bytecode::kIllegal; 1018 return Bytecode::kIllegal;
1007 } 1019 }
1008 1020
1009 } // namespace interpreter 1021 } // namespace interpreter
1010 } // namespace internal 1022 } // namespace internal
1011 } // namespace v8 1023 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698