| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 explicit VirtualFrame(VirtualFrame* original); | 69 explicit VirtualFrame(VirtualFrame* original); |
| 70 | 70 |
| 71 // Create a duplicate of an existing valid frame element. | 71 // Create a duplicate of an existing valid frame element. |
| 72 FrameElement CopyElementAt(int index); | 72 FrameElement CopyElementAt(int index); |
| 73 | 73 |
| 74 // The height of the virtual expression stack. | 74 // The height of the virtual expression stack. |
| 75 int height() const { | 75 int height() const { |
| 76 return elements_.length() - expression_base_index(); | 76 return elements_.length() - expression_base_index(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 int register_count(Register reg) { | 79 int register_index(Register reg) { |
| 80 return frame_registers_.count(reg); | 80 return register_locations_[reg.code()]; |
| 81 } |
| 82 |
| 83 bool is_used(int reg_code) { |
| 84 return register_locations_[reg_code] != kIllegalIndex; |
| 85 } |
| 86 |
| 87 bool is_used(Register reg) { |
| 88 return is_used(reg.code()) != kIllegalIndex; |
| 81 } | 89 } |
| 82 | 90 |
| 83 // Add extra in-memory elements to the top of the frame to match an actual | 91 // Add extra in-memory elements to the top of the frame to match an actual |
| 84 // frame (eg, the frame after an exception handler is pushed). No code is | 92 // frame (eg, the frame after an exception handler is pushed). No code is |
| 85 // emitted. | 93 // emitted. |
| 86 void Adjust(int count); | 94 void Adjust(int count); |
| 87 | 95 |
| 88 // Forget elements from the top of the frame to match an actual frame (eg, | 96 // Forget elements from the top of the frame to match an actual frame (eg, |
| 89 // the frame after a runtime call). No code is emitted. | 97 // the frame after a runtime call). No code is emitted. |
| 90 void Forget(int count); | 98 void Forget(int count); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 int stack_pointer_; | 343 int stack_pointer_; |
| 336 | 344 |
| 337 // The index of the element that is at the processor's frame pointer | 345 // The index of the element that is at the processor's frame pointer |
| 338 // (the fp register). | 346 // (the fp register). |
| 339 int frame_pointer_; | 347 int frame_pointer_; |
| 340 | 348 |
| 341 // The index of the register frame element using each register, or | 349 // The index of the register frame element using each register, or |
| 342 // kIllegalIndex if a register is not on the frame. | 350 // kIllegalIndex if a register is not on the frame. |
| 343 int register_locations_[kNumRegisters]; | 351 int register_locations_[kNumRegisters]; |
| 344 | 352 |
| 345 // The frame has an embedded register file that it uses to track registers | |
| 346 // used in the frame. | |
| 347 RegisterFile frame_registers_; | |
| 348 | |
| 349 // The index of the first parameter. The receiver lies below the first | 353 // The index of the first parameter. The receiver lies below the first |
| 350 // parameter. | 354 // parameter. |
| 351 int param0_index() const { return 1; } | 355 int param0_index() const { return 1; } |
| 352 | 356 |
| 353 // The index of the context slot in the frame. | 357 // The index of the context slot in the frame. |
| 354 int context_index() const { | 358 int context_index() const { |
| 355 ASSERT(frame_pointer_ != kIllegalIndex); | 359 ASSERT(frame_pointer_ != kIllegalIndex); |
| 356 return frame_pointer_ - 1; | 360 return frame_pointer_ - 1; |
| 357 } | 361 } |
| 358 | 362 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 466 |
| 463 bool Equals(VirtualFrame* other); | 467 bool Equals(VirtualFrame* other); |
| 464 | 468 |
| 465 friend class JumpTarget; | 469 friend class JumpTarget; |
| 466 }; | 470 }; |
| 467 | 471 |
| 468 | 472 |
| 469 } } // namespace v8::internal | 473 } } // namespace v8::internal |
| 470 | 474 |
| 471 #endif // V8_VIRTUAL_FRAME_ARM_H_ | 475 #endif // V8_VIRTUAL_FRAME_ARM_H_ |
| OLD | NEW |