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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 287 } |
288 __ Ret(); | 288 __ Ret(); |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 static void CallRuntimePassFunction(MacroAssembler* masm, | 292 static void CallRuntimePassFunction(MacroAssembler* masm, |
293 Runtime::FunctionId function_id) { | 293 Runtime::FunctionId function_id) { |
294 FrameScope scope(masm, StackFrame::INTERNAL); | 294 FrameScope scope(masm, StackFrame::INTERNAL); |
295 // Push a copy of the function onto the stack. | 295 // Push a copy of the function onto the stack. |
296 __ push(r1); | 296 __ push(r1); |
297 // Push call kind information. | 297 // Push call kind information and function as parameter to the runtime call. |
298 __ push(r5); | 298 __ Push(r5, r1); |
299 // Function is also the parameter to the runtime call. | |
300 __ push(r1); | |
301 | 299 |
302 __ CallRuntime(function_id, 1); | 300 __ CallRuntime(function_id, 1); |
303 // Restore call kind information. | 301 // Restore call kind information. |
304 __ pop(r5); | 302 __ pop(r5); |
305 // Restore receiver. | 303 // Restore receiver. |
306 __ pop(r1); | 304 __ pop(r1); |
307 } | 305 } |
308 | 306 |
309 | 307 |
310 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { | 308 static void GenerateTailCallToSharedCode(MacroAssembler* masm) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 Label allocate; | 397 Label allocate; |
400 // Decrease generous allocation count. | 398 // Decrease generous allocation count. |
401 __ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); | 399 __ ldr(r3, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
402 MemOperand constructor_count = | 400 MemOperand constructor_count = |
403 FieldMemOperand(r3, SharedFunctionInfo::kConstructionCountOffset); | 401 FieldMemOperand(r3, SharedFunctionInfo::kConstructionCountOffset); |
404 __ ldrb(r4, constructor_count); | 402 __ ldrb(r4, constructor_count); |
405 __ sub(r4, r4, Operand(1), SetCC); | 403 __ sub(r4, r4, Operand(1), SetCC); |
406 __ strb(r4, constructor_count); | 404 __ strb(r4, constructor_count); |
407 __ b(ne, &allocate); | 405 __ b(ne, &allocate); |
408 | 406 |
409 __ Push(r1, r2); | 407 __ push(r1); |
410 | 408 |
411 __ push(r1); // constructor | 409 __ Push(r2, r1); // r1 = constructor |
412 // The call will replace the stub, so the countdown is only done once. | 410 // The call will replace the stub, so the countdown is only done once. |
413 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); | 411 __ CallRuntime(Runtime::kFinalizeInstanceSize, 1); |
414 | 412 |
415 __ pop(r2); | 413 __ pop(r2); |
416 __ pop(r1); | 414 __ pop(r1); |
417 | 415 |
418 __ bind(&allocate); | 416 __ bind(&allocate); |
419 } | 417 } |
420 | 418 |
421 // Now allocate the JSObject on the heap. | 419 // Now allocate the JSObject on the heap. |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); | 1199 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); |
1202 // Make r2 the space we have left. The stack might already be overflowed | 1200 // Make r2 the space we have left. The stack might already be overflowed |
1203 // here which will cause r2 to become negative. | 1201 // here which will cause r2 to become negative. |
1204 __ sub(r2, sp, r2); | 1202 __ sub(r2, sp, r2); |
1205 // Check if the arguments will overflow the stack. | 1203 // Check if the arguments will overflow the stack. |
1206 __ cmp(r2, Operand::PointerOffsetFromSmiKey(r0)); | 1204 __ cmp(r2, Operand::PointerOffsetFromSmiKey(r0)); |
1207 __ b(gt, &okay); // Signed comparison. | 1205 __ b(gt, &okay); // Signed comparison. |
1208 | 1206 |
1209 // Out of stack space. | 1207 // Out of stack space. |
1210 __ ldr(r1, MemOperand(fp, kFunctionOffset)); | 1208 __ ldr(r1, MemOperand(fp, kFunctionOffset)); |
1211 __ push(r1); | 1209 __ Push(r1, r0); |
1212 __ push(r0); | |
1213 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); | 1210 __ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION); |
1214 // End of stack check. | 1211 // End of stack check. |
1215 | 1212 |
1216 // Push current limit and index. | 1213 // Push current limit and index. |
1217 __ bind(&okay); | 1214 __ bind(&okay); |
1218 __ push(r0); // limit | 1215 __ push(r0); // limit |
1219 __ mov(r1, Operand::Zero()); // initial index | 1216 __ mov(r1, Operand::Zero()); // initial index |
1220 __ push(r1); | 1217 __ push(r1); |
1221 | 1218 |
1222 // Get the receiver. | 1219 // Get the receiver. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1284 // Copy all arguments from the array to the stack. | 1281 // Copy all arguments from the array to the stack. |
1285 Label entry, loop; | 1282 Label entry, loop; |
1286 __ ldr(r0, MemOperand(fp, kIndexOffset)); | 1283 __ ldr(r0, MemOperand(fp, kIndexOffset)); |
1287 __ b(&entry); | 1284 __ b(&entry); |
1288 | 1285 |
1289 // Load the current argument from the arguments array and push it to the | 1286 // Load the current argument from the arguments array and push it to the |
1290 // stack. | 1287 // stack. |
1291 // r0: current argument index | 1288 // r0: current argument index |
1292 __ bind(&loop); | 1289 __ bind(&loop); |
1293 __ ldr(r1, MemOperand(fp, kArgsOffset)); | 1290 __ ldr(r1, MemOperand(fp, kArgsOffset)); |
1294 __ push(r1); | 1291 __ Push(r1, r0); |
1295 __ push(r0); | |
1296 | 1292 |
1297 // Call the runtime to access the property in the arguments array. | 1293 // Call the runtime to access the property in the arguments array. |
1298 __ CallRuntime(Runtime::kGetProperty, 2); | 1294 __ CallRuntime(Runtime::kGetProperty, 2); |
1299 __ push(r0); | 1295 __ push(r0); |
1300 | 1296 |
1301 // Use inline caching to access the arguments. | 1297 // Use inline caching to access the arguments. |
1302 __ ldr(r0, MemOperand(fp, kIndexOffset)); | 1298 __ ldr(r0, MemOperand(fp, kIndexOffset)); |
1303 __ add(r0, r0, Operand(1 << kSmiTagSize)); | 1299 __ add(r0, r0, Operand(1 << kSmiTagSize)); |
1304 __ str(r0, MemOperand(fp, kIndexOffset)); | 1300 __ str(r0, MemOperand(fp, kIndexOffset)); |
1305 | 1301 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 __ bind(&dont_adapt_arguments); | 1465 __ bind(&dont_adapt_arguments); |
1470 __ Jump(r3); | 1466 __ Jump(r3); |
1471 } | 1467 } |
1472 | 1468 |
1473 | 1469 |
1474 #undef __ | 1470 #undef __ |
1475 | 1471 |
1476 } } // namespace v8::internal | 1472 } } // namespace v8::internal |
1477 | 1473 |
1478 #endif // V8_TARGET_ARCH_ARM | 1474 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |