Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 // binding a label. | 230 // binding a label. |
| 231 void AttachToCodeGenerator(); | 231 void AttachToCodeGenerator(); |
| 232 | 232 |
| 233 // Emit code for the physical JS entry and exit frame sequences. After | 233 // Emit code for the physical JS entry and exit frame sequences. After |
| 234 // calling Enter, the virtual frame is ready for use; and after calling | 234 // calling Enter, the virtual frame is ready for use; and after calling |
| 235 // Exit it should not be used. Note that Enter does not allocate space in | 235 // Exit it should not be used. Note that Enter does not allocate space in |
| 236 // the physical frame for storing frame-allocated locals. | 236 // the physical frame for storing frame-allocated locals. |
| 237 void Enter(); | 237 void Enter(); |
| 238 void Exit(); | 238 void Exit(); |
| 239 | 239 |
| 240 // Prepare for returning from the frame by spilling locals and | |
| 241 // forgetting about all non-locals elements in the virtual frame. | |
| 242 // This avoid generating unnecessary merge code when jumping to the | |
|
Kevin Millikin (Chromium)
2009/01/07 10:25:12
avoids
| |
| 243 // shared return site. Emits code for spills. | |
| 244 void PrepareForReturn(); | |
| 245 | |
| 240 // Allocate and initialize the frame-allocated locals. The eax register | 246 // Allocate and initialize the frame-allocated locals. The eax register |
| 241 // us clobbered. | 247 // us clobbered. |
| 242 void AllocateStackSlots(int count); | 248 void AllocateStackSlots(int count); |
| 243 | 249 |
| 244 // The current top of the expression stack as an assembly operand. | 250 // The current top of the expression stack as an assembly operand. |
| 245 Operand Top() const { return Operand(esp, 0); } | 251 Operand Top() const { return Operand(esp, 0); } |
| 246 | 252 |
| 247 // An element of the expression stack as an assembly operand. | 253 // An element of the expression stack as an assembly operand. |
| 248 Operand ElementAt(int index) const { | 254 Operand ElementAt(int index) const { |
| 249 return Operand(esp, index * kPointerSize); | 255 return Operand(esp, index * kPointerSize); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 // Store the value on top of the frame to a frame slot (typically a local | 494 // Store the value on top of the frame to a frame slot (typically a local |
| 489 // or parameter). | 495 // or parameter). |
| 490 void StoreToFrameSlotAt(int index); | 496 void StoreToFrameSlotAt(int index); |
| 491 | 497 |
| 492 // Spill the topmost elements of the frame to memory (eg, they are the | 498 // Spill the topmost elements of the frame to memory (eg, they are the |
| 493 // arguments to a call) and all registers. | 499 // arguments to a call) and all registers. |
| 494 void PrepareForCall(int count); | 500 void PrepareForCall(int count); |
| 495 | 501 |
| 496 // Move frame elements currently in registers or constants, that | 502 // Move frame elements currently in registers or constants, that |
| 497 // should be in memory in the expected frame, to memory. | 503 // should be in memory in the expected frame, to memory. |
| 498 void MergeMoveRegistersToMemory(VirtualFrame *expected); | 504 void MergeMoveRegistersToMemory(VirtualFrame* expected); |
| 499 | 505 |
| 500 // Make the register-to-register moves necessary to | 506 // Make the register-to-register moves necessary to |
| 501 // merge this frame with the expected frame. | 507 // merge this frame with the expected frame. |
| 502 // Register to memory moves must already have been made, | 508 // Register to memory moves must already have been made, |
| 503 // and memory to register moves must follow this call. | 509 // and memory to register moves must follow this call. |
| 504 // This is because some new memory-to-register moves are | 510 // This is because some new memory-to-register moves are |
| 505 // created in order to break cycles of register moves. | 511 // created in order to break cycles of register moves. |
| 506 // Used in the implementation of MergeTo(). | 512 // Used in the implementation of MergeTo(). |
| 507 void MergeMoveRegistersToRegisters(VirtualFrame *expected); | 513 void MergeMoveRegistersToRegisters(VirtualFrame* expected); |
| 508 | 514 |
| 509 // Make the memory-to-register and constant-to-register moves | 515 // Make the memory-to-register and constant-to-register moves |
| 510 // needed to make this frame equal the expected frame. | 516 // needed to make this frame equal the expected frame. |
| 511 // Called after all register-to-memory and register-to-register | 517 // Called after all register-to-memory and register-to-register |
| 512 // moves have been made. After this function returns, the frames | 518 // moves have been made. After this function returns, the frames |
| 513 // should be equal. | 519 // should be equal. |
| 514 void MergeMoveMemoryToRegisters(VirtualFrame *expected); | 520 void MergeMoveMemoryToRegisters(VirtualFrame* expected); |
| 515 }; | 521 }; |
| 516 | 522 |
| 517 | 523 |
| 518 } } // namespace v8::internal | 524 } } // namespace v8::internal |
| 519 | 525 |
| 520 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 526 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |