| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 // Record an occurrence of a register in the virtual frame. This has the | 472 // Record an occurrence of a register in the virtual frame. This has the |
| 473 // effect of incrementing both the register's frame-internal reference | 473 // effect of incrementing both the register's frame-internal reference |
| 474 // count and its external reference count. | 474 // count and its external reference count. |
| 475 void Use(Register reg); | 475 void Use(Register reg); |
| 476 | 476 |
| 477 // Record that a register reference has been dropped from the frame. This | 477 // Record that a register reference has been dropped from the frame. This |
| 478 // decrements both the register's internal and external reference counts. | 478 // decrements both the register's internal and external reference counts. |
| 479 void Unuse(Register reg); | 479 void Unuse(Register reg); |
| 480 | 480 |
| 481 // Sync the element at a particular index---write it to memory if | |
| 482 // necessary, but do not free any associated register or forget its value | |
| 483 // if constant. Space should have already been allocated in the actual | |
| 484 // frame for all the elements below this one (at least). | |
| 485 void SyncElementAt(int index); | |
| 486 | |
| 487 // Spill the element at a particular index---write it to memory if | 481 // Spill the element at a particular index---write it to memory if |
| 488 // necessary, free any associated register, and forget its value if | 482 // necessary, free any associated register, and forget its value if |
| 489 // constant. | 483 // constant. |
| 490 void SpillElementAt(int index); | 484 void SpillElementAt(int index); |
| 491 | 485 |
| 492 // Spill the element at an index without modifying its reference count (if | 486 // Spill the element at an index without modifying its reference count (if |
| 493 // it was in a register). | 487 // it was in a register). |
| 494 void RawSpillElementAt(int index); | 488 void RawSpillElementAt(int index); |
| 495 | 489 |
| 490 // Sync the element at a particular index. If it is a register or |
| 491 // constant that disagrees with the value on the stack, write it to memory. |
| 492 // Keep the element type as register or constant, and clear the dirty bit. |
| 493 void SyncElementAt(int index); |
| 494 |
| 496 // Sync the range of elements in [begin, end). | 495 // Sync the range of elements in [begin, end). |
| 497 void SyncRange(int begin, int end); | 496 void SyncRange(int begin, int end); |
| 498 | 497 |
| 498 // Sync a single element, assuming that its index is less than |
| 499 // or equal to stack pointer + 1. |
| 500 void RawSyncElementAt(int index); |
| 501 |
| 499 // Push a copy of a frame slot (typically a local or parameter) on top of | 502 // Push a copy of a frame slot (typically a local or parameter) on top of |
| 500 // the frame. | 503 // the frame. |
| 501 void LoadFrameSlotAt(int index); | 504 void LoadFrameSlotAt(int index); |
| 502 | 505 |
| 503 // Store the value on top of the frame to a frame slot (typically a local | 506 // Store the value on top of the frame to a frame slot (typically a local |
| 504 // or parameter). | 507 // or parameter). |
| 505 void StoreToFrameSlotAt(int index); | 508 void StoreToFrameSlotAt(int index); |
| 506 | 509 |
| 507 // Spill the topmost elements of the frame to memory (eg, they are the | 510 // Spill the topmost elements of the frame to memory (eg, they are the |
| 508 // arguments to a call) and all registers. | 511 // arguments to a call) and all registers. |
| 509 void PrepareForCall(int count); | 512 void PrepareForCall(int count); |
| 510 | 513 |
| 514 // Move frame elements currently in registers or constants, that |
| 515 // should be in memory in the expected frame, to memory. |
| 516 void MergeMoveRegistersToMemory(VirtualFrame *expected); |
| 517 |
| 511 // Make the register-to-register moves necessary to | 518 // Make the register-to-register moves necessary to |
| 512 // merge this frame with the expected frame. | 519 // merge this frame with the expected frame. |
| 513 // Register to memory moves must already have been made, | 520 // Register to memory moves must already have been made, |
| 514 // and memory to register moves must follow this call. | 521 // and memory to register moves must follow this call. |
| 515 // This is because some new memory-to-register moves are | 522 // This is because some new memory-to-register moves are |
| 516 // created in order to break cycles of register moves. | 523 // created in order to break cycles of register moves. |
| 517 // Used in the implementation of MergeTo(). | 524 // Used in the implementation of MergeTo(). |
| 518 void MergeMoveRegistersToRegisters(VirtualFrame *expected); | 525 void MergeMoveRegistersToRegisters(VirtualFrame *expected); |
| 526 |
| 527 // Make the memory-to-register and constant-to-register moves |
| 528 // needed to make this frame equal the expected frame. |
| 529 // Called after all register-to-memory and register-to-register |
| 530 // moves have been made. After this function returns, the frames |
| 531 // should be equal. |
| 532 void MergeMoveMemoryToRegisters(VirtualFrame *expected); |
| 519 }; | 533 }; |
| 520 | 534 |
| 521 | 535 |
| 522 } } // namespace v8::internal | 536 } } // namespace v8::internal |
| 523 | 537 |
| 524 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 538 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |