OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 __ fincstp(); | 583 __ fincstp(); |
584 // Fall through to slow case. | 584 // Fall through to slow case. |
585 | 585 |
586 // Slow case: Load name and receiver from stack and jump to runtime. | 586 // Slow case: Load name and receiver from stack and jump to runtime. |
587 __ bind(&slow); | 587 __ bind(&slow); |
588 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); | 588 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); |
589 GenerateRuntimeGetProperty(masm); | 589 GenerateRuntimeGetProperty(masm); |
590 } | 590 } |
591 | 591 |
592 | 592 |
| 593 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
| 594 // ----------- S t a t e ------------- |
| 595 // -- eax : value |
| 596 // -- esp[0] : return address |
| 597 // -- esp[4] : key |
| 598 // -- esp[8] : receiver |
| 599 // ----------------------------------- |
| 600 Label slow; |
| 601 |
| 602 // Load key and receiver. |
| 603 __ mov(eax, Operand(esp, kPointerSize)); |
| 604 __ mov(ecx, Operand(esp, 2 * kPointerSize)); |
| 605 |
| 606 // Check that the receiver isn't a smi. |
| 607 __ test(ecx, Immediate(kSmiTagMask)); |
| 608 __ j(zero, &slow, not_taken); |
| 609 |
| 610 // Check that the key is a smi. |
| 611 __ test(eax, Immediate(kSmiTagMask)); |
| 612 __ j(not_zero, &slow, not_taken); |
| 613 |
| 614 // Get the map of the receiver. |
| 615 __ mov(edx, FieldOperand(ecx, HeapObject::kMapOffset)); |
| 616 |
| 617 // Check that it has indexed interceptor and access checks |
| 618 // are not enabled for this object. |
| 619 __ movzx_b(edx, FieldOperand(edx, Map::kBitFieldOffset)); |
| 620 __ and_(Operand(edx), Immediate(kSlowCaseBitFieldMask)); |
| 621 __ cmp(Operand(edx), Immediate(1 << Map::kHasIndexedInterceptor)); |
| 622 __ j(not_zero, &slow, not_taken); |
| 623 |
| 624 // Everything is fine, call runtime. |
| 625 __ pop(edx); |
| 626 __ push(ecx); // receiver |
| 627 __ push(eax); // key |
| 628 __ push(edx); // return address |
| 629 |
| 630 // Perform tail call to the entry. |
| 631 __ TailCallRuntime(ExternalReference( |
| 632 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); |
| 633 |
| 634 __ bind(&slow); |
| 635 GenerateMiss(masm); |
| 636 } |
| 637 |
| 638 |
593 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { | 639 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { |
594 // ----------- S t a t e ------------- | 640 // ----------- S t a t e ------------- |
595 // -- eax : value | 641 // -- eax : value |
596 // -- esp[0] : return address | 642 // -- esp[0] : return address |
597 // -- esp[4] : key | 643 // -- esp[4] : key |
598 // -- esp[8] : receiver | 644 // -- esp[8] : receiver |
599 // ----------------------------------- | 645 // ----------------------------------- |
600 Label slow, fast, array, extra, check_pixel_array; | 646 Label slow, fast, array, extra, check_pixel_array; |
601 | 647 |
602 // Get the receiver from the stack. | 648 // Get the receiver from the stack. |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 __ push(ecx); | 1487 __ push(ecx); |
1442 | 1488 |
1443 // Do tail-call to runtime routine. | 1489 // Do tail-call to runtime routine. |
1444 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); | 1490 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); |
1445 } | 1491 } |
1446 | 1492 |
1447 #undef __ | 1493 #undef __ |
1448 | 1494 |
1449 | 1495 |
1450 } } // namespace v8::internal | 1496 } } // namespace v8::internal |
OLD | NEW |