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 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/arm/handler-compiler-arm.cc ('k') | src/ic/arm64/handler-compiler-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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // The return address is in lr. 306 // The return address is in lr.
307 Isolate* isolate = masm->isolate(); 307 Isolate* isolate = masm->isolate();
308 308
309 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), 309 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(),
310 LoadWithVectorDescriptor::VectorRegister())); 310 LoadWithVectorDescriptor::VectorRegister()));
311 __ IncrementCounter(isolate->counters()->load_miss(), 1, r4, r5); 311 __ IncrementCounter(isolate->counters()->load_miss(), 1, r4, r5);
312 312
313 LoadIC_PushArgs(masm); 313 LoadIC_PushArgs(masm);
314 314
315 // Perform tail call to the entry. 315 // Perform tail call to the entry.
316 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
317 int arg_count = 4; 316 int arg_count = 4;
318 __ TailCallExternalReference(ref, arg_count, 1); 317 __ TailCallRuntime(Runtime::kLoadIC_Miss, arg_count, 1);
319 } 318 }
320 319
321 320
322 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 321 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
323 LanguageMode language_mode) { 322 LanguageMode language_mode) {
324 // The return address is in lr. 323 // The return address is in lr.
325 324
326 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister()); 325 __ mov(LoadIC_TempRegister(), LoadDescriptor::ReceiverRegister());
327 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister()); 326 __ Push(LoadIC_TempRegister(), LoadDescriptor::NameRegister());
328 327
329 // Do tail-call to runtime routine. 328 // Do tail-call to runtime routine.
330 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong 329 __ TailCallRuntime(is_strong(language_mode) ? Runtime::kGetPropertyStrong
331 : Runtime::kGetProperty, 330 : Runtime::kGetProperty,
332 2, 1); 331 2, 1);
333 } 332 }
334 333
335 334
336 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 335 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
337 // The return address is in lr. 336 // The return address is in lr.
338 Isolate* isolate = masm->isolate(); 337 Isolate* isolate = masm->isolate();
339 338
340 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(), 339 DCHECK(!AreAliased(r4, r5, LoadWithVectorDescriptor::SlotRegister(),
341 LoadWithVectorDescriptor::VectorRegister())); 340 LoadWithVectorDescriptor::VectorRegister()));
342 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r4, r5); 341 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r4, r5);
343 342
344 LoadIC_PushArgs(masm); 343 LoadIC_PushArgs(masm);
345 344
346 // Perform tail call to the entry. 345 // Perform tail call to the entry.
347 ExternalReference ref =
348 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
349 int arg_count = 4; 346 int arg_count = 4;
350 __ TailCallExternalReference(ref, arg_count, 1); 347 __ TailCallRuntime(Runtime::kKeyedLoadIC_Miss, arg_count, 1);
351 } 348 }
352 349
353 350
354 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm, 351 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm,
355 LanguageMode language_mode) { 352 LanguageMode language_mode) {
356 // The return address is in lr. 353 // The return address is in lr.
357 354
358 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister()); 355 __ Push(LoadDescriptor::ReceiverRegister(), LoadDescriptor::NameRegister());
359 356
360 // Perform tail call to the entry. 357 // Perform tail call to the entry.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 // Now jump to the place where smi keys are handled. 462 // Now jump to the place where smi keys are handled.
466 __ jmp(&index_smi); 463 __ jmp(&index_smi);
467 } 464 }
468 465
469 466
470 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 467 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
471 // Push receiver, key and value for runtime call. 468 // Push receiver, key and value for runtime call.
472 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 469 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
473 StoreDescriptor::ValueRegister()); 470 StoreDescriptor::ValueRegister());
474 471
475 ExternalReference ref = 472 __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss, 3, 1);
476 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
477 __ TailCallExternalReference(ref, 3, 1);
478 } 473 }
479 474
480 475
481 static void KeyedStoreGenerateMegamorphicHelper( 476 static void KeyedStoreGenerateMegamorphicHelper(
482 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, 477 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
483 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, 478 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
484 Register value, Register key, Register receiver, Register receiver_map, 479 Register value, Register key, Register receiver, Register receiver_map,
485 Register elements_map, Register elements) { 480 Register elements_map, Register elements) {
486 Label transition_smi_elements; 481 Label transition_smi_elements;
487 Label finish_object_store, non_double_value, transition_double_elements; 482 Label finish_object_store, non_double_value, transition_double_elements;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 // Cache miss: Jump to runtime. 764 // Cache miss: Jump to runtime.
770 GenerateMiss(masm); 765 GenerateMiss(masm);
771 } 766 }
772 767
773 768
774 void StoreIC::GenerateMiss(MacroAssembler* masm) { 769 void StoreIC::GenerateMiss(MacroAssembler* masm) {
775 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(), 770 __ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
776 StoreDescriptor::ValueRegister()); 771 StoreDescriptor::ValueRegister());
777 772
778 // Perform tail call to the entry. 773 // Perform tail call to the entry.
779 ExternalReference ref = 774 __ TailCallRuntime(Runtime::kStoreIC_Miss, 3, 1);
780 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
781 __ TailCallExternalReference(ref, 3, 1);
782 } 775 }
783 776
784 777
785 void StoreIC::GenerateNormal(MacroAssembler* masm) { 778 void StoreIC::GenerateNormal(MacroAssembler* masm) {
786 Label miss; 779 Label miss;
787 Register receiver = StoreDescriptor::ReceiverRegister(); 780 Register receiver = StoreDescriptor::ReceiverRegister();
788 Register name = StoreDescriptor::NameRegister(); 781 Register name = StoreDescriptor::NameRegister();
789 Register value = StoreDescriptor::ValueRegister(); 782 Register value = StoreDescriptor::ValueRegister();
790 Register dictionary = r3; 783 Register dictionary = r3;
791 DCHECK(receiver.is(r1)); 784 DCHECK(receiver.is(r1));
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 patcher.EmitCondition(ne); 889 patcher.EmitCondition(ne);
897 } else { 890 } else {
898 DCHECK(Assembler::GetCondition(branch_instr) == ne); 891 DCHECK(Assembler::GetCondition(branch_instr) == ne);
899 patcher.EmitCondition(eq); 892 patcher.EmitCondition(eq);
900 } 893 }
901 } 894 }
902 } // namespace internal 895 } // namespace internal
903 } // namespace v8 896 } // namespace v8
904 897
905 #endif // V8_TARGET_ARCH_ARM 898 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698