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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 // If the code object is null, just return to the unoptimized code. | 955 // If the code object is null, just return to the unoptimized code. |
956 Label skip; | 956 Label skip; |
957 __ cmp(r0, Operand(Smi::FromInt(0))); | 957 __ cmp(r0, Operand(Smi::FromInt(0))); |
958 __ b(ne, &skip); | 958 __ b(ne, &skip); |
959 __ Ret(); | 959 __ Ret(); |
960 | 960 |
961 __ bind(&skip); | 961 __ bind(&skip); |
962 | 962 |
963 // Load deoptimization data from the code object. | 963 // Load deoptimization data from the code object. |
964 // <deopt_data> = <code>[#deoptimization_data_offset] | 964 // <deopt_data> = <code>[#deoptimization_data_offset] |
965 __ ldr(r1, FieldMemOperand(r0, Code::kDeoptimizationDataOffset)); | 965 __ ldr(r1, MemOperand(r0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); |
966 | 966 |
967 { ConstantPoolUnavailableScope constant_pool_unavailable(masm); | 967 // Load the OSR entrypoint offset from the deoptimization data. |
968 if (FLAG_enable_ool_constant_pool) { | 968 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] |
969 __ ldr(pp, FieldMemOperand(r0, Code::kConstantPoolOffset)); | 969 __ ldr(r1, MemOperand(r1, FixedArray::OffsetOfElementAt( |
970 } | 970 DeoptimizationInputData::kOsrPcOffsetIndex) - kHeapObjectTag)); |
971 | 971 |
972 // Load the OSR entrypoint offset from the deoptimization data. | 972 // Compute the target address = code_obj + header_size + osr_offset |
973 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] | 973 // <entry_addr> = <code_obj> + #header_size + <osr_offset> |
974 __ ldr(r1, FieldMemOperand(r1, FixedArray::OffsetOfElementAt( | 974 __ add(r0, r0, Operand::SmiUntag(r1)); |
975 DeoptimizationInputData::kOsrPcOffsetIndex))); | 975 __ add(lr, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
976 | 976 |
977 // Compute the target address = code_obj + header_size + osr_offset | 977 // And "return" to the OSR entry point of the function. |
978 // <entry_addr> = <code_obj> + #header_size + <osr_offset> | 978 __ Ret(); |
979 __ add(r0, r0, Operand::SmiUntag(r1)); | |
980 __ add(lr, r0, Operand(Code::kHeaderSize - kHeapObjectTag)); | |
981 | |
982 // And "return" to the OSR entry point of the function. | |
983 __ Ret(); | |
984 } | |
985 } | 979 } |
986 | 980 |
987 | 981 |
988 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | 982 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
989 // We check the stack limit as indicator that recompilation might be done. | 983 // We check the stack limit as indicator that recompilation might be done. |
990 Label ok; | 984 Label ok; |
991 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 985 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
992 __ cmp(sp, Operand(ip)); | 986 __ cmp(sp, Operand(ip)); |
993 __ b(hs, &ok); | 987 __ b(hs, &ok); |
994 { | 988 { |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 __ bind(&dont_adapt_arguments); | 1473 __ bind(&dont_adapt_arguments); |
1480 __ Jump(r3); | 1474 __ Jump(r3); |
1481 } | 1475 } |
1482 | 1476 |
1483 | 1477 |
1484 #undef __ | 1478 #undef __ |
1485 | 1479 |
1486 } } // namespace v8::internal | 1480 } } // namespace v8::internal |
1487 | 1481 |
1488 #endif // V8_TARGET_ARCH_ARM | 1482 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |