OLD | NEW |
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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 __ cmp(key, scratch); | 376 __ cmp(key, scratch); |
377 __ j(greater_equal, slow_case); | 377 __ j(greater_equal, slow_case); |
378 return FieldOperand(backing_store, | 378 return FieldOperand(backing_store, |
379 key, | 379 key, |
380 times_half_pointer_size, | 380 times_half_pointer_size, |
381 FixedArray::kHeaderSize); | 381 FixedArray::kHeaderSize); |
382 } | 382 } |
383 | 383 |
384 | 384 |
385 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 385 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
386 // ----------- S t a t e ------------- | 386 // The return address is on the stack. |
387 // -- ecx : key | |
388 // -- edx : receiver | |
389 // -- esp[0] : return address | |
390 // ----------------------------------- | |
391 ASSERT(edx.is(ReceiverRegister())); | |
392 ASSERT(ecx.is(NameRegister())); | |
393 Label slow, check_name, index_smi, index_name, property_array_property; | 387 Label slow, check_name, index_smi, index_name, property_array_property; |
394 Label probe_dictionary, check_number_dictionary; | 388 Label probe_dictionary, check_number_dictionary; |
395 | 389 |
| 390 Register receiver = ReceiverRegister(); |
| 391 Register key = NameRegister(); |
| 392 ASSERT(receiver.is(edx)); |
| 393 ASSERT(key.is(ecx)); |
| 394 |
396 // Check that the key is a smi. | 395 // Check that the key is a smi. |
397 __ JumpIfNotSmi(ecx, &check_name); | 396 __ JumpIfNotSmi(key, &check_name); |
398 __ bind(&index_smi); | 397 __ bind(&index_smi); |
399 // Now the key is known to be a smi. This place is also jumped to from | 398 // Now the key is known to be a smi. This place is also jumped to from |
400 // where a numeric string is converted to a smi. | 399 // where a numeric string is converted to a smi. |
401 | 400 |
402 GenerateKeyedLoadReceiverCheck( | 401 GenerateKeyedLoadReceiverCheck( |
403 masm, edx, eax, Map::kHasIndexedInterceptor, &slow); | 402 masm, receiver, eax, Map::kHasIndexedInterceptor, &slow); |
404 | 403 |
405 // Check the receiver's map to see if it has fast elements. | 404 // Check the receiver's map to see if it has fast elements. |
406 __ CheckFastElements(eax, &check_number_dictionary); | 405 __ CheckFastElements(eax, &check_number_dictionary); |
407 | 406 |
408 GenerateFastArrayLoad(masm, edx, ecx, eax, eax, NULL, &slow); | 407 GenerateFastArrayLoad(masm, receiver, key, eax, eax, NULL, &slow); |
409 Isolate* isolate = masm->isolate(); | 408 Isolate* isolate = masm->isolate(); |
410 Counters* counters = isolate->counters(); | 409 Counters* counters = isolate->counters(); |
411 __ IncrementCounter(counters->keyed_load_generic_smi(), 1); | 410 __ IncrementCounter(counters->keyed_load_generic_smi(), 1); |
412 __ ret(0); | 411 __ ret(0); |
413 | 412 |
414 __ bind(&check_number_dictionary); | 413 __ bind(&check_number_dictionary); |
415 __ mov(ebx, ecx); | 414 __ mov(ebx, key); |
416 __ SmiUntag(ebx); | 415 __ SmiUntag(ebx); |
417 __ mov(eax, FieldOperand(edx, JSObject::kElementsOffset)); | 416 __ mov(eax, FieldOperand(receiver, JSObject::kElementsOffset)); |
418 | 417 |
419 // Check whether the elements is a number dictionary. | 418 // Check whether the elements is a number dictionary. |
420 // edx: receiver | |
421 // ebx: untagged index | 419 // ebx: untagged index |
422 // ecx: key | |
423 // eax: elements | 420 // eax: elements |
424 __ CheckMap(eax, | 421 __ CheckMap(eax, |
425 isolate->factory()->hash_table_map(), | 422 isolate->factory()->hash_table_map(), |
426 &slow, | 423 &slow, |
427 DONT_DO_SMI_CHECK); | 424 DONT_DO_SMI_CHECK); |
428 Label slow_pop_receiver; | 425 Label slow_pop_receiver; |
429 // Push receiver on the stack to free up a register for the dictionary | 426 // Push receiver on the stack to free up a register for the dictionary |
430 // probing. | 427 // probing. |
431 __ push(edx); | 428 __ push(receiver); |
432 __ LoadFromNumberDictionary(&slow_pop_receiver, eax, ecx, ebx, edx, edi, eax); | 429 __ LoadFromNumberDictionary(&slow_pop_receiver, eax, key, ebx, edx, edi, eax); |
433 // Pop receiver before returning. | 430 // Pop receiver before returning. |
434 __ pop(edx); | 431 __ pop(receiver); |
435 __ ret(0); | 432 __ ret(0); |
436 | 433 |
437 __ bind(&slow_pop_receiver); | 434 __ bind(&slow_pop_receiver); |
438 // Pop the receiver from the stack and jump to runtime. | 435 // Pop the receiver from the stack and jump to runtime. |
439 __ pop(edx); | 436 __ pop(receiver); |
440 | 437 |
441 __ bind(&slow); | 438 __ bind(&slow); |
442 // Slow case: jump to runtime. | 439 // Slow case: jump to runtime. |
443 // edx: receiver | |
444 // ecx: key | |
445 __ IncrementCounter(counters->keyed_load_generic_slow(), 1); | 440 __ IncrementCounter(counters->keyed_load_generic_slow(), 1); |
446 GenerateRuntimeGetProperty(masm); | 441 GenerateRuntimeGetProperty(masm); |
447 | 442 |
448 __ bind(&check_name); | 443 __ bind(&check_name); |
449 GenerateKeyNameCheck(masm, ecx, eax, ebx, &index_name, &slow); | 444 GenerateKeyNameCheck(masm, key, eax, ebx, &index_name, &slow); |
450 | 445 |
451 GenerateKeyedLoadReceiverCheck( | 446 GenerateKeyedLoadReceiverCheck( |
452 masm, edx, eax, Map::kHasNamedInterceptor, &slow); | 447 masm, receiver, eax, Map::kHasNamedInterceptor, &slow); |
453 | 448 |
454 // If the receiver is a fast-case object, check the keyed lookup | 449 // If the receiver is a fast-case object, check the keyed lookup |
455 // cache. Otherwise probe the dictionary. | 450 // cache. Otherwise probe the dictionary. |
456 __ mov(ebx, FieldOperand(edx, JSObject::kPropertiesOffset)); | 451 __ mov(ebx, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
457 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), | 452 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), |
458 Immediate(isolate->factory()->hash_table_map())); | 453 Immediate(isolate->factory()->hash_table_map())); |
459 __ j(equal, &probe_dictionary); | 454 __ j(equal, &probe_dictionary); |
460 | 455 |
461 // The receiver's map is still in eax, compute the keyed lookup cache hash | 456 // The receiver's map is still in eax, compute the keyed lookup cache hash |
462 // based on 32 bits of the map pointer and the string hash. | 457 // based on 32 bits of the map pointer and the string hash. |
463 if (FLAG_debug_code) { | 458 if (FLAG_debug_code) { |
464 __ cmp(eax, FieldOperand(edx, HeapObject::kMapOffset)); | 459 __ cmp(eax, FieldOperand(receiver, HeapObject::kMapOffset)); |
465 __ Check(equal, kMapIsNoLongerInEax); | 460 __ Check(equal, kMapIsNoLongerInEax); |
466 } | 461 } |
467 __ mov(ebx, eax); // Keep the map around for later. | 462 __ mov(ebx, eax); // Keep the map around for later. |
468 __ shr(eax, KeyedLookupCache::kMapHashShift); | 463 __ shr(eax, KeyedLookupCache::kMapHashShift); |
469 __ mov(edi, FieldOperand(ecx, String::kHashFieldOffset)); | 464 __ mov(edi, FieldOperand(key, String::kHashFieldOffset)); |
470 __ shr(edi, String::kHashShift); | 465 __ shr(edi, String::kHashShift); |
471 __ xor_(eax, edi); | 466 __ xor_(eax, edi); |
472 __ and_(eax, KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask); | 467 __ and_(eax, KeyedLookupCache::kCapacityMask & KeyedLookupCache::kHashMask); |
473 | 468 |
474 // Load the key (consisting of map and internalized string) from the cache and | 469 // Load the key (consisting of map and internalized string) from the cache and |
475 // check for match. | 470 // check for match. |
476 Label load_in_object_property; | 471 Label load_in_object_property; |
477 static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket; | 472 static const int kEntriesPerBucket = KeyedLookupCache::kEntriesPerBucket; |
478 Label hit_on_nth_entry[kEntriesPerBucket]; | 473 Label hit_on_nth_entry[kEntriesPerBucket]; |
479 ExternalReference cache_keys = | 474 ExternalReference cache_keys = |
480 ExternalReference::keyed_lookup_cache_keys(masm->isolate()); | 475 ExternalReference::keyed_lookup_cache_keys(masm->isolate()); |
481 | 476 |
482 for (int i = 0; i < kEntriesPerBucket - 1; i++) { | 477 for (int i = 0; i < kEntriesPerBucket - 1; i++) { |
483 Label try_next_entry; | 478 Label try_next_entry; |
484 __ mov(edi, eax); | 479 __ mov(edi, eax); |
485 __ shl(edi, kPointerSizeLog2 + 1); | 480 __ shl(edi, kPointerSizeLog2 + 1); |
486 if (i != 0) { | 481 if (i != 0) { |
487 __ add(edi, Immediate(kPointerSize * i * 2)); | 482 __ add(edi, Immediate(kPointerSize * i * 2)); |
488 } | 483 } |
489 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys)); | 484 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys)); |
490 __ j(not_equal, &try_next_entry); | 485 __ j(not_equal, &try_next_entry); |
491 __ add(edi, Immediate(kPointerSize)); | 486 __ add(edi, Immediate(kPointerSize)); |
492 __ cmp(ecx, Operand::StaticArray(edi, times_1, cache_keys)); | 487 __ cmp(key, Operand::StaticArray(edi, times_1, cache_keys)); |
493 __ j(equal, &hit_on_nth_entry[i]); | 488 __ j(equal, &hit_on_nth_entry[i]); |
494 __ bind(&try_next_entry); | 489 __ bind(&try_next_entry); |
495 } | 490 } |
496 | 491 |
497 __ lea(edi, Operand(eax, 1)); | 492 __ lea(edi, Operand(eax, 1)); |
498 __ shl(edi, kPointerSizeLog2 + 1); | 493 __ shl(edi, kPointerSizeLog2 + 1); |
499 __ add(edi, Immediate(kPointerSize * (kEntriesPerBucket - 1) * 2)); | 494 __ add(edi, Immediate(kPointerSize * (kEntriesPerBucket - 1) * 2)); |
500 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys)); | 495 __ cmp(ebx, Operand::StaticArray(edi, times_1, cache_keys)); |
501 __ j(not_equal, &slow); | 496 __ j(not_equal, &slow); |
502 __ add(edi, Immediate(kPointerSize)); | 497 __ add(edi, Immediate(kPointerSize)); |
503 __ cmp(ecx, Operand::StaticArray(edi, times_1, cache_keys)); | 498 __ cmp(key, Operand::StaticArray(edi, times_1, cache_keys)); |
504 __ j(not_equal, &slow); | 499 __ j(not_equal, &slow); |
505 | 500 |
506 // Get field offset. | 501 // Get field offset. |
507 // edx : receiver | 502 // ebx : receiver's map |
508 // ebx : receiver's map | 503 // eax : lookup cache index |
509 // ecx : key | |
510 // eax : lookup cache index | |
511 ExternalReference cache_field_offsets = | 504 ExternalReference cache_field_offsets = |
512 ExternalReference::keyed_lookup_cache_field_offsets(masm->isolate()); | 505 ExternalReference::keyed_lookup_cache_field_offsets(masm->isolate()); |
513 | 506 |
514 // Hit on nth entry. | 507 // Hit on nth entry. |
515 for (int i = kEntriesPerBucket - 1; i >= 0; i--) { | 508 for (int i = kEntriesPerBucket - 1; i >= 0; i--) { |
516 __ bind(&hit_on_nth_entry[i]); | 509 __ bind(&hit_on_nth_entry[i]); |
517 if (i != 0) { | 510 if (i != 0) { |
518 __ add(eax, Immediate(i)); | 511 __ add(eax, Immediate(i)); |
519 } | 512 } |
520 __ mov(edi, | 513 __ mov(edi, |
521 Operand::StaticArray(eax, times_pointer_size, cache_field_offsets)); | 514 Operand::StaticArray(eax, times_pointer_size, cache_field_offsets)); |
522 __ movzx_b(eax, FieldOperand(ebx, Map::kInObjectPropertiesOffset)); | 515 __ movzx_b(eax, FieldOperand(ebx, Map::kInObjectPropertiesOffset)); |
523 __ sub(edi, eax); | 516 __ sub(edi, eax); |
524 __ j(above_equal, &property_array_property); | 517 __ j(above_equal, &property_array_property); |
525 if (i != 0) { | 518 if (i != 0) { |
526 __ jmp(&load_in_object_property); | 519 __ jmp(&load_in_object_property); |
527 } | 520 } |
528 } | 521 } |
529 | 522 |
530 // Load in-object property. | 523 // Load in-object property. |
531 __ bind(&load_in_object_property); | 524 __ bind(&load_in_object_property); |
532 __ movzx_b(eax, FieldOperand(ebx, Map::kInstanceSizeOffset)); | 525 __ movzx_b(eax, FieldOperand(ebx, Map::kInstanceSizeOffset)); |
533 __ add(eax, edi); | 526 __ add(eax, edi); |
534 __ mov(eax, FieldOperand(edx, eax, times_pointer_size, 0)); | 527 __ mov(eax, FieldOperand(receiver, eax, times_pointer_size, 0)); |
535 __ IncrementCounter(counters->keyed_load_generic_lookup_cache(), 1); | 528 __ IncrementCounter(counters->keyed_load_generic_lookup_cache(), 1); |
536 __ ret(0); | 529 __ ret(0); |
537 | 530 |
538 // Load property array property. | 531 // Load property array property. |
539 __ bind(&property_array_property); | 532 __ bind(&property_array_property); |
540 __ mov(eax, FieldOperand(edx, JSObject::kPropertiesOffset)); | 533 __ mov(eax, FieldOperand(receiver, JSObject::kPropertiesOffset)); |
541 __ mov(eax, FieldOperand(eax, edi, times_pointer_size, | 534 __ mov(eax, FieldOperand(eax, edi, times_pointer_size, |
542 FixedArray::kHeaderSize)); | 535 FixedArray::kHeaderSize)); |
543 __ IncrementCounter(counters->keyed_load_generic_lookup_cache(), 1); | 536 __ IncrementCounter(counters->keyed_load_generic_lookup_cache(), 1); |
544 __ ret(0); | 537 __ ret(0); |
545 | 538 |
546 // Do a quick inline probe of the receiver's dictionary, if it | 539 // Do a quick inline probe of the receiver's dictionary, if it |
547 // exists. | 540 // exists. |
548 __ bind(&probe_dictionary); | 541 __ bind(&probe_dictionary); |
549 | 542 |
550 __ mov(eax, FieldOperand(edx, JSObject::kMapOffset)); | 543 __ mov(eax, FieldOperand(receiver, JSObject::kMapOffset)); |
551 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); | 544 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); |
552 GenerateGlobalInstanceTypeCheck(masm, eax, &slow); | 545 GenerateGlobalInstanceTypeCheck(masm, eax, &slow); |
553 | 546 |
554 GenerateDictionaryLoad(masm, &slow, ebx, ecx, eax, edi, eax); | 547 GenerateDictionaryLoad(masm, &slow, ebx, key, eax, edi, eax); |
555 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); | 548 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); |
556 __ ret(0); | 549 __ ret(0); |
557 | 550 |
558 __ bind(&index_name); | 551 __ bind(&index_name); |
559 __ IndexFromHash(ebx, ecx); | 552 __ IndexFromHash(ebx, key); |
560 // Now jump to the place where smi keys are handled. | 553 // Now jump to the place where smi keys are handled. |
561 __ jmp(&index_smi); | 554 __ jmp(&index_smi); |
562 } | 555 } |
563 | 556 |
564 | 557 |
565 // A register that isn't one of the parameters to the load ic. | 558 // A register that isn't one of the parameters to the load ic. |
566 static const Register LoadIC_TempRegister() { return ebx; } | 559 static const Register LoadIC_TempRegister() { return ebx; } |
567 | 560 |
568 | 561 |
569 // A register that isn't one of the parameters to the load ic. | 562 // A register that isn't one of the parameters to the load ic. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), | 631 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor), |
639 masm->isolate()); | 632 masm->isolate()); |
640 __ TailCallExternalReference(ref, 2, 1); | 633 __ TailCallExternalReference(ref, 2, 1); |
641 | 634 |
642 __ bind(&slow); | 635 __ bind(&slow); |
643 GenerateMiss(masm); | 636 GenerateMiss(masm); |
644 } | 637 } |
645 | 638 |
646 | 639 |
647 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { | 640 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
648 // ----------- S t a t e ------------- | 641 // The return address is on the stack. |
649 // -- ecx : key | 642 Register receiver = ReceiverRegister(); |
650 // -- edx : receiver | 643 Register key = NameRegister(); |
651 // -- esp[0] : return address | 644 ASSERT(receiver.is(edx)); |
652 // ----------------------------------- | 645 ASSERT(key.is(ecx)); |
653 ASSERT(edx.is(ReceiverRegister())); | 646 |
654 ASSERT(ecx.is(NameRegister())); | |
655 Label slow, notin; | 647 Label slow, notin; |
656 Factory* factory = masm->isolate()->factory(); | 648 Factory* factory = masm->isolate()->factory(); |
657 Operand mapped_location = | 649 Operand mapped_location = |
658 GenerateMappedArgumentsLookup(masm, edx, ecx, ebx, eax, ¬in, &slow); | 650 GenerateMappedArgumentsLookup( |
| 651 masm, receiver, key, ebx, eax, ¬in, &slow); |
659 __ mov(eax, mapped_location); | 652 __ mov(eax, mapped_location); |
660 __ Ret(); | 653 __ Ret(); |
661 __ bind(¬in); | 654 __ bind(¬in); |
662 // The unmapped lookup expects that the parameter map is in ebx. | 655 // The unmapped lookup expects that the parameter map is in ebx. |
663 Operand unmapped_location = | 656 Operand unmapped_location = |
664 GenerateUnmappedArgumentsLookup(masm, ecx, ebx, eax, &slow); | 657 GenerateUnmappedArgumentsLookup(masm, key, ebx, eax, &slow); |
665 __ cmp(unmapped_location, factory->the_hole_value()); | 658 __ cmp(unmapped_location, factory->the_hole_value()); |
666 __ j(equal, &slow); | 659 __ j(equal, &slow); |
667 __ mov(eax, unmapped_location); | 660 __ mov(eax, unmapped_location); |
668 __ Ret(); | 661 __ Ret(); |
669 __ bind(&slow); | 662 __ bind(&slow); |
670 GenerateMiss(masm); | 663 GenerateMiss(masm); |
671 } | 664 } |
672 | 665 |
673 | 666 |
674 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { | 667 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 __ j(above_equal, &extra); | 923 __ j(above_equal, &extra); |
931 | 924 |
932 KeyedStoreGenerateGenericHelper(masm, &fast_object, &fast_double, | 925 KeyedStoreGenerateGenericHelper(masm, &fast_object, &fast_double, |
933 &slow, kCheckMap, kDontIncrementLength); | 926 &slow, kCheckMap, kDontIncrementLength); |
934 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, | 927 KeyedStoreGenerateGenericHelper(masm, &fast_object_grow, &fast_double_grow, |
935 &slow, kDontCheckMap, kIncrementLength); | 928 &slow, kDontCheckMap, kIncrementLength); |
936 } | 929 } |
937 | 930 |
938 | 931 |
939 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 932 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
940 // ----------- S t a t e ------------- | 933 // The return address is on the stack. |
941 // -- ecx : name | 934 Register receiver = ReceiverRegister(); |
942 // -- edx : receiver | 935 Register name = NameRegister(); |
943 // -- esp[0] : return address | 936 ASSERT(receiver.is(edx)); |
944 // ----------------------------------- | 937 ASSERT(name.is(ecx)); |
945 ASSERT(edx.is(ReceiverRegister())); | |
946 ASSERT(ecx.is(NameRegister())); | |
947 | 938 |
948 // Probe the stub cache. | 939 // Probe the stub cache. |
949 Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); | 940 Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC); |
950 masm->isolate()->stub_cache()->GenerateProbe( | 941 masm->isolate()->stub_cache()->GenerateProbe( |
951 masm, flags, edx, ecx, ebx, eax); | 942 masm, flags, receiver, name, ebx, eax); |
952 | 943 |
953 // Cache miss: Jump to runtime. | 944 // Cache miss: Jump to runtime. |
954 GenerateMiss(masm); | 945 GenerateMiss(masm); |
955 } | 946 } |
956 | 947 |
957 | 948 |
958 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 949 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
959 // ----------- S t a t e ------------- | 950 // ----------- S t a t e ------------- |
960 // -- ecx : name | 951 // -- ecx : name |
961 // -- edx : receiver | 952 // -- edx : receiver |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); | 1016 ExternalReference(IC_Utility(kKeyedLoadIC_Miss), masm->isolate()); |
1026 __ TailCallExternalReference(ref, 2, 1); | 1017 __ TailCallExternalReference(ref, 2, 1); |
1027 } | 1018 } |
1028 | 1019 |
1029 | 1020 |
1030 // IC register specifications | 1021 // IC register specifications |
1031 const Register LoadIC::ReceiverRegister() { return edx; } | 1022 const Register LoadIC::ReceiverRegister() { return edx; } |
1032 const Register LoadIC::NameRegister() { return ecx; } | 1023 const Register LoadIC::NameRegister() { return ecx; } |
1033 | 1024 |
1034 | 1025 |
1035 const Register KeyedLoadIC::ReceiverRegister() { | |
1036 return LoadIC::ReceiverRegister(); | |
1037 } | |
1038 | |
1039 | |
1040 const Register KeyedLoadIC::NameRegister() { return LoadIC::NameRegister(); } | |
1041 | |
1042 | |
1043 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 1026 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
1044 // Return address is on the stack. | 1027 // Return address is on the stack. |
1045 __ pop(KeyedLoadIC_TempRegister()); | 1028 __ pop(KeyedLoadIC_TempRegister()); |
1046 __ push(ReceiverRegister()); // receiver | 1029 __ push(ReceiverRegister()); // receiver |
1047 __ push(NameRegister()); // name | 1030 __ push(NameRegister()); // name |
1048 __ push(KeyedLoadIC_TempRegister()); // return address | 1031 __ push(KeyedLoadIC_TempRegister()); // return address |
1049 | 1032 |
1050 // Perform tail call to the entry. | 1033 // Perform tail call to the entry. |
1051 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); | 1034 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
1052 } | 1035 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1274 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1292 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1275 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1293 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1276 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1294 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1277 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1295 } | 1278 } |
1296 | 1279 |
1297 | 1280 |
1298 } } // namespace v8::internal | 1281 } } // namespace v8::internal |
1299 | 1282 |
1300 #endif // V8_TARGET_ARCH_IA32 | 1283 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |