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

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

Issue 1248303002: Unify runtime-style IC functions with Runtime intrinsics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make mips work 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
« no previous file with comments | « src/ic/arm64/handler-compiler-arm64.cc ('k') | src/ic/ia32/handler-compiler-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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 DCHECK(!AreAliased(x4, x5, LoadWithVectorDescriptor::SlotRegister(), 290 DCHECK(!AreAliased(x4, x5, LoadWithVectorDescriptor::SlotRegister(),
291 LoadWithVectorDescriptor::VectorRegister())); 291 LoadWithVectorDescriptor::VectorRegister()));
292 __ IncrementCounter(isolate->counters()->load_miss(), 1, x4, x5); 292 __ IncrementCounter(isolate->counters()->load_miss(), 1, x4, x5);
293 293
294 // Perform tail call to the entry. 294 // Perform tail call to the entry.
295 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), 295 __ Push(LoadWithVectorDescriptor::ReceiverRegister(),
296 LoadWithVectorDescriptor::NameRegister(), 296 LoadWithVectorDescriptor::NameRegister(),
297 LoadWithVectorDescriptor::SlotRegister(), 297 LoadWithVectorDescriptor::SlotRegister(),
298 LoadWithVectorDescriptor::VectorRegister()); 298 LoadWithVectorDescriptor::VectorRegister());
299 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
300 int arg_count = 4; 299 int arg_count = 4;
301 __ TailCallExternalReference(ref, arg_count, 1); 300 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
302 } 301 }
303 302
304 303
305 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 304 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
306 LanguageMode language_mode) { 305 LanguageMode language_mode) {
307 // The return address is in lr. 306 // The return address is in lr.
308 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); 307 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
309 308
310 // Do tail-call to runtime routine. 309 // Do tail-call to runtime routine.
311 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong 310 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
312 : Runtime::kGetProperty, 311 : Runtime::kGetProperty,
313 2, 1); 312 2, 1);
314 } 313 }
315 314
316 315
317 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 316 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
318 // The return address is in lr. 317 // The return address is in lr.
319 Isolate* isolate = masm->isolate(); 318 Isolate* isolate = masm->isolate();
320 319
321 DCHECK(!AreAliased(x10, x11, LoadWithVectorDescriptor::SlotRegister(), 320 DCHECK(!AreAliased(x10, x11, LoadWithVectorDescriptor::SlotRegister(),
322 LoadWithVectorDescriptor::VectorRegister())); 321 LoadWithVectorDescriptor::VectorRegister()));
323 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11); 322 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, x10, x11);
324 323
325 __ Push(LoadWithVectorDescriptor::ReceiverRegister(), 324 __ Push(LoadWithVectorDescriptor::ReceiverRegister(),
326 LoadWithVectorDescriptor::NameRegister(), 325 LoadWithVectorDescriptor::NameRegister(),
327 LoadWithVectorDescriptor::SlotRegister(), 326 LoadWithVectorDescriptor::SlotRegister(),
328 LoadWithVectorDescriptor::VectorRegister()); 327 LoadWithVectorDescriptor::VectorRegister());
329 328
330 // Perform tail call to the entry. 329 // Perform tail call to the entry.
331 ExternalReference ref =
332 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
333 int arg_count = 4; 330 int arg_count = 4;
334 __ TailCallExternalReference(ref, arg_count, 1); 331 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
335 } 332 }
336 333
337 334
338 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 335 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
339 LanguageMode language_mode) { 336 LanguageMode language_mode) {
340 // The return address is in lr. 337 // The return address is in lr.
341 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); 338 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
342 339
343 // Do tail-call to runtime routine. 340 // Do tail-call to runtime routine.
344 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong 341 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kKeyedGetPropertyStrong
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 471 }
475 472
476 473
477 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 474 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
478 ASM_LOCATION("KeyedStoreIC::GenerateMiss"); 475 ASM_LOCATION("KeyedStoreIC::GenerateMiss");
479 476
480 // Push receiver, key and value for runtime call. 477 // Push receiver, key and value for runtime call.
481 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 478 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
482 StoreDescriptor::ValueRegister()); 479 StoreDescriptor::ValueRegister());
483 480
484 ExternalReference ref = 481 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
485 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
486 __ TailCallExternalReference(ref, 3, 1);
487 } 482 }
488 483
489 484
490 static void KeyedStoreGenerateMegamorphicHelper( 485 static void KeyedStoreGenerateMegamorphicHelper(
491 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, 486 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
492 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, 487 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
493 Register value, Register key, Register receiver, Register receiver_map, 488 Register value, Register key, Register receiver, Register receiver_map,
494 Register elements_map, Register elements) { 489 Register elements_map, Register elements) {
495 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements, 490 DCHECK(!AreAliased(value, key, receiver, receiver_map, elements_map, elements,
496 x10, x11)); 491 x10, x11));
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 // Cache miss: Jump to runtime. 762 // Cache miss: Jump to runtime.
768 GenerateMiss(masm); 763 GenerateMiss(masm);
769 } 764 }
770 765
771 766
772 void StoreIC::GenerateMiss(MacroAssembler* masm) { 767 void StoreIC::GenerateMiss(MacroAssembler* masm) {
773 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 768 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
774 StoreDescriptor::ValueRegister()); 769 StoreDescriptor::ValueRegister());
775 770
776 // Tail call to the entry. 771 // Tail call to the entry.
777 ExternalReference ref = 772 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
778 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
779 __ TailCallExternalReference(ref, 3, 1);
780 } 773 }
781 774
782 775
783 void StoreIC::GenerateNormal(MacroAssembler* masm) { 776 void StoreIC::GenerateNormal(MacroAssembler* masm) {
784 Label miss; 777 Label miss;
785 Register value = StoreDescriptor::ValueRegister(); 778 Register value = StoreDescriptor::ValueRegister();
786 Register receiver = StoreDescriptor::ReceiverRegister(); 779 Register receiver = StoreDescriptor::ReceiverRegister();
787 Register name = StoreDescriptor::NameRegister(); 780 Register name = StoreDescriptor::NameRegister();
788 Register dictionary = x3; 781 Register dictionary = x3;
789 DCHECK(!AreAliased(value, receiver, name, x3, x4, x5)); 782 DCHECK(!AreAliased(value, receiver, name, x3, x4, x5));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 } else { 877 } else {
885 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ); 878 DCHECK(to_patch->Mask(TestBranchMask) == TBNZ);
886 // This is JumpIfSmi(smi_reg, branch_imm). 879 // This is JumpIfSmi(smi_reg, branch_imm).
887 patcher.tbz(smi_reg, 0, branch_imm); 880 patcher.tbz(smi_reg, 0, branch_imm);
888 } 881 }
889 } 882 }
890 } // namespace internal 883 } // namespace internal
891 } // namespace v8 884 } // namespace v8
892 885
893 #endif // V8_TARGET_ARCH_ARM64 886 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/ic/arm64/handler-compiler-arm64.cc ('k') | src/ic/ia32/handler-compiler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698