OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // Fall through to slow case. | 567 // Fall through to slow case. |
568 | 568 |
569 // Slow case: Load name and receiver from stack and jump to runtime. | 569 // Slow case: Load name and receiver from stack and jump to runtime. |
570 __ bind(&slow); | 570 __ bind(&slow); |
571 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); | 571 __ IncrementCounter(&Counters::keyed_load_external_array_slow, 1); |
572 GenerateRuntimeGetProperty(masm); | 572 GenerateRuntimeGetProperty(masm); |
573 } | 573 } |
574 | 574 |
575 | 575 |
576 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { | 576 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) { |
577 GenerateGeneric(masm); | 577 // ----------- S t a t e ------------- |
| 578 // -- rsp[0] : return address |
| 579 // -- rsp[8] : key |
| 580 // -- rsp[16] : receiver |
| 581 // ----------------------------------- |
| 582 Label slow; |
| 583 |
| 584 // Load key and receiver. |
| 585 __ movq(rax, Operand(rsp, kPointerSize)); |
| 586 __ movq(rcx, Operand(rsp, 2 * kPointerSize)); |
| 587 |
| 588 // Check that the receiver isn't a smi. |
| 589 __ JumpIfSmi(rcx, &slow); |
| 590 |
| 591 // Check that the key is a smi. |
| 592 __ JumpIfNotSmi(rax, &slow); |
| 593 |
| 594 // Get the map of the receiver. |
| 595 __ movq(rdx, FieldOperand(rcx, HeapObject::kMapOffset)); |
| 596 |
| 597 // Check that it has indexed interceptor and access checks |
| 598 // are not enabled for this object. |
| 599 __ movb(rdx, FieldOperand(rdx, Map::kBitFieldOffset)); |
| 600 __ andb(rdx, Immediate(kSlowCaseBitFieldMask)); |
| 601 __ cmpb(rdx, Immediate(1 << Map::kHasIndexedInterceptor)); |
| 602 __ j(not_zero, &slow); |
| 603 |
| 604 // Everything is fine, call runtime. |
| 605 __ pop(rdx); |
| 606 __ push(rcx); // receiver |
| 607 __ push(rax); // key |
| 608 __ push(rdx); // return address |
| 609 |
| 610 // Perform tail call to the entry. |
| 611 __ TailCallRuntime(ExternalReference( |
| 612 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); |
| 613 |
| 614 __ bind(&slow); |
| 615 GenerateMiss(masm); |
578 } | 616 } |
579 | 617 |
580 | 618 |
581 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 619 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
582 // ----------- S t a t e ------------- | 620 // ----------- S t a t e ------------- |
583 // -- rax : value | 621 // -- rax : value |
584 // -- rsp[0] : return address | 622 // -- rsp[0] : return address |
585 // -- rsp[8] : key | 623 // -- rsp[8] : key |
586 // -- rsp[16] : receiver | 624 // -- rsp[16] : receiver |
587 // ----------------------------------- | 625 // ----------------------------------- |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 | 1405 |
1368 // Cache miss: Jump to runtime. | 1406 // Cache miss: Jump to runtime. |
1369 GenerateMiss(masm); | 1407 GenerateMiss(masm); |
1370 } | 1408 } |
1371 | 1409 |
1372 | 1410 |
1373 #undef __ | 1411 #undef __ |
1374 | 1412 |
1375 | 1413 |
1376 } } // namespace v8::internal | 1414 } } // namespace v8::internal |
OLD | NEW |