| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // Construct a virtual frame as a clone of an existing one. | 78 // Construct a virtual frame as a clone of an existing one. |
| 79 explicit inline VirtualFrame(VirtualFrame* original); | 79 explicit inline VirtualFrame(VirtualFrame* original); |
| 80 | 80 |
| 81 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } | 81 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } |
| 82 | 82 |
| 83 MacroAssembler* masm() { return cgen()->masm(); } | 83 MacroAssembler* masm() { return cgen()->masm(); } |
| 84 | 84 |
| 85 // Create a duplicate of an existing valid frame element. | 85 // Create a duplicate of an existing valid frame element. |
| 86 FrameElement CopyElementAt(int index, | 86 FrameElement CopyElementAt(int index, |
| 87 NumberInfo::Type info = NumberInfo::kUninitialized); | 87 NumberInfo info = NumberInfo::Uninitialized()); |
| 88 | 88 |
| 89 // The number of elements on the virtual frame. | 89 // The number of elements on the virtual frame. |
| 90 int element_count() { return elements_.length(); } | 90 int element_count() { return elements_.length(); } |
| 91 | 91 |
| 92 // The height of the virtual expression stack. | 92 // The height of the virtual expression stack. |
| 93 int height() { return element_count() - expression_base_index(); } | 93 int height() { return element_count() - expression_base_index(); } |
| 94 | 94 |
| 95 int register_location(int num) { | 95 int register_location(int num) { |
| 96 ASSERT(num >= 0 && num < RegisterAllocator::kNumRegisters); | 96 ASSERT(num >= 0 && num < RegisterAllocator::kNumRegisters); |
| 97 return register_locations_[num]; | 97 return register_locations_[num]; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 Result Pop(); | 381 Result Pop(); |
| 382 | 382 |
| 383 // Pop and save an element from the top of the expression stack and | 383 // Pop and save an element from the top of the expression stack and |
| 384 // emit a corresponding pop instruction. | 384 // emit a corresponding pop instruction. |
| 385 void EmitPop(Register reg); | 385 void EmitPop(Register reg); |
| 386 void EmitPop(Operand operand); | 386 void EmitPop(Operand operand); |
| 387 | 387 |
| 388 // Push an element on top of the expression stack and emit a | 388 // Push an element on top of the expression stack and emit a |
| 389 // corresponding push instruction. | 389 // corresponding push instruction. |
| 390 void EmitPush(Register reg, | 390 void EmitPush(Register reg, |
| 391 NumberInfo::Type info = NumberInfo::kUnknown); | 391 NumberInfo info = NumberInfo::Unknown()); |
| 392 void EmitPush(Operand operand, | 392 void EmitPush(Operand operand, |
| 393 NumberInfo::Type info = NumberInfo::kUnknown); | 393 NumberInfo info = NumberInfo::Unknown()); |
| 394 void EmitPush(Immediate immediate, | 394 void EmitPush(Immediate immediate, |
| 395 NumberInfo::Type info = NumberInfo::kUnknown); | 395 NumberInfo info = NumberInfo::Unknown()); |
| 396 | 396 |
| 397 // Push an element on the virtual frame. | 397 // Push an element on the virtual frame. |
| 398 inline void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown); | 398 inline void Push(Register reg, NumberInfo info = NumberInfo::Unknown()); |
| 399 inline void Push(Handle<Object> value); | 399 inline void Push(Handle<Object> value); |
| 400 inline void Push(Smi* value); | 400 inline void Push(Smi* value); |
| 401 | 401 |
| 402 // Pushing a result invalidates it (its contents become owned by the | 402 // Pushing a result invalidates it (its contents become owned by the |
| 403 // frame). | 403 // frame). |
| 404 void Push(Result* result) { | 404 void Push(Result* result) { |
| 405 // This assert will trigger if you try to push the same value twice. | 405 // This assert will trigger if you try to push the same value twice. |
| 406 ASSERT(result->is_valid()); | 406 ASSERT(result->is_valid()); |
| 407 if (result->is_register()) { | 407 if (result->is_register()) { |
| 408 Push(result->reg(), result->number_info()); | 408 Push(result->reg(), result->number_info()); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 inline bool Equals(VirtualFrame* other); | 590 inline bool Equals(VirtualFrame* other); |
| 591 | 591 |
| 592 // Classes that need raw access to the elements_ array. | 592 // Classes that need raw access to the elements_ array. |
| 593 friend class DeferredCode; | 593 friend class DeferredCode; |
| 594 friend class JumpTarget; | 594 friend class JumpTarget; |
| 595 }; | 595 }; |
| 596 | 596 |
| 597 } } // namespace v8::internal | 597 } } // namespace v8::internal |
| 598 | 598 |
| 599 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_ | 599 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |