OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 void AllocateStackSlots(); | 222 void AllocateStackSlots(); |
223 | 223 |
224 // The current top of the expression stack as an assembly operand. | 224 // The current top of the expression stack as an assembly operand. |
225 MemOperand Top() { | 225 MemOperand Top() { |
226 AssertIsSpilled(); | 226 AssertIsSpilled(); |
227 return MemOperand(sp, 0); | 227 return MemOperand(sp, 0); |
228 } | 228 } |
229 | 229 |
230 // An element of the expression stack as an assembly operand. | 230 // An element of the expression stack as an assembly operand. |
231 MemOperand ElementAt(int index) { | 231 MemOperand ElementAt(int index) { |
232 AssertIsSpilled(); | 232 int adjusted_index = index - kVirtualElements[top_of_stack_state_]; |
233 return MemOperand(sp, index * kPointerSize); | 233 ASSERT(adjusted_index >= 0); |
Søren Thygesen Gjesse
2010/05/11 13:46:12
You don't want to spill to the point where this al
Erik Corry
2010/05/12 09:00:32
I think I want to keep that explicit since we want
| |
234 return MemOperand(sp, adjusted_index * kPointerSize); | |
234 } | 235 } |
235 | 236 |
236 // A frame-allocated local as an assembly operand. | 237 // A frame-allocated local as an assembly operand. |
237 inline MemOperand LocalAt(int index); | 238 inline MemOperand LocalAt(int index); |
238 | 239 |
239 // Push the address of the receiver slot on the frame. | 240 // Push the address of the receiver slot on the frame. |
240 void PushReceiverSlotAddress(); | 241 void PushReceiverSlotAddress(); |
241 | 242 |
242 // The function frame slot. | 243 // The function frame slot. |
243 MemOperand Function() { return MemOperand(fp, kFunctionOffset); } | 244 MemOperand Function() { return MemOperand(fp, kFunctionOffset); } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 // Takes the top element and puts it in r0. | 349 // Takes the top element and puts it in r0. |
349 void PopToR0(); | 350 void PopToR0(); |
350 | 351 |
351 // Push an element on top of the expression stack and emit a | 352 // Push an element on top of the expression stack and emit a |
352 // corresponding push instruction. | 353 // corresponding push instruction. |
353 void EmitPush(Register reg); | 354 void EmitPush(Register reg); |
354 void EmitPush(Operand operand); | 355 void EmitPush(Operand operand); |
355 void EmitPush(MemOperand operand); | 356 void EmitPush(MemOperand operand); |
356 void EmitPushRoot(Heap::RootListIndex index); | 357 void EmitPushRoot(Heap::RootListIndex index); |
357 | 358 |
359 // Overwrite the nth thing on the stack. If the nth position is in a | |
360 // register then this turns into a mov, otherwise an str. Afterwards | |
361 // you can still use the register even if it is a register that can be | |
362 // used for TOS (r0 or r1). | |
363 void OverwriteStackPosition(Register reg, int this_far_down); | |
Søren Thygesen Gjesse
2010/05/11 13:46:12
Why is this not called SetElementAt?
Erik Corry
2010/05/12 09:00:32
Done.
| |
364 | |
358 // Get a register which is free and which must be immediately used to | 365 // Get a register which is free and which must be immediately used to |
359 // push on the top of the stack. | 366 // push on the top of the stack. |
360 Register GetTOSRegister(); | 367 Register GetTOSRegister(); |
361 | 368 |
362 // Push multiple registers on the stack and the virtual frame | 369 // Push multiple registers on the stack and the virtual frame |
363 // Register are selected by setting bit in src_regs and | 370 // Register are selected by setting bit in src_regs and |
364 // are pushed in decreasing order: r15 .. r0. | 371 // are pushed in decreasing order: r15 .. r0. |
365 void EmitPushMultiple(int count, int src_regs); | 372 void EmitPushMultiple(int count, int src_regs); |
366 | 373 |
367 static Register scratch0() { return r7; } | 374 static Register scratch0() { return r7; } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 // Spill all elements in registers. Spill the top spilled_args elements | 459 // Spill all elements in registers. Spill the top spilled_args elements |
453 // on the frame. Sync all other frame elements. | 460 // on the frame. Sync all other frame elements. |
454 // Then drop dropped_args elements from the virtual frame, to match | 461 // Then drop dropped_args elements from the virtual frame, to match |
455 // the effect of an upcoming call that will drop them from the stack. | 462 // the effect of an upcoming call that will drop them from the stack. |
456 void PrepareForCall(int spilled_args, int dropped_args); | 463 void PrepareForCall(int spilled_args, int dropped_args); |
457 | 464 |
458 // If all top-of-stack registers are in use then the lowest one is pushed | 465 // If all top-of-stack registers are in use then the lowest one is pushed |
459 // onto the physical stack and made free. | 466 // onto the physical stack and made free. |
460 void EnsureOneFreeTOSRegister(); | 467 void EnsureOneFreeTOSRegister(); |
461 | 468 |
469 // Emit instructions to get the top of stack state from where we are to where | |
470 // we want to be. | |
471 void MergeTOSTo(TopOfStack expected_state); | |
472 | |
462 inline bool Equals(VirtualFrame* other); | 473 inline bool Equals(VirtualFrame* other); |
463 | 474 |
464 friend class JumpTarget; | 475 friend class JumpTarget; |
465 }; | 476 }; |
466 | 477 |
467 | 478 |
468 } } // namespace v8::internal | 479 } } // namespace v8::internal |
469 | 480 |
470 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ | 481 #endif // V8_ARM_VIRTUAL_FRAME_ARM_H_ |
OLD | NEW |