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

Side by Side Diff: src/arm64/lithium-codegen-arm64.cc

Issue 1238143002: [stubs] Optimize LoadGlobalViaContextStub and StoreGlobalViaContextStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ARM typo. Created 5 years, 5 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3377 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), 3377 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(),
3378 SLOPPY, PREMONOMORPHIC).code(); 3378 SLOPPY, PREMONOMORPHIC).code();
3379 CallCode(ic, RelocInfo::CODE_TARGET, instr); 3379 CallCode(ic, RelocInfo::CODE_TARGET, instr);
3380 } 3380 }
3381 3381
3382 3382
3383 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { 3383 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) {
3384 DCHECK(ToRegister(instr->context()).is(cp)); 3384 DCHECK(ToRegister(instr->context()).is(cp));
3385 DCHECK(ToRegister(instr->result()).is(x0)); 3385 DCHECK(ToRegister(instr->result()).is(x0));
3386 3386
3387 __ Mov(LoadGlobalViaContextDescriptor::DepthRegister(), 3387 int const slot = instr->slot_index();
3388 Operand(Smi::FromInt(instr->depth()))); 3388 int const depth = instr->depth();
3389 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), 3389 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
3390 Operand(Smi::FromInt(instr->slot_index()))); 3390 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
3391 __ Mov(LoadGlobalViaContextDescriptor::NameRegister(), 3391 __ Mov(LoadGlobalViaContextDescriptor::NameRegister(),
3392 Operand(instr->name())); 3392 Operand(instr->name()));
3393 3393 Handle<Code> stub =
3394 Handle<Code> stub = 3394 CodeFactory::LoadGlobalViaContext(isolate(), depth).code();
3395 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code(); 3395 CallCode(stub, RelocInfo::CODE_TARGET, instr);
3396 CallCode(stub, RelocInfo::CODE_TARGET, instr); 3396 } else {
3397 __ Push(Smi::FromInt(slot));
3398 __ Push(instr->name());
3399 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
3400 }
3397 } 3401 }
3398 3402
3399 3403
3400 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( 3404 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand(
3401 Register key, 3405 Register key,
3402 Register base, 3406 Register base,
3403 Register scratch, 3407 Register scratch,
3404 bool key_is_smi, 3408 bool key_is_smi,
3405 bool key_is_constant, 3409 bool key_is_constant,
3406 int constant_key, 3410 int constant_key,
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5533 instr->hydrogen()->initialization_state()).code(); 5537 instr->hydrogen()->initialization_state()).code();
5534 CallCode(ic, RelocInfo::CODE_TARGET, instr); 5538 CallCode(ic, RelocInfo::CODE_TARGET, instr);
5535 } 5539 }
5536 5540
5537 5541
5538 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { 5542 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) {
5539 DCHECK(ToRegister(instr->context()).is(cp)); 5543 DCHECK(ToRegister(instr->context()).is(cp));
5540 DCHECK(ToRegister(instr->value()) 5544 DCHECK(ToRegister(instr->value())
5541 .is(StoreGlobalViaContextDescriptor::ValueRegister())); 5545 .is(StoreGlobalViaContextDescriptor::ValueRegister()));
5542 5546
5543 __ Mov(StoreGlobalViaContextDescriptor::DepthRegister(), 5547 int const slot = instr->slot_index();
5544 Operand(Smi::FromInt(instr->depth()))); 5548 int const depth = instr->depth();
5545 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), 5549 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
5546 Operand(Smi::FromInt(instr->slot_index()))); 5550 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
5547 __ Mov(StoreGlobalViaContextDescriptor::NameRegister(), 5551 __ Mov(StoreGlobalViaContextDescriptor::NameRegister(),
5548 Operand(instr->name())); 5552 Operand(instr->name()));
5549 5553 Handle<Code> stub = CodeFactory::StoreGlobalViaContext(
5550 Handle<Code> stub = 5554 isolate(), depth, instr->language_mode())
5551 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(), 5555 .code();
5552 instr->language_mode()).code(); 5556 CallCode(stub, RelocInfo::CODE_TARGET, instr);
5553 CallCode(stub, RelocInfo::CODE_TARGET, instr); 5557 } else {
5558 __ Push(Smi::FromInt(slot));
5559 __ Push(instr->name());
5560 __ Push(StoreGlobalViaContextDescriptor::ValueRegister());
5561 __ CallRuntime(is_strict(instr->language_mode())
5562 ? Runtime::kStoreGlobalViaContext_Strict
5563 : Runtime::kStoreGlobalViaContext_Sloppy,
5564 3);
5565 }
5554 } 5566 }
5555 5567
5556 5568
5557 void LCodeGen::DoStringAdd(LStringAdd* instr) { 5569 void LCodeGen::DoStringAdd(LStringAdd* instr) {
5558 DCHECK(ToRegister(instr->context()).is(cp)); 5570 DCHECK(ToRegister(instr->context()).is(cp));
5559 DCHECK(ToRegister(instr->left()).Is(x1)); 5571 DCHECK(ToRegister(instr->left()).Is(x1));
5560 DCHECK(ToRegister(instr->right()).Is(x0)); 5572 DCHECK(ToRegister(instr->right()).Is(x0));
5561 StringAddStub stub(isolate(), 5573 StringAddStub stub(isolate(),
5562 instr->hydrogen()->flags(), 5574 instr->hydrogen()->flags(),
5563 instr->hydrogen()->pretenure_flag()); 5575 instr->hydrogen()->pretenure_flag());
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
6172 Handle<ScopeInfo> scope_info = instr->scope_info(); 6184 Handle<ScopeInfo> scope_info = instr->scope_info();
6173 __ Push(scope_info); 6185 __ Push(scope_info);
6174 __ Push(ToRegister(instr->function())); 6186 __ Push(ToRegister(instr->function()));
6175 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6187 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6176 RecordSafepoint(Safepoint::kNoLazyDeopt); 6188 RecordSafepoint(Safepoint::kNoLazyDeopt);
6177 } 6189 }
6178 6190
6179 6191
6180 } // namespace internal 6192 } // namespace internal
6181 } // namespace v8 6193 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698