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

Side by Side Diff: src/ic/arm/ic-arm.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/heap/heap.cc ('k') | src/ic/arm64/ic-arm64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 7 #if V8_TARGET_ARCH_ARM
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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 Map::kHasNamedInterceptor, &slow); 520 Map::kHasNamedInterceptor, &slow);
521 521
522 // If the receiver is a fast-case object, check the stub cache. Otherwise 522 // If the receiver is a fast-case object, check the stub cache. Otherwise
523 // probe the dictionary. 523 // probe the dictionary.
524 __ ldr(r3, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 524 __ ldr(r3, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
525 __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset)); 525 __ ldr(r4, FieldMemOperand(r3, HeapObject::kMapOffset));
526 __ LoadRoot(ip, Heap::kHashTableMapRootIndex); 526 __ LoadRoot(ip, Heap::kHashTableMapRootIndex);
527 __ cmp(r4, ip); 527 __ cmp(r4, ip);
528 __ b(eq, &probe_dictionary); 528 __ b(eq, &probe_dictionary);
529 529
530
531 if (FLAG_vector_ics) {
532 // When vector ics are in use, the handlers in the stub cache expect a
533 // vector and slot. Since we won't change the IC from any downstream
534 // misses, a dummy vector can be used.
535 Register vector = VectorLoadICDescriptor::VectorRegister();
536 Register slot = VectorLoadICDescriptor::SlotRegister();
537 DCHECK(!AreAliased(vector, slot, r4, r5, r6, r9));
538 Handle<TypeFeedbackVector> dummy_vector = Handle<TypeFeedbackVector>::cast(
539 masm->isolate()->factory()->keyed_load_dummy_vector());
540 int int_slot = dummy_vector->GetIndex(FeedbackVectorICSlot(0));
541 __ LoadRoot(vector, Heap::kKeyedLoadDummyVectorRootIndex);
542 __ mov(slot, Operand(Smi::FromInt(int_slot)));
543 }
544
530 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 545 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
531 Code::ComputeHandlerFlags(Code::LOAD_IC)); 546 Code::ComputeHandlerFlags(Code::LOAD_IC));
532 masm->isolate()->stub_cache()->GenerateProbe( 547 masm->isolate()->stub_cache()->GenerateProbe(
533 masm, Code::LOAD_IC, flags, false, receiver, key, r3, r4, r5, r6); 548 masm, Code::KEYED_LOAD_IC, flags, false, receiver, key, r4, r5, r6, r9);
534 // Cache miss. 549 // Cache miss.
535 GenerateMiss(masm); 550 GenerateMiss(masm);
536 551
537 // Do a quick inline probe of the receiver's dictionary, if it 552 // Do a quick inline probe of the receiver's dictionary, if it
538 // exists. 553 // exists.
539 __ bind(&probe_dictionary); 554 __ bind(&probe_dictionary);
540 // r3: elements 555 // r3: elements
541 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset)); 556 __ ldr(r0, FieldMemOperand(receiver, HeapObject::kMapOffset));
542 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset)); 557 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset));
543 GenerateGlobalInstanceTypeCheck(masm, r0, &slow); 558 GenerateGlobalInstanceTypeCheck(masm, r0, &slow);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 patcher.EmitCondition(ne); 981 patcher.EmitCondition(ne);
967 } else { 982 } else {
968 DCHECK(Assembler::GetCondition(branch_instr) == ne); 983 DCHECK(Assembler::GetCondition(branch_instr) == ne);
969 patcher.EmitCondition(eq); 984 patcher.EmitCondition(eq);
970 } 985 }
971 } 986 }
972 } 987 }
973 } // namespace v8::internal 988 } // namespace v8::internal
974 989
975 #endif // V8_TARGET_ARCH_ARM 990 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/ic/arm64/ic-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698