Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: src/arm/builtins-arm.cc

Issue 60763006: Replace hard-coded stack frame size literals with StandardFrameConstants::kFixedFrameSizeFromFp (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix merge error Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 FrameScope scope(masm, StackFrame::MANUAL); 837 FrameScope scope(masm, StackFrame::MANUAL);
838 __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); 838 __ stm(db_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit());
839 __ PrepareCallCFunction(1, 0, r2); 839 __ PrepareCallCFunction(1, 0, r2);
840 __ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate()))); 840 __ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate())));
841 __ CallCFunction(ExternalReference::get_mark_code_as_executed_function( 841 __ CallCFunction(ExternalReference::get_mark_code_as_executed_function(
842 masm->isolate()), 2); 842 masm->isolate()), 2);
843 __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit()); 843 __ ldm(ia_w, sp, r0.bit() | r1.bit() | fp.bit() | lr.bit());
844 844
845 // Perform prologue operations usually performed by the young code stub. 845 // Perform prologue operations usually performed by the young code stub.
846 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); 846 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
847 __ add(fp, sp, Operand(2 * kPointerSize)); 847 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
848 848
849 // Jump to point after the code-age stub. 849 // Jump to point after the code-age stub.
850 __ add(r0, r0, Operand(kNoCodeAgeSequenceLength * Assembler::kInstrSize)); 850 __ add(r0, r0, Operand(kNoCodeAgeSequenceLength * Assembler::kInstrSize));
851 __ mov(pc, r0); 851 __ mov(pc, r0);
852 } 852 }
853 853
854 854
855 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { 855 void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) {
856 GenerateMakeCodeYoungAgainCommon(masm); 856 GenerateMakeCodeYoungAgainCommon(masm);
857 } 857 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 RelocInfo::CODE_TARGET, 1170 RelocInfo::CODE_TARGET,
1171 ne); 1171 ne);
1172 1172
1173 ParameterCount expected(0); 1173 ParameterCount expected(0);
1174 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION, 1174 __ InvokeCode(r3, expected, expected, JUMP_FUNCTION,
1175 NullCallWrapper(), CALL_AS_METHOD); 1175 NullCallWrapper(), CALL_AS_METHOD);
1176 } 1176 }
1177 1177
1178 1178
1179 void Builtins::Generate_FunctionApply(MacroAssembler* masm) { 1179 void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
1180 const int kIndexOffset = -5 * kPointerSize; 1180 const int kIndexOffset =
1181 const int kLimitOffset = -4 * kPointerSize; 1181 StandardFrameConstants::kExpressionsOffset - (2 * kPointerSize);
1182 const int kArgsOffset = 2 * kPointerSize; 1182 const int kLimitOffset =
1183 const int kRecvOffset = 3 * kPointerSize; 1183 StandardFrameConstants::kExpressionsOffset - (1 * kPointerSize);
1184 const int kFunctionOffset = 4 * kPointerSize; 1184 const int kArgsOffset = 2 * kPointerSize;
1185 const int kRecvOffset = 3 * kPointerSize;
1186 const int kFunctionOffset = 4 * kPointerSize;
1185 1187
1186 { 1188 {
1187 FrameScope frame_scope(masm, StackFrame::INTERNAL); 1189 FrameScope frame_scope(masm, StackFrame::INTERNAL);
1188 1190
1189 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function 1191 __ ldr(r0, MemOperand(fp, kFunctionOffset)); // get the function
1190 __ push(r0); 1192 __ push(r0);
1191 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array 1193 __ ldr(r0, MemOperand(fp, kArgsOffset)); // get the args array
1192 __ push(r0); 1194 __ push(r0);
1193 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION); 1195 __ InvokeBuiltin(Builtins::APPLY_PREPARE, CALL_FUNCTION);
1194 1196
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 } 1336 }
1335 __ add(sp, sp, Operand(3 * kPointerSize)); 1337 __ add(sp, sp, Operand(3 * kPointerSize));
1336 __ Jump(lr); 1338 __ Jump(lr);
1337 } 1339 }
1338 1340
1339 1341
1340 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) { 1342 static void EnterArgumentsAdaptorFrame(MacroAssembler* masm) {
1341 __ SmiTag(r0); 1343 __ SmiTag(r0);
1342 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); 1344 __ mov(r4, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1343 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit()); 1345 __ stm(db_w, sp, r0.bit() | r1.bit() | r4.bit() | fp.bit() | lr.bit());
1344 __ add(fp, sp, Operand(3 * kPointerSize)); 1346 __ add(fp, sp,
1347 Operand(StandardFrameConstants::kFixedFrameSizeFromFp + kPointerSize));
1345 } 1348 }
1346 1349
1347 1350
1348 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) { 1351 static void LeaveArgumentsAdaptorFrame(MacroAssembler* masm) {
1349 // ----------- S t a t e ------------- 1352 // ----------- S t a t e -------------
1350 // -- r0 : result being passed through 1353 // -- r0 : result being passed through
1351 // ----------------------------------- 1354 // -----------------------------------
1352 // Get the number of arguments passed (as a smi), tear down the frame and 1355 // Get the number of arguments passed (as a smi), tear down the frame and
1353 // then tear down the parameters. 1356 // then tear down the parameters.
1354 __ ldr(r1, MemOperand(fp, -3 * kPointerSize)); 1357 __ ldr(r1, MemOperand(fp, -(StandardFrameConstants::kFixedFrameSizeFromFp +
1358 kPointerSize)));
1355 __ mov(sp, fp); 1359 __ mov(sp, fp);
1356 __ ldm(ia_w, sp, fp.bit() | lr.bit()); 1360 __ ldm(ia_w, sp, fp.bit() | lr.bit());
1357 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1)); 1361 __ add(sp, sp, Operand::PointerOffsetFromSmiKey(r1));
1358 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver 1362 __ add(sp, sp, Operand(kPointerSize)); // adjust for receiver
1359 } 1363 }
1360 1364
1361 1365
1362 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 1366 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
1363 // ----------- S t a t e ------------- 1367 // ----------- S t a t e -------------
1364 // -- r0 : actual number of arguments 1368 // -- r0 : actual number of arguments
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 __ cmp(r0, fp); // Compare before moving to next argument. 1435 __ cmp(r0, fp); // Compare before moving to next argument.
1432 __ sub(r0, r0, Operand(kPointerSize)); 1436 __ sub(r0, r0, Operand(kPointerSize));
1433 __ b(ne, &copy); 1437 __ b(ne, &copy);
1434 1438
1435 // Fill the remaining expected arguments with undefined. 1439 // Fill the remaining expected arguments with undefined.
1436 // r1: function 1440 // r1: function
1437 // r2: expected number of arguments 1441 // r2: expected number of arguments
1438 // r3: code entry to call 1442 // r3: code entry to call
1439 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); 1443 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
1440 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2)); 1444 __ sub(r2, fp, Operand(r2, LSL, kPointerSizeLog2));
1441 __ sub(r2, r2, Operand(4 * kPointerSize)); // Adjust for frame. 1445 // Adjust for frame.
1446 __ sub(r2, r2, Operand(StandardFrameConstants::kFixedFrameSizeFromFp +
1447 2 * kPointerSize));
1442 1448
1443 Label fill; 1449 Label fill;
1444 __ bind(&fill); 1450 __ bind(&fill);
1445 __ push(ip); 1451 __ push(ip);
1446 __ cmp(sp, r2); 1452 __ cmp(sp, r2);
1447 __ b(ne, &fill); 1453 __ b(ne, &fill);
1448 } 1454 }
1449 1455
1450 // Call the entry point. 1456 // Call the entry point.
1451 __ bind(&invoke); 1457 __ bind(&invoke);
(...skipping 13 matching lines...) Expand all
1465 __ bind(&dont_adapt_arguments); 1471 __ bind(&dont_adapt_arguments);
1466 __ Jump(r3); 1472 __ Jump(r3);
1467 } 1473 }
1468 1474
1469 1475
1470 #undef __ 1476 #undef __
1471 1477
1472 } } // namespace v8::internal 1478 } } // namespace v8::internal
1473 1479
1474 #endif // V8_TARGET_ARCH_ARM 1480 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698