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

Side by Side Diff: src/ic/arm64/ic-arm64.cc

Issue 892173002: Megamorphic KeyedLoadIC needs special handling for vector ics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/ic/arm/ic-arm.cc ('k') | src/ic/ia32/ic-ia32.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 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 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 526
527 GenerateKeyedLoadReceiverCheck(masm, receiver, scratch1, scratch2, 527 GenerateKeyedLoadReceiverCheck(masm, receiver, scratch1, scratch2,
528 Map::kHasNamedInterceptor, slow); 528 Map::kHasNamedInterceptor, slow);
529 529
530 // If the receiver is a fast-case object, check the stub cache. Otherwise 530 // If the receiver is a fast-case object, check the stub cache. Otherwise
531 // probe the dictionary. 531 // probe the dictionary.
532 __ Ldr(scratch2, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 532 __ Ldr(scratch2, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
533 __ Ldr(scratch3, FieldMemOperand(scratch2, HeapObject::kMapOffset)); 533 __ Ldr(scratch3, FieldMemOperand(scratch2, HeapObject::kMapOffset));
534 __ JumpIfRoot(scratch3, Heap::kHashTableMapRootIndex, &probe_dictionary); 534 __ JumpIfRoot(scratch3, Heap::kHashTableMapRootIndex, &probe_dictionary);
535 535
536 if (FLAG_vector_ics) {
537 // When vector ics are in use, the handlers in the stub cache expect a
538 // vector and slot. Since we won't change the IC from any downstream
539 // misses, a dummy vector can be used.
540 Register vector = VectorLoadICDescriptor::VectorRegister();
541 Register slot = VectorLoadICDescriptor::SlotRegister();
542 DCHECK(!AreAliased(vector, slot, scratch1, scratch2, scratch3, scratch4));
543 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast(
544 masm->isolate()->factory()->keyed_load_dummy_vector());
545 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0));
546 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex);
547 __ Mov(slot, Operand(Smi::FromInt(int_slot)));
548 }
549
536 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 550 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
537 Code::ComputeHandlerFlags(Code::LOAD_IC)); 551 Code::ComputeHandlerFlags(Code::LOAD_IC));
538 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::LOAD_IC, flags, 552 masm->isolate()->stub_cache()->GenerateProbe(masm, Code::KEYED_LOAD_IC, flags,
539 false, receiver, key, scratch1, 553 false, receiver, key, scratch1,
540 scratch2, scratch3, scratch4); 554 scratch2, scratch3, scratch4);
541 // Cache miss. 555 // Cache miss.
542 KeyedLoadIC::GenerateMiss(masm); 556 KeyedLoadIC::GenerateMiss(masm);
543 557
544 // Do a quick inline probe of the receiver's dictionary, if it exists. 558 // Do a quick inline probe of the receiver's dictionary, if it exists.
545 __ Bind(&probe_dictionary); 559 __ Bind(&probe_dictionary);
546 __ Ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset)); 560 __ Ldr(scratch1, FieldMemOperand(receiver, HeapObject::kMapOffset));
547 __ Ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); 561 __ Ldrb(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
548 GenerateGlobalInstanceTypeCheck(masm, scratch1, slow); 562 GenerateGlobalInstanceTypeCheck(masm, scratch1, slow);
(...skipping 22 matching lines...) Expand all
571 585
572 // Slow case. 586 // Slow case.
573 __ Bind(&slow); 587 __ Bind(&slow);
574 __ IncrementCounter(masm->isolate()->counters()->keyed_load_generic_slow(), 1, 588 __ IncrementCounter(masm->isolate()->counters()->keyed_load_generic_slow(), 1,
575 x4, x3); 589 x4, x3);
576 GenerateRuntimeGetProperty(masm); 590 GenerateRuntimeGetProperty(masm);
577 591
578 __ Bind(&check_name); 592 __ Bind(&check_name);
579 GenerateKeyNameCheck(masm, key, x0, x3, &index_name, &slow); 593 GenerateKeyNameCheck(masm, key, x0, x3, &index_name, &slow);
580 594
581 GenerateKeyedLoadWithNameKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow); 595 GenerateKeyedLoadWithNameKey(masm, key, receiver, x4, x5, x6, x7, x3, &slow);
582 596
583 __ Bind(&index_name); 597 __ Bind(&index_name);
584 __ IndexFromHash(x3, key); 598 __ IndexFromHash(x3, key);
585 // Now jump to the place where smi keys are handled. 599 // Now jump to the place where smi keys are handled.
586 __ B(&index_smi); 600 __ B(&index_smi);
587 } 601 }
588 602
589 603
590 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 604 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
591 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); 605 ASM_LOCATION("KeyedStoreIC::GenerateMiss");
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 } else { 994 } else {
981 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); 995 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ);
982 // This is JumpIfSmi(smi_reg, branch_imm). 996 // This is JumpIfSmi(smi_reg, branch_imm).
983 patcher.tbz(smi_reg, 0, branch_imm); 997 patcher.tbz(smi_reg, 0, branch_imm);
984 } 998 }
985 } 999 }
986 } 1000 }
987 } // namespace v8::internal 1001 } // namespace v8::internal
988 1002
989 #endif // V8_TARGET_ARCH_ARM64 1003 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/ic/arm/ic-arm.cc ('k') | src/ic/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698