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

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

Issue 2347143002: [interpreter] Add fast path for dynamic global lookups (Closed)
Patch Set: Fix bytecode operand documentation 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/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/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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 int depth) { 300 int depth) {
301 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF) 301 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
302 ? Bytecode::kLdaLookupContextSlotInsideTypeof 302 ? Bytecode::kLdaLookupContextSlotInsideTypeof
303 : Bytecode::kLdaLookupContextSlot; 303 : Bytecode::kLdaLookupContextSlot;
304 size_t name_index = GetConstantPoolEntry(name); 304 size_t name_index = GetConstantPoolEntry(name);
305 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(slot_index), 305 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(slot_index),
306 UnsignedOperand(depth)); 306 UnsignedOperand(depth));
307 return *this; 307 return *this;
308 } 308 }
309 309
310 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupGlobalSlot(
311 const Handle<String> name, TypeofMode typeof_mode, int feedback_slot,
312 int depth) {
313 Bytecode bytecode = (typeof_mode == INSIDE_TYPEOF)
314 ? Bytecode::kLdaLookupGlobalSlotInsideTypeof
315 : Bytecode::kLdaLookupGlobalSlot;
316 size_t name_index = GetConstantPoolEntry(name);
317 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(feedback_slot),
318 UnsignedOperand(depth));
319 return *this;
320 }
321
310 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot( 322 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreLookupSlot(
311 const Handle<String> name, LanguageMode language_mode) { 323 const Handle<String> name, LanguageMode language_mode) {
312 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode); 324 Bytecode bytecode = BytecodeForStoreLookupSlot(language_mode);
313 size_t name_index = GetConstantPoolEntry(name); 325 size_t name_index = GetConstantPoolEntry(name);
314 Output(bytecode, UnsignedOperand(name_index)); 326 Output(bytecode, UnsignedOperand(name_index));
315 return *this; 327 return *this;
316 } 328 }
317 329
318 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty( 330 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadNamedProperty(
319 Register object, const Handle<Name> name, int feedback_slot) { 331 Register object, const Handle<Name> name, int feedback_slot) {
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 return Bytecode::kTailCall; 1026 return Bytecode::kTailCall;
1015 default: 1027 default:
1016 UNREACHABLE(); 1028 UNREACHABLE();
1017 } 1029 }
1018 return Bytecode::kIllegal; 1030 return Bytecode::kIllegal;
1019 } 1031 }
1020 1032
1021 } // namespace interpreter 1033 } // namespace interpreter
1022 } // namespace internal 1034 } // namespace internal
1023 } // namespace v8 1035 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698