OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 // The following caller-saved registers must be saved and restored when | 854 // The following caller-saved registers must be saved and restored when |
855 // calling through to the runtime: | 855 // calling through to the runtime: |
856 // x0 - The address from which to resume execution. | 856 // x0 - The address from which to resume execution. |
857 // x1 - isolate | 857 // x1 - isolate |
858 // lr - The return address for the JSFunction itself. It has not yet been | 858 // lr - The return address for the JSFunction itself. It has not yet been |
859 // preserved on the stack because the frame setup code was replaced | 859 // preserved on the stack because the frame setup code was replaced |
860 // with a call to this stub, to handle code ageing. | 860 // with a call to this stub, to handle code ageing. |
861 { | 861 { |
862 FrameScope scope(masm, StackFrame::MANUAL); | 862 FrameScope scope(masm, StackFrame::MANUAL); |
863 __ Push(x0, x1, fp, lr); | 863 __ Push(x0, x1, fp, lr); |
864 __ Mov(x1, Operand(ExternalReference::isolate_address(masm->isolate()))); | 864 __ Mov(x1, ExternalReference::isolate_address(masm->isolate())); |
865 __ CallCFunction( | 865 __ CallCFunction( |
866 ExternalReference::get_make_code_young_function(masm->isolate()), 2); | 866 ExternalReference::get_make_code_young_function(masm->isolate()), 2); |
867 __ Pop(lr, fp, x1, x0); | 867 __ Pop(lr, fp, x1, x0); |
868 } | 868 } |
869 | 869 |
870 // The calling function has been made young again, so return to execute the | 870 // The calling function has been made young again, so return to execute the |
871 // real frame set-up code. | 871 // real frame set-up code. |
872 __ Br(x0); | 872 __ Br(x0); |
873 } | 873 } |
874 | 874 |
(...skipping 19 matching lines...) Expand all Loading... |
894 // The following caller-saved registers must be saved and restored when | 894 // The following caller-saved registers must be saved and restored when |
895 // calling through to the runtime: | 895 // calling through to the runtime: |
896 // x0 - The address from which to resume execution. | 896 // x0 - The address from which to resume execution. |
897 // x1 - isolate | 897 // x1 - isolate |
898 // lr - The return address for the JSFunction itself. It has not yet been | 898 // lr - The return address for the JSFunction itself. It has not yet been |
899 // preserved on the stack because the frame setup code was replaced | 899 // preserved on the stack because the frame setup code was replaced |
900 // with a call to this stub, to handle code ageing. | 900 // with a call to this stub, to handle code ageing. |
901 { | 901 { |
902 FrameScope scope(masm, StackFrame::MANUAL); | 902 FrameScope scope(masm, StackFrame::MANUAL); |
903 __ Push(x0, x1, fp, lr); | 903 __ Push(x0, x1, fp, lr); |
904 __ Mov(x1, Operand(ExternalReference::isolate_address(masm->isolate()))); | 904 __ Mov(x1, ExternalReference::isolate_address(masm->isolate())); |
905 __ CallCFunction( | 905 __ CallCFunction( |
906 ExternalReference::get_mark_code_as_executed_function( | 906 ExternalReference::get_mark_code_as_executed_function( |
907 masm->isolate()), 2); | 907 masm->isolate()), 2); |
908 __ Pop(lr, fp, x1, x0); | 908 __ Pop(lr, fp, x1, x0); |
909 | 909 |
910 // Perform prologue operations usually performed by the young code stub. | 910 // Perform prologue operations usually performed by the young code stub. |
911 __ EmitFrameSetupForCodeAgePatching(masm); | 911 __ EmitFrameSetupForCodeAgePatching(masm); |
912 } | 912 } |
913 | 913 |
914 // Jump to point after the code-age stub. | 914 // Jump to point after the code-age stub. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { | 956 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
957 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); | 957 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
958 } | 958 } |
959 | 959 |
960 | 960 |
961 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 961 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
962 Deoptimizer::BailoutType type) { | 962 Deoptimizer::BailoutType type) { |
963 { | 963 { |
964 FrameScope scope(masm, StackFrame::INTERNAL); | 964 FrameScope scope(masm, StackFrame::INTERNAL); |
965 // Pass the deoptimization type to the runtime system. | 965 // Pass the deoptimization type to the runtime system. |
966 __ Mov(x0, Operand(Smi::FromInt(static_cast<int>(type)))); | 966 __ Mov(x0, Smi::FromInt(static_cast<int>(type))); |
967 __ Push(x0); | 967 __ Push(x0); |
968 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 968 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
969 } | 969 } |
970 | 970 |
971 // Get the full codegen state from the stack and untag it. | 971 // Get the full codegen state from the stack and untag it. |
972 Register state = x6; | 972 Register state = x6; |
973 __ Peek(state, 0); | 973 __ Peek(state, 0); |
974 __ SmiUntag(state); | 974 __ SmiUntag(state); |
975 | 975 |
976 // Switch on the state. | 976 // Switch on the state. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1012 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1013 { | 1013 { |
1014 FrameScope scope(masm, StackFrame::INTERNAL); | 1014 FrameScope scope(masm, StackFrame::INTERNAL); |
1015 // Pass function as argument. | 1015 // Pass function as argument. |
1016 __ Push(x0); | 1016 __ Push(x0); |
1017 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); | 1017 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
1018 } | 1018 } |
1019 | 1019 |
1020 // If the code object is null, just return to the unoptimized code. | 1020 // If the code object is null, just return to the unoptimized code. |
1021 Label skip; | 1021 Label skip; |
1022 __ CompareAndBranch(x0, Operand(Smi::FromInt(0)), ne, &skip); | 1022 __ CompareAndBranch(x0, Smi::FromInt(0), ne, &skip); |
1023 __ Ret(); | 1023 __ Ret(); |
1024 | 1024 |
1025 __ Bind(&skip); | 1025 __ Bind(&skip); |
1026 | 1026 |
1027 // Load deoptimization data from the code object. | 1027 // Load deoptimization data from the code object. |
1028 // <deopt_data> = <code>[#deoptimization_data_offset] | 1028 // <deopt_data> = <code>[#deoptimization_data_offset] |
1029 __ Ldr(x1, MemOperand(x0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); | 1029 __ Ldr(x1, MemOperand(x0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); |
1030 | 1030 |
1031 // Load the OSR entrypoint offset from the deoptimization data. | 1031 // Load the OSR entrypoint offset from the deoptimization data. |
1032 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] | 1032 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 | 1351 |
1352 __ Ldr(x1, MemOperand(fp, kArgsOffset)); | 1352 __ Ldr(x1, MemOperand(fp, kArgsOffset)); |
1353 __ Push(x1, current); | 1353 __ Push(x1, current); |
1354 | 1354 |
1355 // Call the runtime to access the property in the arguments array. | 1355 // Call the runtime to access the property in the arguments array. |
1356 __ CallRuntime(Runtime::kGetProperty, 2); | 1356 __ CallRuntime(Runtime::kGetProperty, 2); |
1357 __ Push(x0); | 1357 __ Push(x0); |
1358 | 1358 |
1359 // Use inline caching to access the arguments. | 1359 // Use inline caching to access the arguments. |
1360 __ Ldr(current, MemOperand(fp, kIndexOffset)); | 1360 __ Ldr(current, MemOperand(fp, kIndexOffset)); |
1361 __ Add(current, current, Operand(Smi::FromInt(1))); | 1361 __ Add(current, current, Smi::FromInt(1)); |
1362 __ Str(current, MemOperand(fp, kIndexOffset)); | 1362 __ Str(current, MemOperand(fp, kIndexOffset)); |
1363 | 1363 |
1364 // Test if the copy loop has finished copying all the elements from the | 1364 // Test if the copy loop has finished copying all the elements from the |
1365 // arguments object. | 1365 // arguments object. |
1366 __ Bind(&entry); | 1366 __ Bind(&entry); |
1367 __ Ldr(x1, MemOperand(fp, kLimitOffset)); | 1367 __ Ldr(x1, MemOperand(fp, kLimitOffset)); |
1368 __ Cmp(current, x1); | 1368 __ Cmp(current, x1); |
1369 __ B(ne, &loop); | 1369 __ B(ne, &loop); |
1370 | 1370 |
1371 // At the end of the loop, the number of arguments is stored in 'current', | 1371 // At the end of the loop, the number of arguments is stored in 'current', |
(...skipping 23 matching lines...) Expand all Loading... |
1395 __ Call(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), | 1395 __ Call(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
1396 RelocInfo::CODE_TARGET); | 1396 RelocInfo::CODE_TARGET); |
1397 } | 1397 } |
1398 __ Drop(3); | 1398 __ Drop(3); |
1399 __ Ret(); | 1399 __ Ret(); |
1400 } | 1400 } |
1401 | 1401 |
1402 | 1402 |
1403 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1403 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
1404 __ SmiTag(x10, x0); | 1404 __ SmiTag(x10, x0); |
1405 __ Mov(x11, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1405 __ Mov(x11, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
1406 __ Push(lr, fp); | 1406 __ Push(lr, fp); |
1407 __ Push(x11, x1, x10); | 1407 __ Push(x11, x1, x10); |
1408 __ Add(fp, jssp, | 1408 __ Add(fp, jssp, |
1409 StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize); | 1409 StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize); |
1410 } | 1410 } |
1411 | 1411 |
1412 | 1412 |
1413 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { | 1413 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
1414 // ----------- S t a t e ------------- | 1414 // ----------- S t a t e ------------- |
1415 // -- x0 : result being passed through | 1415 // -- x0 : result being passed through |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 __ Bind(&dont_adapt_arguments); | 1553 __ Bind(&dont_adapt_arguments); |
1554 __ Jump(code_entry); | 1554 __ Jump(code_entry); |
1555 } | 1555 } |
1556 | 1556 |
1557 | 1557 |
1558 #undef __ | 1558 #undef __ |
1559 | 1559 |
1560 } } // namespace v8::internal | 1560 } } // namespace v8::internal |
1561 | 1561 |
1562 #endif // V8_TARGET_ARCH_ARM | 1562 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |