Chromium Code Reviews| Index: src/arm/codegen-arm.cc |
| =================================================================== |
| --- src/arm/codegen-arm.cc (revision 2780) |
| +++ src/arm/codegen-arm.cc (working copy) |
| @@ -176,7 +176,8 @@ |
| } |
| #endif |
| - // Allocate space for locals and initialize them. |
| + // Allocate space for locals and initialize them. This also checks |
| + // for stack overflow. |
| frame_->AllocateStackSlots(); |
| // Initialize the function return target after the locals are set |
| // up, because it needs the expected frame height from the frame. |
| @@ -278,7 +279,6 @@ |
| frame_->CallRuntime(Runtime::kTraceEnter, 0); |
| // Ignore the return value. |
| } |
| - CheckStack(); |
| // Compile the body of the function in a vanilla state. Don't |
| // bother compiling all the code if the scope has an illegal |
| @@ -1111,9 +1111,18 @@ |
| if (FLAG_check_stack) { |
| Comment cmnt(masm_, "[ check stack"); |
| __ LoadRoot(ip, Heap::kStackLimitRootIndex); |
| - __ cmp(sp, Operand(ip)); |
| + // Put the lr setup insn in the delay slot. The '4' is added to the |
|
Mads Ager (chromium)
2009/08/31 09:33:10
insn -> instruction
|
| + // implicit 8 that always apples to operations with pc and gives a return |
|
Mads Ager (chromium)
2009/08/31 09:33:10
applies?
|
| + // address 12 bytes down. |
| + masm_->add(lr, pc, Operand(4)); |
|
Mads Ager (chromium)
2009/08/31 09:33:10
Is this just 4 bytes or is it really kPointerSize?
Erik Corry
2009/08/31 11:07:57
Fixed to be sizeof(Instr). If we move to thumb2 w
|
| + masm_->cmp(sp, Operand(ip)); |
| StackCheckStub stub; |
| - __ CallStub(&stub, lo); // Call the stub if lower. |
| + // Call the stub if lower. |
| + masm_->mov(pc, |
| + Operand(reinterpret_cast<intptr_t>(stub.GetCode().location()), |
| + RelocInfo::CODE_TARGET), |
| + LeaveCC, |
| + lo); |
| } |
| } |