| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 __ bne(&convert_argument, cr0); | 225 __ bne(&convert_argument, cr0); |
| 226 __ mr(argument, r3); | 226 __ mr(argument, r3); |
| 227 __ IncrementCounter(counters->string_ctor_conversions(), 1, r6, r7); | 227 __ IncrementCounter(counters->string_ctor_conversions(), 1, r6, r7); |
| 228 __ b(&argument_is_string); | 228 __ b(&argument_is_string); |
| 229 | 229 |
| 230 // Invoke the conversion builtin and put the result into r5. | 230 // Invoke the conversion builtin and put the result into r5. |
| 231 __ bind(&convert_argument); | 231 __ bind(&convert_argument); |
| 232 __ push(function); // Preserve the function. | 232 __ push(function); // Preserve the function. |
| 233 __ IncrementCounter(counters->string_ctor_conversions(), 1, r6, r7); | 233 __ IncrementCounter(counters->string_ctor_conversions(), 1, r6, r7); |
| 234 { | 234 { |
| 235 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 235 FrameScope scope(masm, StackFrame::INTERNAL); |
| 236 __ push(r3); | 236 __ push(r3); |
| 237 __ InvokeBuiltin(Builtins::TO_STRING, CALL_FUNCTION); | 237 __ InvokeBuiltin(Builtins::TO_STRING, CALL_FUNCTION); |
| 238 } | 238 } |
| 239 __ pop(function); | 239 __ pop(function); |
| 240 __ mr(argument, r3); | 240 __ mr(argument, r3); |
| 241 __ b(&argument_is_string); | 241 __ b(&argument_is_string); |
| 242 | 242 |
| 243 // Load the empty string into r5, remove the receiver from the | 243 // Load the empty string into r5, remove the receiver from the |
| 244 // stack, and jump back to the case where the argument is a string. | 244 // stack, and jump back to the case where the argument is a string. |
| 245 __ bind(&no_arguments); | 245 __ bind(&no_arguments); |
| 246 __ LoadRoot(argument, Heap::kempty_stringRootIndex); | 246 __ LoadRoot(argument, Heap::kempty_stringRootIndex); |
| 247 __ Drop(1); | 247 __ Drop(1); |
| 248 __ b(&argument_is_string); | 248 __ b(&argument_is_string); |
| 249 | 249 |
| 250 // At this point the argument is already a string. Call runtime to | 250 // At this point the argument is already a string. Call runtime to |
| 251 // create a string wrapper. | 251 // create a string wrapper. |
| 252 __ bind(&gc_required); | 252 __ bind(&gc_required); |
| 253 __ IncrementCounter(counters->string_ctor_gc_required(), 1, r6, r7); | 253 __ IncrementCounter(counters->string_ctor_gc_required(), 1, r6, r7); |
| 254 { | 254 { |
| 255 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 255 FrameScope scope(masm, StackFrame::INTERNAL); |
| 256 __ push(argument); | 256 __ push(argument); |
| 257 __ CallRuntime(Runtime::kNewStringWrapper, 1); | 257 __ CallRuntime(Runtime::kNewStringWrapper, 1); |
| 258 } | 258 } |
| 259 __ Ret(); | 259 __ Ret(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 | 262 |
| 263 static void CallRuntimePassFunction(MacroAssembler* masm, | 263 static void CallRuntimePassFunction(MacroAssembler* masm, |
| 264 Runtime::FunctionId function_id) { | 264 Runtime::FunctionId function_id) { |
| 265 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 265 FrameScope scope(masm, StackFrame::INTERNAL); |
| 266 // Push a copy of the function onto the stack. | 266 // Push a copy of the function onto the stack. |
| 267 // Push function as parameter to the runtime call. | 267 // Push function as parameter to the runtime call. |
| 268 __ Push(r4, r4); | 268 __ Push(r4, r4); |
| 269 | 269 |
| 270 __ CallRuntime(function_id, 1); | 270 __ CallRuntime(function_id, 1); |
| 271 // Restore reciever. | 271 // Restore reciever. |
| 272 __ Pop(r4); | 272 __ Pop(r4); |
| 273 } | 273 } |
| 274 | 274 |
| 275 | 275 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // -- sp[...]: constructor arguments | 346 // -- sp[...]: constructor arguments |
| 347 // ----------------------------------- | 347 // ----------------------------------- |
| 348 | 348 |
| 349 // Should never create mementos for api functions. | 349 // Should never create mementos for api functions. |
| 350 DCHECK(!is_api_function || !create_memento); | 350 DCHECK(!is_api_function || !create_memento); |
| 351 | 351 |
| 352 Isolate* isolate = masm->isolate(); | 352 Isolate* isolate = masm->isolate(); |
| 353 | 353 |
| 354 // Enter a construct frame. | 354 // Enter a construct frame. |
| 355 { | 355 { |
| 356 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); | 356 FrameScope scope(masm, StackFrame::CONSTRUCT); |
| 357 | 357 |
| 358 if (create_memento) { | 358 if (create_memento) { |
| 359 __ AssertUndefinedOrAllocationSite(r5, r7); | 359 __ AssertUndefinedOrAllocationSite(r5, r7); |
| 360 __ push(r5); | 360 __ push(r5); |
| 361 } | 361 } |
| 362 | 362 |
| 363 // Preserve the two incoming parameters on the stack. | 363 // Preserve the two incoming parameters on the stack. |
| 364 __ SmiTag(r3); | 364 __ SmiTag(r3); |
| 365 __ Push(r3, r4); | 365 __ Push(r3, r4); |
| 366 | 366 |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 // -- r5 : allocation site or undefined | 745 // -- r5 : allocation site or undefined |
| 746 // -- r6 : original constructor | 746 // -- r6 : original constructor |
| 747 // -- lr : return address | 747 // -- lr : return address |
| 748 // -- sp[...]: constructor arguments | 748 // -- sp[...]: constructor arguments |
| 749 // ----------------------------------- | 749 // ----------------------------------- |
| 750 | 750 |
| 751 // TODO(dslomov): support pretenuring | 751 // TODO(dslomov): support pretenuring |
| 752 CHECK(!FLAG_pretenuring_call_new); | 752 CHECK(!FLAG_pretenuring_call_new); |
| 753 | 753 |
| 754 { | 754 { |
| 755 FrameAndConstantPoolScope scope(masm, StackFrame::CONSTRUCT); | 755 FrameScope scope(masm, StackFrame::CONSTRUCT); |
| 756 | 756 |
| 757 // Smi-tagged arguments count. | 757 // Smi-tagged arguments count. |
| 758 __ mr(r7, r3); | 758 __ mr(r7, r3); |
| 759 __ SmiTag(r7, SetRC); | 759 __ SmiTag(r7, SetRC); |
| 760 | 760 |
| 761 // receiver is the hole. | 761 // receiver is the hole. |
| 762 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 762 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 763 | 763 |
| 764 // smi arguments count, new.target, receiver | 764 // smi arguments count, new.target, receiver |
| 765 __ Push(r7, r6, ip); | 765 __ Push(r7, r6, ip); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 } | 909 } |
| 910 | 910 |
| 911 | 911 |
| 912 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 912 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
| 913 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 913 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
| 914 GenerateTailCallToReturnedCode(masm); | 914 GenerateTailCallToReturnedCode(masm); |
| 915 } | 915 } |
| 916 | 916 |
| 917 | 917 |
| 918 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { | 918 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { |
| 919 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 919 FrameScope scope(masm, StackFrame::INTERNAL); |
| 920 // Push a copy of the function onto the stack. | 920 // Push a copy of the function onto the stack. |
| 921 // Push function as parameter to the runtime call. | 921 // Push function as parameter to the runtime call. |
| 922 __ Push(r4, r4); | 922 __ Push(r4, r4); |
| 923 // Whether to compile in a background thread. | 923 // Whether to compile in a background thread. |
| 924 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); | 924 __ Push(masm->isolate()->factory()->ToBoolean(concurrent)); |
| 925 | 925 |
| 926 __ CallRuntime(Runtime::kCompileOptimized, 2); | 926 __ CallRuntime(Runtime::kCompileOptimized, 2); |
| 927 // Restore receiver. | 927 // Restore receiver. |
| 928 __ pop(r4); | 928 __ pop(r4); |
| 929 } | 929 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 | 1020 |
| 1021 | 1021 |
| 1022 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { | 1022 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { |
| 1023 GenerateMakeCodeYoungAgainCommon(masm); | 1023 GenerateMakeCodeYoungAgainCommon(masm); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 | 1026 |
| 1027 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm, | 1027 static void Generate_NotifyStubFailureHelper(MacroAssembler* masm, |
| 1028 SaveFPRegsMode save_doubles) { | 1028 SaveFPRegsMode save_doubles) { |
| 1029 { | 1029 { |
| 1030 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1030 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1031 | 1031 |
| 1032 // Preserve registers across notification, this is important for compiled | 1032 // Preserve registers across notification, this is important for compiled |
| 1033 // stubs that tail call the runtime on deopts passing their parameters in | 1033 // stubs that tail call the runtime on deopts passing their parameters in |
| 1034 // registers. | 1034 // registers. |
| 1035 __ MultiPush(kJSCallerSaved | kCalleeSaved); | 1035 __ MultiPush(kJSCallerSaved | kCalleeSaved); |
| 1036 // Pass the function and deoptimization type to the runtime system. | 1036 // Pass the function and deoptimization type to the runtime system. |
| 1037 __ CallRuntime(Runtime::kNotifyStubFailure, 0, save_doubles); | 1037 __ CallRuntime(Runtime::kNotifyStubFailure, 0, save_doubles); |
| 1038 __ MultiPop(kJSCallerSaved | kCalleeSaved); | 1038 __ MultiPop(kJSCallerSaved | kCalleeSaved); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 __ addi(sp, sp, Operand(kPointerSize)); // Ignore state | 1041 __ addi(sp, sp, Operand(kPointerSize)); // Ignore state |
| 1042 __ blr(); // Jump to miss handler | 1042 __ blr(); // Jump to miss handler |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 | 1045 |
| 1046 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { | 1046 void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
| 1047 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); | 1047 Generate_NotifyStubFailureHelper(masm, kDontSaveFPRegs); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 | 1050 |
| 1051 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { | 1051 void Builtins::Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm) { |
| 1052 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); | 1052 Generate_NotifyStubFailureHelper(masm, kSaveFPRegs); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 | 1055 |
| 1056 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, | 1056 static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm, |
| 1057 Deoptimizer::BailoutType type) { | 1057 Deoptimizer::BailoutType type) { |
| 1058 { | 1058 { |
| 1059 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1059 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1060 // Pass the function and deoptimization type to the runtime system. | 1060 // Pass the function and deoptimization type to the runtime system. |
| 1061 __ LoadSmiLiteral(r3, Smi::FromInt(static_cast<int>(type))); | 1061 __ LoadSmiLiteral(r3, Smi::FromInt(static_cast<int>(type))); |
| 1062 __ push(r3); | 1062 __ push(r3); |
| 1063 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 1063 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 // Get the full codegen state from the stack and untag it -> r9. | 1066 // Get the full codegen state from the stack and untag it -> r9. |
| 1067 __ LoadP(r9, MemOperand(sp, 0 * kPointerSize)); | 1067 __ LoadP(r9, MemOperand(sp, 0 * kPointerSize)); |
| 1068 __ SmiUntag(r9); | 1068 __ SmiUntag(r9); |
| 1069 // Switch on the state. | 1069 // Switch on the state. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1097 | 1097 |
| 1098 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { | 1098 void Builtins::Generate_NotifyLazyDeoptimized(MacroAssembler* masm) { |
| 1099 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); | 1099 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::LAZY); |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 | 1102 |
| 1103 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { | 1103 void Builtins::Generate_OnStackReplacement(MacroAssembler* masm) { |
| 1104 // Lookup the function in the JavaScript frame. | 1104 // Lookup the function in the JavaScript frame. |
| 1105 __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1105 __ LoadP(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1106 { | 1106 { |
| 1107 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1107 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1108 // Pass function as argument. | 1108 // Pass function as argument. |
| 1109 __ push(r3); | 1109 __ push(r3); |
| 1110 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); | 1110 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 // If the code object is null, just return to the unoptimized code. | 1113 // If the code object is null, just return to the unoptimized code. |
| 1114 Label skip; | 1114 Label skip; |
| 1115 __ CmpSmiLiteral(r3, Smi::FromInt(0), r0); | 1115 __ CmpSmiLiteral(r3, Smi::FromInt(0), r0); |
| 1116 __ bne(&skip); | 1116 __ bne(&skip); |
| 1117 __ Ret(); | 1117 __ Ret(); |
| 1118 | 1118 |
| 1119 __ bind(&skip); | 1119 __ bind(&skip); |
| 1120 | 1120 |
| 1121 // Load deoptimization data from the code object. | 1121 // Load deoptimization data from the code object. |
| 1122 // <deopt_data> = <code>[#deoptimization_data_offset] | 1122 // <deopt_data> = <code>[#deoptimization_data_offset] |
| 1123 __ LoadP(r4, FieldMemOperand(r3, Code::kDeoptimizationDataOffset)); | 1123 __ LoadP(r4, FieldMemOperand(r3, Code::kDeoptimizationDataOffset)); |
| 1124 | 1124 |
| 1125 #if V8_OOL_CONSTANT_POOL | |
| 1126 { | 1125 { |
| 1127 ConstantPoolUnavailableScope constant_pool_unavailable(masm); | 1126 __ addi(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); // Code start |
| 1128 __ LoadP(kConstantPoolRegister, | |
| 1129 FieldMemOperand(r3, Code::kConstantPoolOffset)); | |
| 1130 #endif | |
| 1131 | 1127 |
| 1132 // Load the OSR entrypoint offset from the deoptimization data. | 1128 // Load the OSR entrypoint offset from the deoptimization data. |
| 1133 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] | 1129 // <osr_offset> = <deopt_data>[#header_size + #osr_pc_offset] |
| 1134 __ LoadP(r4, FieldMemOperand( | 1130 __ LoadP(r4, FieldMemOperand( |
| 1135 r4, FixedArray::OffsetOfElementAt( | 1131 r4, FixedArray::OffsetOfElementAt( |
| 1136 DeoptimizationInputData::kOsrPcOffsetIndex))); | 1132 DeoptimizationInputData::kOsrPcOffsetIndex))); |
| 1137 __ SmiUntag(r4); | 1133 __ SmiUntag(r4); |
| 1138 | 1134 |
| 1139 // Compute the target address = code_obj + header_size + osr_offset | 1135 // Compute the target address = code start + osr_offset |
| 1140 // <entry_addr> = <code_obj> + #header_size + <osr_offset> | 1136 __ add(r0, r3, r4); |
| 1141 __ add(r3, r3, r4); | |
| 1142 __ addi(r0, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); | |
| 1143 __ mtlr(r0); | |
| 1144 | 1137 |
| 1145 // And "return" to the OSR entry point of the function. | 1138 // And "return" to the OSR entry point of the function. |
| 1146 __ Ret(); | 1139 __ mtlr(r0); |
| 1147 #if V8_OOL_CONSTANT_POOL | 1140 __ blr(); |
| 1148 } | 1141 } |
| 1149 #endif | |
| 1150 } | 1142 } |
| 1151 | 1143 |
| 1152 | 1144 |
| 1153 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { | 1145 void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
| 1154 // We check the stack limit as indicator that recompilation might be done. | 1146 // We check the stack limit as indicator that recompilation might be done. |
| 1155 Label ok; | 1147 Label ok; |
| 1156 __ LoadRoot(ip, Heap::kStackLimitRootIndex); | 1148 __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| 1157 __ cmpl(sp, ip); | 1149 __ cmpl(sp, ip); |
| 1158 __ bge(&ok); | 1150 __ bge(&ok); |
| 1159 { | 1151 { |
| 1160 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1152 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1161 __ CallRuntime(Runtime::kStackGuard, 0); | 1153 __ CallRuntime(Runtime::kStackGuard, 0); |
| 1162 } | 1154 } |
| 1163 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), | 1155 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
| 1164 RelocInfo::CODE_TARGET); | 1156 RelocInfo::CODE_TARGET); |
| 1165 | 1157 |
| 1166 __ bind(&ok); | 1158 __ bind(&ok); |
| 1167 __ Ret(); | 1159 __ Ret(); |
| 1168 } | 1160 } |
| 1169 | 1161 |
| 1170 | 1162 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 __ beq(&use_global_proxy); | 1233 __ beq(&use_global_proxy); |
| 1242 | 1234 |
| 1243 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 1235 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 1244 __ CompareObjectType(r5, r6, r6, FIRST_SPEC_OBJECT_TYPE); | 1236 __ CompareObjectType(r5, r6, r6, FIRST_SPEC_OBJECT_TYPE); |
| 1245 __ bge(&shift_arguments); | 1237 __ bge(&shift_arguments); |
| 1246 | 1238 |
| 1247 __ bind(&convert_to_object); | 1239 __ bind(&convert_to_object); |
| 1248 | 1240 |
| 1249 { | 1241 { |
| 1250 // Enter an internal frame in order to preserve argument count. | 1242 // Enter an internal frame in order to preserve argument count. |
| 1251 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1243 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1252 __ SmiTag(r3); | 1244 __ SmiTag(r3); |
| 1253 __ Push(r3, r5); | 1245 __ Push(r3, r5); |
| 1254 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1246 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
| 1255 __ mr(r5, r3); | 1247 __ mr(r5, r3); |
| 1256 | 1248 |
| 1257 __ pop(r3); | 1249 __ pop(r3); |
| 1258 __ SmiUntag(r3); | 1250 __ SmiUntag(r3); |
| 1259 | 1251 |
| 1260 // Exit the internal frame. | 1252 // Exit the internal frame. |
| 1261 } | 1253 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1374 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { | 1366 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { |
| 1375 const int kIndexOffset = | 1367 const int kIndexOffset = |
| 1376 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); | 1368 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize); |
| 1377 const int kLimitOffset = | 1369 const int kLimitOffset = |
| 1378 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); | 1370 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize); |
| 1379 const int kArgsOffset = 2 * kPointerSize; | 1371 const int kArgsOffset = 2 * kPointerSize; |
| 1380 const int kRecvOffset = 3 * kPointerSize; | 1372 const int kRecvOffset = 3 * kPointerSize; |
| 1381 const int kFunctionOffset = 4 * kPointerSize; | 1373 const int kFunctionOffset = 4 * kPointerSize; |
| 1382 | 1374 |
| 1383 { | 1375 { |
| 1384 FrameAndConstantPoolScope frame_scope(masm, StackFrame::INTERNAL); | 1376 FrameScope frame_scope(masm, StackFrame::INTERNAL); |
| 1385 | 1377 |
| 1386 __ LoadP(r3, MemOperand(fp, kFunctionOffset)); // get the function | 1378 __ LoadP(r3, MemOperand(fp, kFunctionOffset)); // get the function |
| 1387 __ push(r3); | 1379 __ push(r3); |
| 1388 __ LoadP(r3, MemOperand(fp, kArgsOffset)); // get the args array | 1380 __ LoadP(r3, MemOperand(fp, kArgsOffset)); // get the args array |
| 1389 __ push(r3); | 1381 __ push(r3); |
| 1390 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); | 1382 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); |
| 1391 | 1383 |
| 1392 // Check the stack for overflow. We are not trying to catch | 1384 // Check the stack for overflow. We are not trying to catch |
| 1393 // interruptions (e.g. debug break and preemption) here, so the "real stack | 1385 // interruptions (e.g. debug break and preemption) here, so the "real stack |
| 1394 // limit" is checked. | 1386 // limit" is checked. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 __ cmp(r8, r0); | 1548 __ cmp(r8, r0); |
| 1557 __ ble(stack_overflow); // Signed comparison. | 1549 __ ble(stack_overflow); // Signed comparison. |
| 1558 } | 1550 } |
| 1559 | 1551 |
| 1560 | 1552 |
| 1561 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { | 1553 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { |
| 1562 __ SmiTag(r3); | 1554 __ SmiTag(r3); |
| 1563 __ LoadSmiLiteral(r7, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 1555 __ LoadSmiLiteral(r7, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| 1564 __ mflr(r0); | 1556 __ mflr(r0); |
| 1565 __ push(r0); | 1557 __ push(r0); |
| 1566 #if V8_OOL_CONSTANT_POOL | |
| 1567 __ Push(fp, kConstantPoolRegister, r7, r4, r3); | |
| 1568 #else | |
| 1569 __ Push(fp, r7, r4, r3); | 1558 __ Push(fp, r7, r4, r3); |
| 1570 #endif | |
| 1571 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + | 1559 __ addi(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp + |
| 1572 kPointerSize)); | 1560 kPointerSize)); |
| 1573 } | 1561 } |
| 1574 | 1562 |
| 1575 | 1563 |
| 1576 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { | 1564 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { |
| 1577 // ----------- S t a t e ------------- | 1565 // ----------- S t a t e ------------- |
| 1578 // -- r3 : result being passed through | 1566 // -- r3 : result being passed through |
| 1579 // ----------------------------------- | 1567 // ----------------------------------- |
| 1580 // Get the number of arguments passed (as a smi), tear down the frame and | 1568 // Get the number of arguments passed (as a smi), tear down the frame and |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1709 __ bkpt(0); | 1697 __ bkpt(0); |
| 1710 } | 1698 } |
| 1711 } | 1699 } |
| 1712 | 1700 |
| 1713 | 1701 |
| 1714 #undef __ | 1702 #undef __ |
| 1715 } | 1703 } |
| 1716 } // namespace v8::internal | 1704 } // namespace v8::internal |
| 1717 | 1705 |
| 1718 #endif // V8_TARGET_ARCH_PPC | 1706 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |