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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // emit code to affect the physical frame. Does not clobber any registers | 381 // emit code to affect the physical frame. Does not clobber any registers |
382 // excepting possibly the stack pointer. | 382 // excepting possibly the stack pointer. |
383 void Drop(int count); | 383 void Drop(int count); |
384 | 384 |
385 // Drop one element. | 385 // Drop one element. |
386 void Drop() { Drop(1); } | 386 void Drop() { Drop(1); } |
387 | 387 |
388 // Duplicate the top element of the frame. | 388 // Duplicate the top element of the frame. |
389 void Dup() { PushFrameSlotAt(element_count() - 1); } | 389 void Dup() { PushFrameSlotAt(element_count() - 1); } |
390 | 390 |
| 391 // Duplicate the n'th element from the top of the frame. |
| 392 // Dup(1) is equivalent to Dup(). |
| 393 void Dup(int n) { |
| 394 ASSERT(n > 0); |
| 395 PushFrameSlotAt(element_count() - n); |
| 396 } |
| 397 |
391 // Pop an element from the top of the expression stack. Returns a | 398 // Pop an element from the top of the expression stack. Returns a |
392 // Result, which may be a constant or a register. | 399 // Result, which may be a constant or a register. |
393 Result Pop(); | 400 Result Pop(); |
394 | 401 |
395 // Pop and save an element from the top of the expression stack and | 402 // Pop and save an element from the top of the expression stack and |
396 // emit a corresponding pop instruction. | 403 // emit a corresponding pop instruction. |
397 void EmitPop(Register reg); | 404 void EmitPop(Register reg); |
398 void EmitPop(const Operand& operand); | 405 void EmitPop(const Operand& operand); |
399 | 406 |
400 // Push an element on top of the expression stack and emit a | 407 // Push an element on top of the expression stack and emit a |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 600 |
594 // Classes that need raw access to the elements_ array. | 601 // Classes that need raw access to the elements_ array. |
595 friend class FrameRegisterState; | 602 friend class FrameRegisterState; |
596 friend class JumpTarget; | 603 friend class JumpTarget; |
597 }; | 604 }; |
598 | 605 |
599 | 606 |
600 } } // namespace v8::internal | 607 } } // namespace v8::internal |
601 | 608 |
602 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ | 609 #endif // V8_X64_VIRTUAL_FRAME_X64_H_ |
OLD | NEW |