OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 // rdx : receiver | 815 // rdx : receiver |
816 // ----------------------------------- | 816 // ----------------------------------- |
817 Label number, non_number, non_string, boolean, probe, miss; | 817 Label number, non_number, non_string, boolean, probe, miss; |
818 | 818 |
819 // Probe the stub cache. | 819 // Probe the stub cache. |
820 Code::Flags flags = Code::ComputeFlags(kind, | 820 Code::Flags flags = Code::ComputeFlags(kind, |
821 MONOMORPHIC, | 821 MONOMORPHIC, |
822 extra_state, | 822 extra_state, |
823 Code::NORMAL, | 823 Code::NORMAL, |
824 argc); | 824 argc); |
825 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, | 825 masm->isolate()->stub_cache()->GenerateProbe( |
826 rax); | 826 masm, flags, rdx, rcx, rbx, rax); |
827 | 827 |
828 // If the stub cache probing failed, the receiver might be a value. | 828 // If the stub cache probing failed, the receiver might be a value. |
829 // For value objects, we use the map of the prototype objects for | 829 // For value objects, we use the map of the prototype objects for |
830 // the corresponding JSValue for the cache and that is what we need | 830 // the corresponding JSValue for the cache and that is what we need |
831 // to probe. | 831 // to probe. |
832 // | 832 // |
833 // Check for number. | 833 // Check for number. |
834 __ JumpIfSmi(rdx, &number); | 834 __ JumpIfSmi(rdx, &number); |
835 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rbx); | 835 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rbx); |
836 __ j(not_equal, &non_number); | 836 __ j(not_equal, &non_number); |
(...skipping 15 matching lines...) Expand all Loading... |
852 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); | 852 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); |
853 __ j(equal, &boolean); | 853 __ j(equal, &boolean); |
854 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); | 854 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); |
855 __ j(not_equal, &miss); | 855 __ j(not_equal, &miss); |
856 __ bind(&boolean); | 856 __ bind(&boolean); |
857 StubCompiler::GenerateLoadGlobalFunctionPrototype( | 857 StubCompiler::GenerateLoadGlobalFunctionPrototype( |
858 masm, Context::BOOLEAN_FUNCTION_INDEX, rdx); | 858 masm, Context::BOOLEAN_FUNCTION_INDEX, rdx); |
859 | 859 |
860 // Probe the stub cache for the value object. | 860 // Probe the stub cache for the value object. |
861 __ bind(&probe); | 861 __ bind(&probe); |
862 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, | 862 masm->isolate()->stub_cache()->GenerateProbe( |
863 no_reg); | 863 masm, flags, rdx, rcx, rbx, no_reg); |
864 | 864 |
865 __ bind(&miss); | 865 __ bind(&miss); |
866 } | 866 } |
867 | 867 |
868 | 868 |
869 static void GenerateFunctionTailCall(MacroAssembler* masm, | 869 static void GenerateFunctionTailCall(MacroAssembler* masm, |
870 int argc, | 870 int argc, |
871 Label* miss) { | 871 Label* miss) { |
872 // ----------- S t a t e ------------- | 872 // ----------- S t a t e ------------- |
873 // rcx : function name | 873 // rcx : function name |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 // ----------- S t a t e ------------- | 1325 // ----------- S t a t e ------------- |
1326 // -- rax : receiver | 1326 // -- rax : receiver |
1327 // -- rcx : name | 1327 // -- rcx : name |
1328 // -- rsp[0] : return address | 1328 // -- rsp[0] : return address |
1329 // ----------------------------------- | 1329 // ----------------------------------- |
1330 | 1330 |
1331 // Probe the stub cache. | 1331 // Probe the stub cache. |
1332 Code::Flags flags = Code::ComputeFlags( | 1332 Code::Flags flags = Code::ComputeFlags( |
1333 Code::STUB, MONOMORPHIC, Code::kNoExtraICState, | 1333 Code::STUB, MONOMORPHIC, Code::kNoExtraICState, |
1334 Code::NORMAL, Code::LOAD_IC); | 1334 Code::NORMAL, Code::LOAD_IC); |
1335 Isolate::Current()->stub_cache()->GenerateProbe( | 1335 masm->isolate()->stub_cache()->GenerateProbe( |
1336 masm, flags, rax, rcx, rbx, rdx); | 1336 masm, flags, rax, rcx, rbx, rdx); |
1337 | 1337 |
1338 GenerateMiss(masm); | 1338 GenerateMiss(masm); |
1339 } | 1339 } |
1340 | 1340 |
1341 | 1341 |
1342 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 1342 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
1343 // ----------- S t a t e ------------- | 1343 // ----------- S t a t e ------------- |
1344 // -- rax : receiver | 1344 // -- rax : receiver |
1345 // -- rcx : name | 1345 // -- rcx : name |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 // -- rax : value | 1446 // -- rax : value |
1447 // -- rcx : name | 1447 // -- rcx : name |
1448 // -- rdx : receiver | 1448 // -- rdx : receiver |
1449 // -- rsp[0] : return address | 1449 // -- rsp[0] : return address |
1450 // ----------------------------------- | 1450 // ----------------------------------- |
1451 | 1451 |
1452 // Get the receiver from the stack and probe the stub cache. | 1452 // Get the receiver from the stack and probe the stub cache. |
1453 Code::Flags flags = Code::ComputeFlags( | 1453 Code::Flags flags = Code::ComputeFlags( |
1454 Code::STUB, MONOMORPHIC, strict_mode, | 1454 Code::STUB, MONOMORPHIC, strict_mode, |
1455 Code::NORMAL, Code::STORE_IC); | 1455 Code::NORMAL, Code::STORE_IC); |
1456 Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx, | 1456 masm->isolate()->stub_cache()->GenerateProbe( |
1457 no_reg); | 1457 masm, flags, rdx, rcx, rbx, no_reg); |
1458 | 1458 |
1459 // Cache miss: Jump to runtime. | 1459 // Cache miss: Jump to runtime. |
1460 GenerateMiss(masm); | 1460 GenerateMiss(masm); |
1461 } | 1461 } |
1462 | 1462 |
1463 | 1463 |
1464 void StoreIC::GenerateMiss(MacroAssembler* masm) { | 1464 void StoreIC::GenerateMiss(MacroAssembler* masm) { |
1465 // ----------- S t a t e ------------- | 1465 // ----------- S t a t e ------------- |
1466 // -- rax : value | 1466 // -- rax : value |
1467 // -- rcx : name | 1467 // -- rcx : name |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) | 1678 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) |
1679 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) | 1679 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) |
1680 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); | 1680 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); |
1681 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); | 1681 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); |
1682 } | 1682 } |
1683 | 1683 |
1684 | 1684 |
1685 } } // namespace v8::internal | 1685 } } // namespace v8::internal |
1686 | 1686 |
1687 #endif // V8_TARGET_ARCH_X64 | 1687 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |