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

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

Issue 535873002: Encapsulate megamorphic load/tail-call in hydrogen (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/arm/stub-cache-arm.cc ('k') | src/ic/arm64/stub-cache-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 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 __ Cmp(key, scratch); 324 __ Cmp(key, scratch);
325 __ B(hs, slow_case); 325 __ B(hs, slow_case);
326 326
327 __ Add(backing_store, backing_store, 327 __ Add(backing_store, backing_store,
328 FixedArray::kHeaderSize - kHeapObjectTag); 328 FixedArray::kHeaderSize - kHeapObjectTag);
329 __ SmiUntag(scratch, key); 329 __ SmiUntag(scratch, key);
330 return MemOperand(backing_store, scratch, LSL, kPointerSizeLog2); 330 return MemOperand(backing_store, scratch, LSL, kPointerSizeLog2);
331 } 331 }
332 332
333 333
334 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
335 // The return address is in lr.
336 Register receiver = LoadDescriptor::ReceiverRegister();
337 Register name = LoadDescriptor::NameRegister();
338 DCHECK(receiver.is(x1));
339 DCHECK(name.is(x2));
340
341 // Probe the stub cache.
342 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
343 Code::ComputeHandlerFlags(Code::LOAD_IC));
344 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, x3,
345 x4, x5, x6);
346
347 // Cache miss: Jump to runtime.
348 GenerateMiss(masm);
349 }
350
351
352 void LoadIC::GenerateNormal(MacroAssembler* masm) { 334 void LoadIC::GenerateNormal(MacroAssembler* masm) {
353 Register dictionary = x0; 335 Register dictionary = x0;
354 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister())); 336 DCHECK(!dictionary.is(LoadDescriptor::ReceiverRegister()));
355 DCHECK(!dictionary.is(LoadDescriptor::NameRegister())); 337 DCHECK(!dictionary.is(LoadDescriptor::NameRegister()));
356 Label slow; 338 Label slow;
357 339
358 __ Ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(), 340 __ Ldr(dictionary, FieldMemOperand(LoadDescriptor::ReceiverRegister(),
359 JSObject::kPropertiesOffset)); 341 JSObject::kPropertiesOffset));
360 GenerateDictionaryLoad(masm, &slow, dictionary, 342 GenerateDictionaryLoad(masm, &slow, dictionary,
361 LoadDescriptor::NameRegister(), x0, x3, x4); 343 LoadDescriptor::NameRegister(), x0, x3, x4);
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 969
988 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 970 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
989 Register receiver = StoreDescriptor::ReceiverRegister(); 971 Register receiver = StoreDescriptor::ReceiverRegister();
990 Register name = StoreDescriptor::NameRegister(); 972 Register name = StoreDescriptor::NameRegister();
991 DCHECK(!AreAliased(receiver, name, StoreDescriptor::ValueRegister(), x3, x4, 973 DCHECK(!AreAliased(receiver, name, StoreDescriptor::ValueRegister(), x3, x4,
992 x5, x6)); 974 x5, x6));
993 975
994 // Probe the stub cache. 976 // Probe the stub cache.
995 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 977 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
996 Code::ComputeHandlerFlags(Code::STORE_IC)); 978 Code::ComputeHandlerFlags(Code::STORE_IC));
997 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, x3, 979 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, false, receiver,
998 x4, x5, x6); 980 name, x3, x4, x5, x6);
999 981
1000 // Cache miss: Jump to runtime. 982 // Cache miss: Jump to runtime.
1001 GenerateMiss(masm); 983 GenerateMiss(masm);
1002 } 984 }
1003 985
1004 986
1005 void StoreIC::GenerateMiss(MacroAssembler* masm) { 987 void StoreIC::GenerateMiss(MacroAssembler* masm) {
1006 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 988 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
1007 StoreDescriptor::ValueRegister()); 989 StoreDescriptor::ValueRegister());
1008 990
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 } else { 1099 } else {
1118 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); 1100 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ);
1119 // This is JumpIfSmi(smi_reg, branch_imm). 1101 // This is JumpIfSmi(smi_reg, branch_imm).
1120 patcher.tbz(smi_reg, 0, branch_imm); 1102 patcher.tbz(smi_reg, 0, branch_imm);
1121 } 1103 }
1122 } 1104 }
1123 } 1105 }
1124 } // namespace v8::internal 1106 } // namespace v8::internal
1125 1107
1126 #endif // V8_TARGET_ARCH_ARM64 1108 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/ic/arm/stub-cache-arm.cc ('k') | src/ic/arm64/stub-cache-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698