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

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

Issue 486213003: Move register conventions out of the IC classes. (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/handler-compiler-arm.cc ('k') | src/ic/arm/ic-compiler-arm.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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 STATIC_ASSERT(kInternalizedTag == 0); 237 STATIC_ASSERT(kInternalizedTag == 0);
238 __ tst(hash, Operand(kIsNotInternalizedMask)); 238 __ tst(hash, Operand(kIsNotInternalizedMask));
239 __ b(ne, not_unique); 239 __ b(ne, not_unique);
240 240
241 __ bind(&unique); 241 __ bind(&unique);
242 } 242 }
243 243
244 244
245 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { 245 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
246 // The return address is in lr. 246 // The return address is in lr.
247 Register receiver = ReceiverRegister(); 247 Register receiver = LoadConvention::ReceiverRegister();
248 Register name = NameRegister(); 248 Register name = LoadConvention::NameRegister();
249 DCHECK(receiver.is(r1)); 249 DCHECK(receiver.is(r1));
250 DCHECK(name.is(r2)); 250 DCHECK(name.is(r2));
251 251
252 // Probe the stub cache. 252 // Probe the stub cache.
253 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 253 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
254 Code::ComputeHandlerFlags(Code::LOAD_IC)); 254 Code::ComputeHandlerFlags(Code::LOAD_IC));
255 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3, 255 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3,
256 r4, r5, r6); 256 r4, r5, r6);
257 257
258 // Cache miss: Jump to runtime. 258 // Cache miss: Jump to runtime.
259 GenerateMiss(masm); 259 GenerateMiss(masm);
260 } 260 }
261 261
262 262
263 void LoadIC::GenerateNormal(MacroAssembler* masm) { 263 void LoadIC::GenerateNormal(MacroAssembler* masm) {
264 Register dictionary = r0; 264 Register dictionary = r0;
265 DCHECK(!dictionary.is(ReceiverRegister())); 265 DCHECK(!dictionary.is(LoadConvention::ReceiverRegister()));
266 DCHECK(!dictionary.is(NameRegister())); 266 DCHECK(!dictionary.is(LoadConvention::NameRegister()));
267 267
268 Label slow; 268 Label slow;
269 269
270 __ ldr(dictionary, 270 __ ldr(dictionary, FieldMemOperand(LoadConvention::ReceiverRegister(),
271 FieldMemOperand(ReceiverRegister(), JSObject::kPropertiesOffset)); 271 JSObject::kPropertiesOffset));
272 GenerateDictionaryLoad(masm, &slow, dictionary, NameRegister(), r0, r3, r4); 272 GenerateDictionaryLoad(masm, &slow, dictionary,
273 LoadConvention::NameRegister(), r0, r3, r4);
273 __ Ret(); 274 __ Ret();
274 275
275 // Dictionary load failed, go slow (but don't miss). 276 // Dictionary load failed, go slow (but don't miss).
276 __ bind(&slow); 277 __ bind(&slow);
277 GenerateRuntimeGetProperty(masm); 278 GenerateRuntimeGetProperty(masm);
278 } 279 }
279 280
280 281
281 // A register that isn't one of the parameters to the load ic. 282 // A register that isn't one of the parameters to the load ic.
282 static const Register LoadIC_TempRegister() { return r3; } 283 static const Register LoadIC_TempRegister() { return r3; }
283 284
284 285
285 void LoadIC::GenerateMiss(MacroAssembler* masm) { 286 void LoadIC::GenerateMiss(MacroAssembler* masm) {
286 // The return address is in lr. 287 // The return address is in lr.
287 Isolate* isolate = masm->isolate(); 288 Isolate* isolate = masm->isolate();
288 289
289 __ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4); 290 __ IncrementCounter(isolate->counters()->load_miss(), 1, r3, r4);
290 291
291 __ mov(LoadIC_TempRegister(), ReceiverRegister()); 292 __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister());
292 __ Push(LoadIC_TempRegister(), NameRegister()); 293 __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister());
293 294
294 // Perform tail call to the entry. 295 // Perform tail call to the entry.
295 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate); 296 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss), isolate);
296 __ TailCallExternalReference(ref, 2, 1); 297 __ TailCallExternalReference(ref, 2, 1);
297 } 298 }
298 299
299 300
300 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 301 void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
301 // The return address is in lr. 302 // The return address is in lr.
302 303
303 __ mov(LoadIC_TempRegister(), ReceiverRegister()); 304 __ mov(LoadIC_TempRegister(), LoadConvention::ReceiverRegister());
304 __ Push(LoadIC_TempRegister(), NameRegister()); 305 __ Push(LoadIC_TempRegister(), LoadConvention::NameRegister());
305 306
306 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); 307 __ TailCallRuntime(Runtime::kGetProperty, 2, 1);
307 } 308 }
308 309
309 310
310 static MemOperand GenerateMappedArgumentsLookup( 311 static MemOperand GenerateMappedArgumentsLookup(
311 MacroAssembler* masm, Register object, Register key, Register scratch1, 312 MacroAssembler* masm, Register object, Register key, Register scratch1,
312 Register scratch2, Register scratch3, Label* unmapped_case, 313 Register scratch2, Register scratch3, Label* unmapped_case,
313 Label* slow_case) { 314 Label* slow_case) {
314 Heap* heap = masm->isolate()->heap(); 315 Heap* heap = masm->isolate()->heap();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 __ b(cs, slow_case); 382 __ b(cs, slow_case);
382 __ mov(scratch, Operand(kPointerSize >> 1)); 383 __ mov(scratch, Operand(kPointerSize >> 1));
383 __ mul(scratch, key, scratch); 384 __ mul(scratch, key, scratch);
384 __ add(scratch, scratch, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 385 __ add(scratch, scratch, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
385 return MemOperand(backing_store, scratch); 386 return MemOperand(backing_store, scratch);
386 } 387 }
387 388
388 389
389 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { 390 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
390 // The return address is in lr. 391 // The return address is in lr.
391 Register receiver = ReceiverRegister(); 392 Register receiver = LoadConvention::ReceiverRegister();
392 Register key = NameRegister(); 393 Register key = LoadConvention::NameRegister();
393 DCHECK(receiver.is(r1)); 394 DCHECK(receiver.is(r1));
394 DCHECK(key.is(r2)); 395 DCHECK(key.is(r2));
395 396
396 Label slow, notin; 397 Label slow, notin;
397 MemOperand mapped_location = GenerateMappedArgumentsLookup( 398 MemOperand mapped_location = GenerateMappedArgumentsLookup(
398 masm, receiver, key, r0, r3, r4, &notin, &slow); 399 masm, receiver, key, r0, r3, r4, &notin, &slow);
399 __ ldr(r0, mapped_location); 400 __ ldr(r0, mapped_location);
400 __ Ret(); 401 __ Ret();
401 __ bind(&notin); 402 __ bind(&notin);
402 // The unmapped lookup expects that the parameter map is in r0. 403 // The unmapped lookup expects that the parameter map is in r0.
403 MemOperand unmapped_location = 404 MemOperand unmapped_location =
404 GenerateUnmappedArgumentsLookup(masm, key, r0, r3, &slow); 405 GenerateUnmappedArgumentsLookup(masm, key, r0, r3, &slow);
405 __ ldr(r0, unmapped_location); 406 __ ldr(r0, unmapped_location);
406 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); 407 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex);
407 __ cmp(r0, r3); 408 __ cmp(r0, r3);
408 __ b(eq, &slow); 409 __ b(eq, &slow);
409 __ Ret(); 410 __ Ret();
410 __ bind(&slow); 411 __ bind(&slow);
411 GenerateMiss(masm); 412 GenerateMiss(masm);
412 } 413 }
413 414
414 415
415 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { 416 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
416 Register receiver = ReceiverRegister(); 417 Register receiver = StoreConvention::ReceiverRegister();
417 Register key = NameRegister(); 418 Register key = StoreConvention::NameRegister();
418 Register value = ValueRegister(); 419 Register value = StoreConvention::ValueRegister();
419 DCHECK(receiver.is(r1)); 420 DCHECK(receiver.is(r1));
420 DCHECK(key.is(r2)); 421 DCHECK(key.is(r2));
421 DCHECK(value.is(r0)); 422 DCHECK(value.is(r0));
422 423
423 Label slow, notin; 424 Label slow, notin;
424 MemOperand mapped_location = GenerateMappedArgumentsLookup( 425 MemOperand mapped_location = GenerateMappedArgumentsLookup(
425 masm, receiver, key, r3, r4, r5, &notin, &slow); 426 masm, receiver, key, r3, r4, r5, &notin, &slow);
426 __ str(value, mapped_location); 427 __ str(value, mapped_location);
427 __ add(r6, r3, r5); 428 __ add(r6, r3, r5);
428 __ mov(r9, value); 429 __ mov(r9, value);
(...skipping 12 matching lines...) Expand all
441 GenerateMiss(masm); 442 GenerateMiss(masm);
442 } 443 }
443 444
444 445
445 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 446 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
446 // The return address is in lr. 447 // The return address is in lr.
447 Isolate* isolate = masm->isolate(); 448 Isolate* isolate = masm->isolate();
448 449
449 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4); 450 __ IncrementCounter(isolate->counters()->keyed_load_miss(), 1, r3, r4);
450 451
451 __ Push(ReceiverRegister(), NameRegister()); 452 __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister());
452 453
453 // Perform tail call to the entry. 454 // Perform tail call to the entry.
454 ExternalReference ref = 455 ExternalReference ref =
455 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate); 456 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), isolate);
456 457
457 __ TailCallExternalReference(ref, 2, 1); 458 __ TailCallExternalReference(ref, 2, 1);
458 } 459 }
459 460
460 461
461 // IC register specifications
462 const Register LoadIC::ReceiverRegister() { return r1; }
463 const Register LoadIC::NameRegister() { return r2; }
464
465
466 const Register LoadIC::SlotRegister() {
467 DCHECK(FLAG_vector_ics);
468 return r0;
469 }
470
471
472 const Register LoadIC::VectorRegister() {
473 DCHECK(FLAG_vector_ics);
474 return r3;
475 }
476
477
478 const Register StoreIC::ReceiverRegister() { return r1; }
479 const Register StoreIC::NameRegister() { return r2; }
480 const Register StoreIC::ValueRegister() { return r0; }
481
482
483 const Register KeyedStoreIC::MapRegister() { return r3; }
484
485
486 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 462 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
487 // The return address is in lr. 463 // The return address is in lr.
488 464
489 __ Push(ReceiverRegister(), NameRegister()); 465 __ Push(LoadConvention::ReceiverRegister(), LoadConvention::NameRegister());
490 466
491 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); 467 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
492 } 468 }
493 469
494 470
495 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 471 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
496 // The return address is in lr. 472 // The return address is in lr.
497 Label slow, check_name, index_smi, index_name, property_array_property; 473 Label slow, check_name, index_smi, index_name, property_array_property;
498 Label probe_dictionary, check_number_dictionary; 474 Label probe_dictionary, check_number_dictionary;
499 475
500 Register key = NameRegister(); 476 Register key = LoadConvention::NameRegister();
501 Register receiver = ReceiverRegister(); 477 Register receiver = LoadConvention::ReceiverRegister();
502 DCHECK(key.is(r2)); 478 DCHECK(key.is(r2));
503 DCHECK(receiver.is(r1)); 479 DCHECK(receiver.is(r1));
504 480
505 Isolate* isolate = masm->isolate(); 481 Isolate* isolate = masm->isolate();
506 482
507 // Check that the key is a smi. 483 // Check that the key is a smi.
508 __ JumpIfNotSmi(key, &check_name); 484 __ JumpIfNotSmi(key, &check_name);
509 __ bind(&index_smi); 485 __ bind(&index_smi);
510 // Now the key is known to be a smi. This place is also jumped to from below 486 // Now the key is known to be a smi. This place is also jumped to from below
511 // where a numeric string is converted to a smi. 487 // where a numeric string is converted to a smi.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 __ IndexFromHash(r3, key); 628 __ IndexFromHash(r3, key);
653 // Now jump to the place where smi keys are handled. 629 // Now jump to the place where smi keys are handled.
654 __ jmp(&index_smi); 630 __ jmp(&index_smi);
655 } 631 }
656 632
657 633
658 void KeyedLoadIC::GenerateString(MacroAssembler* masm) { 634 void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
659 // Return address is in lr. 635 // Return address is in lr.
660 Label miss; 636 Label miss;
661 637
662 Register receiver = ReceiverRegister(); 638 Register receiver = LoadConvention::ReceiverRegister();
663 Register index = NameRegister(); 639 Register index = LoadConvention::NameRegister();
664 Register scratch = r3; 640 Register scratch = r3;
665 Register result = r0; 641 Register result = r0;
666 DCHECK(!scratch.is(receiver) && !scratch.is(index)); 642 DCHECK(!scratch.is(receiver) && !scratch.is(index));
667 643
668 StringCharAtGenerator char_at_generator(receiver, index, scratch, result, 644 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
669 &miss, // When not a string. 645 &miss, // When not a string.
670 &miss, // When not a number. 646 &miss, // When not a number.
671 &miss, // When index out of range. 647 &miss, // When index out of range.
672 STRING_INDEX_IS_ARRAY_INDEX); 648 STRING_INDEX_IS_ARRAY_INDEX);
673 char_at_generator.GenerateFast(masm); 649 char_at_generator.GenerateFast(masm);
674 __ Ret(); 650 __ Ret();
675 651
676 StubRuntimeCallHelper call_helper; 652 StubRuntimeCallHelper call_helper;
677 char_at_generator.GenerateSlow(masm, call_helper); 653 char_at_generator.GenerateSlow(masm, call_helper);
678 654
679 __ bind(&miss); 655 __ bind(&miss);
680 GenerateMiss(masm); 656 GenerateMiss(masm);
681 } 657 }
682 658
683 659
684 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { 660 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
685 // Return address is in lr. 661 // Return address is in lr.
686 Label slow; 662 Label slow;
687 663
688 Register receiver = ReceiverRegister(); 664 Register receiver = LoadConvention::ReceiverRegister();
689 Register key = NameRegister(); 665 Register key = LoadConvention::NameRegister();
690 Register scratch1 = r3; 666 Register scratch1 = r3;
691 Register scratch2 = r4; 667 Register scratch2 = r4;
692 DCHECK(!scratch1.is(receiver) && !scratch1.is(key)); 668 DCHECK(!scratch1.is(receiver) && !scratch1.is(key));
693 DCHECK(!scratch2.is(receiver) && !scratch2.is(key)); 669 DCHECK(!scratch2.is(receiver) && !scratch2.is(key));
694 670
695 // Check that the receiver isn't a smi. 671 // Check that the receiver isn't a smi.
696 __ JumpIfSmi(receiver, &slow); 672 __ JumpIfSmi(receiver, &slow);
697 673
698 // Check that the key is an array index, that is Uint32. 674 // Check that the key is an array index, that is Uint32.
699 __ NonNegativeSmiTst(key); 675 __ NonNegativeSmiTst(key);
(...skipping 18 matching lines...) Expand all
718 masm->isolate()), 694 masm->isolate()),
719 2, 1); 695 2, 1);
720 696
721 __ bind(&slow); 697 __ bind(&slow);
722 GenerateMiss(masm); 698 GenerateMiss(masm);
723 } 699 }
724 700
725 701
726 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 702 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
727 // Push receiver, key and value for runtime call. 703 // Push receiver, key and value for runtime call.
728 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); 704 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(),
705 StoreConvention::ValueRegister());
729 706
730 ExternalReference ref = 707 ExternalReference ref =
731 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate()); 708 ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
732 __ TailCallExternalReference(ref, 3, 1); 709 __ TailCallExternalReference(ref, 3, 1);
733 } 710 }
734 711
735 712
736 static void KeyedStoreGenerateGenericHelper( 713 static void KeyedStoreGenerateGenericHelper(
737 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, 714 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
738 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, 715 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 // -- r0 : value 857 // -- r0 : value
881 // -- r1 : key 858 // -- r1 : key
882 // -- r2 : receiver 859 // -- r2 : receiver
883 // -- lr : return address 860 // -- lr : return address
884 // ----------------------------------- 861 // -----------------------------------
885 Label slow, fast_object, fast_object_grow; 862 Label slow, fast_object, fast_object_grow;
886 Label fast_double, fast_double_grow; 863 Label fast_double, fast_double_grow;
887 Label array, extra, check_if_double_array; 864 Label array, extra, check_if_double_array;
888 865
889 // Register usage. 866 // Register usage.
890 Register value = ValueRegister(); 867 Register value = StoreConvention::ValueRegister();
891 Register key = NameRegister(); 868 Register key = StoreConvention::NameRegister();
892 Register receiver = ReceiverRegister(); 869 Register receiver = StoreConvention::ReceiverRegister();
893 DCHECK(receiver.is(r1)); 870 DCHECK(receiver.is(r1));
894 DCHECK(key.is(r2)); 871 DCHECK(key.is(r2));
895 DCHECK(value.is(r0)); 872 DCHECK(value.is(r0));
896 Register receiver_map = r3; 873 Register receiver_map = r3;
897 Register elements_map = r6; 874 Register elements_map = r6;
898 Register elements = r9; // Elements array of the receiver. 875 Register elements = r9; // Elements array of the receiver.
899 // r4 and r5 are used as general scratch registers. 876 // r4 and r5 are used as general scratch registers.
900 877
901 // Check that the key is a smi. 878 // Check that the key is a smi.
902 __ JumpIfNotSmi(key, &slow); 879 __ JumpIfNotSmi(key, &slow);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 masm, &fast_object, &fast_double, &slow, kCheckMap, kDontIncrementLength, 946 masm, &fast_object, &fast_double, &slow, kCheckMap, kDontIncrementLength,
970 value, key, receiver, receiver_map, elements_map, elements); 947 value, key, receiver, receiver_map, elements_map, elements);
971 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, 948 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow,
972 &slow, kDontCheckMap, kIncrementLength, value, 949 &slow, kDontCheckMap, kIncrementLength, value,
973 key, receiver, receiver_map, elements_map, 950 key, receiver, receiver_map, elements_map,
974 elements); 951 elements);
975 } 952 }
976 953
977 954
978 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 955 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
979 Register receiver = ReceiverRegister(); 956 Register receiver = StoreConvention::ReceiverRegister();
980 Register name = NameRegister(); 957 Register name = StoreConvention::NameRegister();
981 DCHECK(receiver.is(r1)); 958 DCHECK(receiver.is(r1));
982 DCHECK(name.is(r2)); 959 DCHECK(name.is(r2));
983 DCHECK(ValueRegister().is(r0)); 960 DCHECK(StoreConvention::ValueRegister().is(r0));
984 961
985 // Get the receiver from the stack and probe the stub cache. 962 // Get the receiver from the stack and probe the stub cache.
986 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( 963 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags(
987 Code::ComputeHandlerFlags(Code::STORE_IC)); 964 Code::ComputeHandlerFlags(Code::STORE_IC));
988 965
989 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3, 966 masm->isolate()->stub_cache()->GenerateProbe(masm, flags, receiver, name, r3,
990 r4, r5, r6); 967 r4, r5, r6);
991 968
992 // Cache miss: Jump to runtime. 969 // Cache miss: Jump to runtime.
993 GenerateMiss(masm); 970 GenerateMiss(masm);
994 } 971 }
995 972
996 973
997 void StoreIC::GenerateMiss(MacroAssembler* masm) { 974 void StoreIC::GenerateMiss(MacroAssembler* masm) {
998 __ Push(ReceiverRegister(), NameRegister(), ValueRegister()); 975 __ Push(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister(),
976 StoreConvention::ValueRegister());
999 977
1000 // Perform tail call to the entry. 978 // Perform tail call to the entry.
1001 ExternalReference ref = 979 ExternalReference ref =
1002 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate()); 980 ExternalReference(IC_Utility(kStoreIC_Miss), masm->isolate());
1003 __ TailCallExternalReference(ref, 3, 1); 981 __ TailCallExternalReference(ref, 3, 1);
1004 } 982 }
1005 983
1006 984
1007 void StoreIC::GenerateNormal(MacroAssembler* masm) { 985 void StoreIC::GenerateNormal(MacroAssembler* masm) {
1008 Label miss; 986 Label miss;
1009 Register receiver = ReceiverRegister(); 987 Register receiver = StoreConvention::ReceiverRegister();
1010 Register name = NameRegister(); 988 Register name = StoreConvention::NameRegister();
1011 Register value = ValueRegister(); 989 Register value = StoreConvention::ValueRegister();
1012 Register dictionary = r3; 990 Register dictionary = r3;
1013 DCHECK(receiver.is(r1)); 991 DCHECK(receiver.is(r1));
1014 DCHECK(name.is(r2)); 992 DCHECK(name.is(r2));
1015 DCHECK(value.is(r0)); 993 DCHECK(value.is(r0));
1016 994
1017 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 995 __ ldr(dictionary, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
1018 996
1019 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5); 997 GenerateDictionaryStore(masm, &miss, dictionary, name, value, r4, r5);
1020 Counters* counters = masm->isolate()->counters(); 998 Counters* counters = masm->isolate()->counters();
1021 __ IncrementCounter(counters->store_normal_hit(), 1, r4, r5); 999 __ IncrementCounter(counters->store_normal_hit(), 1, r4, r5);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 patcher.EmitCondition(ne); 1096 patcher.EmitCondition(ne);
1119 } else { 1097 } else {
1120 DCHECK(Assembler::GetCondition(branch_instr) == ne); 1098 DCHECK(Assembler::GetCondition(branch_instr) == ne);
1121 patcher.EmitCondition(eq); 1099 patcher.EmitCondition(eq);
1122 } 1100 }
1123 } 1101 }
1124 } 1102 }
1125 } // namespace v8::internal 1103 } // namespace v8::internal
1126 1104
1127 #endif // V8_TARGET_ARCH_ARM 1105 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/arm/ic-compiler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698