| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 FrameElement() : type_(MEMORY) {} | 46 FrameElement() : type_(MEMORY) {} |
| 47 | 47 |
| 48 explicit FrameElement(Handle<Object> value) : type_(CONSTANT | kDirtyBit) { | 48 explicit FrameElement(Handle<Object> value) : type_(CONSTANT | kDirtyBit) { |
| 49 data_.handle_ = value.location(); | 49 data_.handle_ = value.location(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 Type type() const { return static_cast<Type>(type_ & kTypeMask); } | 52 Type type() const { return static_cast<Type>(type_ & kTypeMask); } |
| 53 | 53 |
| 54 bool is_dirty() const { | 54 bool is_dirty() const { |
| 55 STATIC_ASSERT(kDirtyBit > LAST_TYPE); | |
| 56 return (type_ & kDirtyBit) != 0; | 55 return (type_ & kDirtyBit) != 0; |
| 57 } | 56 } |
| 58 | 57 |
| 59 void set_dirty() { | 58 void set_dirty() { |
| 60 ASSERT(type() != MEMORY); | 59 ASSERT(type() != MEMORY); |
| 61 type_ = type_ | kDirtyBit; | 60 type_ = type_ | kDirtyBit; |
| 62 } | 61 } |
| 63 | 62 |
| 64 void clear_dirty() { | 63 void clear_dirty() { |
| 65 ASSERT(type() != MEMORY); | 64 ASSERT(type() != MEMORY); |
| 66 type_ = type_ & ~kDirtyBit; | 65 type_ = type_ & ~kDirtyBit; |
| 67 } | 66 } |
| 68 | 67 |
| 69 Handle<Object> handle() const { | 68 Handle<Object> handle() const { |
| 70 ASSERT(type() == CONSTANT); | 69 ASSERT(type() == CONSTANT); |
| 71 return Handle<Object>(data_.handle_); | 70 return Handle<Object>(data_.handle_); |
| 72 } | 71 } |
| 73 | 72 |
| 74 private: | 73 private: |
| 75 static const int kDirtyBit = 1 << 8; | 74 static const int kDirtyBit = 1 << 8; |
| 76 static const int kTypeMask = kDirtyBit - 1; | 75 static const int kTypeMask = kDirtyBit - 1; |
| 77 | 76 |
| 77 STATIC_ASSERT(kDirtyBit > LAST_TYPE); |
| 78 |
| 78 // The element's type and a dirty bit. The dirty bit can be cleared | 79 // The element's type and a dirty bit. The dirty bit can be cleared |
| 79 // for non-memory elements to indicate that the element agrees with | 80 // for non-memory elements to indicate that the element agrees with |
| 80 // the value in memory in the actual frame. | 81 // the value in memory in the actual frame. |
| 81 int type_; | 82 int type_; |
| 82 | 83 |
| 83 union { | 84 union { |
| 84 Object** handle_; | 85 Object** handle_; |
| 85 } data_; | 86 } data_; |
| 86 }; | 87 }; |
| 87 | 88 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 261 |
| 261 // Spill the topmost elements of the frame to memory (eg, they are the | 262 // Spill the topmost elements of the frame to memory (eg, they are the |
| 262 // arguments to a call) and all registers. | 263 // arguments to a call) and all registers. |
| 263 void PrepareForCall(int count); | 264 void PrepareForCall(int count); |
| 264 }; | 265 }; |
| 265 | 266 |
| 266 | 267 |
| 267 } } // namespace v8::internal | 268 } } // namespace v8::internal |
| 268 | 269 |
| 269 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 270 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |