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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 // Compute the target address = code_obj + header_size + osr_offset | 959 // Compute the target address = code_obj + header_size + osr_offset |
960 // <entry_addr> = <code_obj> + #header_size + <osr_offset> | 960 // <entry_addr> = <code_obj> + #header_size + <osr_offset> |
961 __ addu(v0, v0, a1); | 961 __ addu(v0, v0, a1); |
962 __ addiu(ra, v0, Code::kHeaderSize - kHeapObjectTag); | 962 __ addiu(ra, v0, Code::kHeaderSize - kHeapObjectTag); |
963 | 963 |
964 // And "return" to the OSR entry point of the function. | 964 // And "return" to the OSR entry point of the function. |
965 __ Ret(); | 965 __ Ret(); |
966 } | 966 } |
967 | 967 |
968 | 968 |
| 969 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
| 970 // We check the stack limit as indicator that recompilation might be done. |
| 971 Label ok; |
| 972 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
| 973 __ Branch(&ok, hs, sp, Operand(at)); |
| 974 { |
| 975 FrameScope scope(masm, StackFrame::INTERNAL); |
| 976 __ CallRuntime(Runtime::kStackGuard, 0); |
| 977 } |
| 978 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
| 979 RelocInfo::CODE_TARGET); |
| 980 |
| 981 __ bind(&ok); |
| 982 __ Ret(); |
| 983 } |
| 984 |
| 985 |
969 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 986 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
970 // 1. Make sure we have at least one argument. | 987 // 1. Make sure we have at least one argument. |
971 // a0: actual number of arguments | 988 // a0: actual number of arguments |
972 { Label done; | 989 { Label done; |
973 __ Branch(&done, ne, a0, Operand(zero_reg)); | 990 __ Branch(&done, ne, a0, Operand(zero_reg)); |
974 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex); | 991 __ LoadRoot(t2, Heap::kUndefinedValueRootIndex); |
975 __ push(t2); | 992 __ push(t2); |
976 __ Addu(a0, a0, Operand(1)); | 993 __ Addu(a0, a0, Operand(1)); |
977 __ bind(&done); | 994 __ bind(&done); |
978 } | 995 } |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 __ bind(&dont_adapt_arguments); | 1474 __ bind(&dont_adapt_arguments); |
1458 __ Jump(a3); | 1475 __ Jump(a3); |
1459 } | 1476 } |
1460 | 1477 |
1461 | 1478 |
1462 #undef __ | 1479 #undef __ |
1463 | 1480 |
1464 } } // namespace v8::internal | 1481 } } // namespace v8::internal |
1465 | 1482 |
1466 #endif // V8_TARGET_ARCH_MIPS | 1483 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |