| 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 941 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
| 942 // Lookup the function in the JavaScript frame and push it as an | 942 // Lookup the function in the JavaScript frame and push it as an |
| 943 // argument to the on-stack replacement function. | 943 // argument to the on-stack replacement function. |
| 944 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 944 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 945 { | 945 { |
| 946 FrameScope scope(masm, StackFrame::INTERNAL); | 946 FrameScope scope(masm, StackFrame::INTERNAL); |
| 947 __ Push(x0); | 947 __ Push(x0); |
| 948 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); | 948 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| 949 } | 949 } |
| 950 | 950 |
| 951 // If the result was -1 it means that we couldn't optimize the | 951 // If the code object is null, just return to the unoptimized code. |
| 952 // function. Just return and continue in the unoptimized version. | |
| 953 Label skip; | 952 Label skip; |
| 954 __ Cmp(x0, Operand(Smi::FromInt(-1))); | 953 __ CompareAndBranch(x0, Operand(Smi::FromInt(0)), ne, &skip); |
| 955 __ B(ne, &skip); | |
| 956 __ Ret(); | 954 __ Ret(); |
| 957 | 955 |
| 958 __ Bind(&skip); | 956 __ Bind(&skip); |
| 959 // Untag the AST id and push it on the stack. | |
| 960 __ SmiUntag(x0); | |
| 961 __ Push(x0); | |
| 962 | 957 |
| 963 // Generate the code for doing the frame-to-frame translation using | 958 // Load deoptimization data from the code object. |
| 964 // the deoptimizer infrastructure. | 959 // <deopt_data> = <code>[#deoptimization_data_offset] |
| 965 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 960 __ Ldr(x1, MemOperand(x0, Code::kDeoptimizationDataOffset - kHeapObjectTag)); |
| 966 generator.Generate(); | 961 |
| 962 // Load the OSR entrypoint offset from the deoptimization data. |
| 963 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] |
| 964 __ Ldrsw(w1, UntagSmiFieldMemOperand(x1, FixedArray::OffsetOfElementAt( |
| 965 DeoptimizationInputData::kOsrPcOffsetIndex))); |
| 966 |
| 967 // Compute the target address = code_obj + header_size + osr_offset |
| 968 // <entry_addr> = <code_obj> + #header_size + <osr_offset> |
| 969 __ Add(x0, x0, x1); |
| 970 __ Add(lr, x0, Code::kHeaderSize - kHeapObjectTag); |
| 971 |
| 972 // And "return" to the OSR entry point of the function. |
| 973 __ Ret(); |
| 967 } | 974 } |
| 968 | 975 |
| 969 | 976 |
| 970 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 977 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
| 971 Register receiver_type = x13; | 978 Register receiver_type = x13; |
| 972 | 979 |
| 973 ASM_LOCATION("Builtins::Generate_FunctionCall"); | 980 ASM_LOCATION("Builtins::Generate_FunctionCall"); |
| 974 // TODO(all/rames): Optimize and use named registers. | 981 // TODO(all/rames): Optimize and use named registers. |
| 975 // 1. Make sure we have at least one argument. | 982 // 1. Make sure we have at least one argument. |
| 976 // x0: actual number of arguments | 983 // x0: actual number of arguments |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 __ Bind(&dont_adapt_arguments); | 1464 __ Bind(&dont_adapt_arguments); |
| 1458 __ Jump(x3); | 1465 __ Jump(x3); |
| 1459 } | 1466 } |
| 1460 | 1467 |
| 1461 | 1468 |
| 1462 #undef __ | 1469 #undef __ |
| 1463 | 1470 |
| 1464 } } // namespace v8::internal | 1471 } } // namespace v8::internal |
| 1465 | 1472 |
| 1466 #endif // V8_TARGET_ARCH_ARM | 1473 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |