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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 // ----------------------------------- | 419 // ----------------------------------- |
420 Label number, non_number, non_string, boolean, probe, miss; | 420 Label number, non_number, non_string, boolean, probe, miss; |
421 | 421 |
422 // Get the receiver of the function from the stack; 1 ~ return address. | 422 // Get the receiver of the function from the stack; 1 ~ return address. |
423 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 423 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
424 // Get the name of the function from the stack; 2 ~ return address, receiver | 424 // Get the name of the function from the stack; 2 ~ return address, receiver |
425 __ mov(ecx, Operand(esp, (argc + 2) * kPointerSize)); | 425 __ mov(ecx, Operand(esp, (argc + 2) * kPointerSize)); |
426 | 426 |
427 // Probe the stub cache. | 427 // Probe the stub cache. |
428 Code::Flags flags = | 428 Code::Flags flags = |
429 Code::ComputeFlags(Code::CALL_IC, MONOMORPHIC, NORMAL, argc); | 429 Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc); |
430 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); | 430 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); |
431 | 431 |
432 // If the stub cache probing failed, the receiver might be a value. | 432 // If the stub cache probing failed, the receiver might be a value. |
433 // For value objects, we use the map of the prototype objects for | 433 // For value objects, we use the map of the prototype objects for |
434 // the corresponding JSValue for the cache and that is what we need | 434 // the corresponding JSValue for the cache and that is what we need |
435 // to probe. | 435 // to probe. |
436 // | 436 // |
437 // Check for number. | 437 // Check for number. |
438 __ test(edx, Immediate(kSmiTagMask)); | 438 __ test(edx, Immediate(kSmiTagMask)); |
439 __ j(zero, &number, not_taken); | 439 __ j(zero, &number, not_taken); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 628 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
629 // ----------- S t a t e ------------- | 629 // ----------- S t a t e ------------- |
630 // -- ecx : name | 630 // -- ecx : name |
631 // -- esp[0] : return address | 631 // -- esp[0] : return address |
632 // -- esp[4] : receiver | 632 // -- esp[4] : receiver |
633 // ----------------------------------- | 633 // ----------------------------------- |
634 | 634 |
635 __ mov(eax, Operand(esp, kPointerSize)); | 635 __ mov(eax, Operand(esp, kPointerSize)); |
636 | 636 |
637 // Probe the stub cache. | 637 // Probe the stub cache. |
638 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, MONOMORPHIC); | 638 Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC, |
| 639 NOT_IN_LOOP, |
| 640 MONOMORPHIC); |
639 StubCache::GenerateProbe(masm, flags, eax, ecx, ebx); | 641 StubCache::GenerateProbe(masm, flags, eax, ecx, ebx); |
640 | 642 |
641 // Cache miss: Jump to runtime. | 643 // Cache miss: Jump to runtime. |
642 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 644 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
643 } | 645 } |
644 | 646 |
645 | 647 |
646 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 648 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
647 // ----------- S t a t e ------------- | 649 // ----------- S t a t e ------------- |
648 // -- ecx : name | 650 // -- ecx : name |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 833 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
832 // ----------- S t a t e ------------- | 834 // ----------- S t a t e ------------- |
833 // -- eax : value | 835 // -- eax : value |
834 // -- ecx : name | 836 // -- ecx : name |
835 // -- esp[0] : return address | 837 // -- esp[0] : return address |
836 // -- esp[4] : receiver | 838 // -- esp[4] : receiver |
837 // ----------------------------------- | 839 // ----------------------------------- |
838 | 840 |
839 // Get the receiver from the stack and probe the stub cache. | 841 // Get the receiver from the stack and probe the stub cache. |
840 __ mov(edx, Operand(esp, 4)); | 842 __ mov(edx, Operand(esp, 4)); |
841 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, MONOMORPHIC); | 843 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, |
| 844 NOT_IN_LOOP, |
| 845 MONOMORPHIC); |
842 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); | 846 StubCache::GenerateProbe(masm, flags, edx, ecx, ebx); |
843 | 847 |
844 // Cache miss: Jump to runtime. | 848 // Cache miss: Jump to runtime. |
845 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 849 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
846 } | 850 } |
847 | 851 |
848 | 852 |
849 void StoreIC::GenerateExtendStorage(MacroAssembler* masm) { | 853 void StoreIC::GenerateExtendStorage(MacroAssembler* masm) { |
850 // ----------- S t a t e ------------- | 854 // ----------- S t a t e ------------- |
851 // -- eax : value | 855 // -- eax : value |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 | 931 |
928 // Do tail-call to runtime routine. | 932 // Do tail-call to runtime routine. |
929 __ TailCallRuntime( | 933 __ TailCallRuntime( |
930 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 934 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
931 } | 935 } |
932 | 936 |
933 #undef __ | 937 #undef __ |
934 | 938 |
935 | 939 |
936 } } // namespace v8::internal | 940 } } // namespace v8::internal |
OLD | NEW |