| 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 878 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
| 879 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 879 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
| 880 } | 880 } |
| 881 | 881 |
| 882 | 882 |
| 883 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) { | 883 void Builtins::Generate_NotifySoftDeoptimized(MacroAssembler* masm) { |
| 884 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); | 884 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::SOFT); |
| 885 } | 885 } |
| 886 | 886 |
| 887 | 887 |
| 888 void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { | |
| 889 // For now, we are relying on the fact that Runtime::NotifyOSR | |
| 890 // doesn't do any garbage collection which allows us to save/restore | |
| 891 // the registers without worrying about which of them contain | |
| 892 // pointers. This seems a bit fragile. | |
| 893 // | |
| 894 // TODO(jochen): Is it correct (and appropriate) to use safepoint | |
| 895 // registers here? According to the comment above, we should only need to | |
| 896 // preserve the registers with parameters. | |
| 897 __ PushXRegList(kSafepointSavedRegisters); | |
| 898 { | |
| 899 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 900 __ CallRuntime(Runtime::kNotifyOSR, 0); | |
| 901 } | |
| 902 __ PopXRegList(kSafepointSavedRegisters); | |
| 903 __ Ret(); | |
| 904 } | |
| 905 | |
| 906 | |
| 907 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 888 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
| 908 // Lookup the function in the JavaScript frame. | 889 // Lookup the function in the JavaScript frame. |
| 909 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 890 __ Ldr(x0, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 910 { | 891 { |
| 911 FrameScope scope(masm, StackFrame::INTERNAL); | 892 FrameScope scope(masm, StackFrame::INTERNAL); |
| 912 // Lookup and calculate pc offset. | 893 // Lookup and calculate pc offset. |
| 913 __ Ldr(x1, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); | 894 __ Ldr(x1, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); |
| 914 __ Ldr(x2, FieldMemOperand(x0, JSFunction::kSharedFunctionInfoOffset)); | 895 __ Ldr(x2, FieldMemOperand(x0, JSFunction::kSharedFunctionInfoOffset)); |
| 915 __ Ldr(x2, FieldMemOperand(x2, SharedFunctionInfo::kCodeOffset)); | 896 __ Ldr(x2, FieldMemOperand(x2, SharedFunctionInfo::kCodeOffset)); |
| 916 __ Sub(x1, x1, Code::kHeaderSize - kHeapObjectTag); | 897 __ Sub(x1, x1, Code::kHeaderSize - kHeapObjectTag); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 941 // Compute the target address = code_obj + header_size + osr_offset | 922 // Compute the target address = code_obj + header_size + osr_offset |
| 942 // <entry_addr> = <code_obj> + #header_size + <osr_offset> | 923 // <entry_addr> = <code_obj> + #header_size + <osr_offset> |
| 943 __ Add(x0, x0, x1); | 924 __ Add(x0, x0, x1); |
| 944 __ Add(lr, x0, Code::kHeaderSize - kHeapObjectTag); | 925 __ Add(lr, x0, Code::kHeaderSize - kHeapObjectTag); |
| 945 | 926 |
| 946 // And "return" to the OSR entry point of the function. | 927 // And "return" to the OSR entry point of the function. |
| 947 __ Ret(); | 928 __ Ret(); |
| 948 } | 929 } |
| 949 | 930 |
| 950 | 931 |
| 932 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
| 933 // We check the stack limit as indicator that recompilation might be done. |
| 934 Label ok; |
| 935 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); |
| 936 __ B(hs, &ok); |
| 937 { |
| 938 FrameScope scope(masm, StackFrame::INTERNAL); |
| 939 __ CallRuntime(Runtime::kStackGuard, 0); |
| 940 } |
| 941 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
| 942 RelocInfo::CODE_TARGET); |
| 943 |
| 944 __ Bind(&ok); |
| 945 __ Ret(); |
| 946 } |
| 947 |
| 948 |
| 951 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { | 949 void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
| 952 Register receiver_type = x13; | 950 Register receiver_type = x13; |
| 953 | 951 |
| 954 ASM_LOCATION("Builtins::Generate_FunctionCall"); | 952 ASM_LOCATION("Builtins::Generate_FunctionCall"); |
| 955 // TODO(all/rames): Optimize and use named registers. | 953 // TODO(all/rames): Optimize and use named registers. |
| 956 // 1. Make sure we have at least one argument. | 954 // 1. Make sure we have at least one argument. |
| 957 // x0: actual number of arguments | 955 // x0: actual number of arguments |
| 958 { Label done; | 956 { Label done; |
| 959 __ Cbnz(x0, &done); | 957 __ Cbnz(x0, &done); |
| 960 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); | 958 __ LoadRoot(x10, Heap::kUndefinedValueRootIndex); |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 __ Bind(&dont_adapt_arguments); | 1436 __ Bind(&dont_adapt_arguments); |
| 1439 __ Jump(x3); | 1437 __ Jump(x3); |
| 1440 } | 1438 } |
| 1441 | 1439 |
| 1442 | 1440 |
| 1443 #undef __ | 1441 #undef __ |
| 1444 | 1442 |
| 1445 } } // namespace v8::internal | 1443 } } // namespace v8::internal |
| 1446 | 1444 |
| 1447 #endif // V8_TARGET_ARCH_ARM | 1445 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |