OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 21 matching lines...) Expand all Loading... |
32 #include "register-allocator.h" | 32 #include "register-allocator.h" |
33 #include "scopes.h" | 33 #include "scopes.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 // On entry to a function, the virtual frame already contains the receiver, | 38 // On entry to a function, the virtual frame already contains the receiver, |
39 // the parameters, and a return address. All frame elements are in memory. | 39 // the parameters, and a return address. All frame elements are in memory. |
40 VirtualFrame::VirtualFrame() | 40 VirtualFrame::VirtualFrame() |
41 : element_count_(parameter_count() + 2), | 41 : element_count_(parameter_count() + 2), |
42 stack_pointer_(parameter_count() + 1) { | 42 top_of_stack_state_(NO_TOS_REGISTERS), |
43 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { | 43 register_allocation_map_(0) { } |
44 register_locations_[i] = kIllegalIndex; | |
45 } | |
46 } | |
47 | 44 |
48 | 45 |
49 // When cloned, a frame is a deep copy of the original. | 46 // When cloned, a frame is a deep copy of the original. |
50 VirtualFrame::VirtualFrame(VirtualFrame* original) | 47 VirtualFrame::VirtualFrame(VirtualFrame* original) |
51 : element_count_(original->element_count()), | 48 : element_count_(original->element_count()), |
52 stack_pointer_(original->stack_pointer_) { | 49 top_of_stack_state_(original->top_of_stack_state_), |
53 memcpy(®ister_locations_, | 50 register_allocation_map_(original->register_allocation_map_) { } |
54 original->register_locations_, | |
55 sizeof(register_locations_)); | |
56 } | |
57 | |
58 | |
59 void VirtualFrame::Push(Handle<Object> value) { | |
60 UNIMPLEMENTED(); | |
61 } | |
62 | 51 |
63 | 52 |
64 bool VirtualFrame::Equals(VirtualFrame* other) { | 53 bool VirtualFrame::Equals(VirtualFrame* other) { |
65 #ifdef DEBUG | 54 ASSERT(element_count() == other->element_count()); |
66 for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { | 55 if (top_of_stack_state_ != other->top_of_stack_state_) return false; |
67 if (register_location(i) != other->register_location(i)) { | 56 if (register_allocation_map_ != other->register_allocation_map_) return false; |
68 return false; | |
69 } | |
70 } | |
71 if (element_count() != other->element_count()) return false; | |
72 #endif | |
73 if (stack_pointer_ != other->stack_pointer_) return false; | |
74 | 57 |
75 return true; | 58 return true; |
76 } | 59 } |
77 | 60 |
78 | 61 |
79 void VirtualFrame::SetTypeForLocalAt(int index, TypeInfo info) { | 62 void VirtualFrame::PrepareForReturn() { |
80 UNIMPLEMENTED(); | 63 SpillAll(); |
81 } | 64 } |
82 | 65 |
83 | 66 |
84 // Everything is always spilled anyway. | |
85 void VirtualFrame::SpillAll() { | |
86 } | |
87 | |
88 | |
89 void VirtualFrame::PrepareForReturn() { | |
90 } | |
91 | |
92 | |
93 } } // namespace v8::internal | 67 } } // namespace v8::internal |
94 | 68 |
95 #endif // V8_VIRTUAL_FRAME_LIGHT_INL_H_ | 69 #endif // V8_VIRTUAL_FRAME_LIGHT_INL_H_ |
OLD | NEW |