OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // - CodeCache | 143 // - CodeCache |
144 // | 144 // |
145 // Formats of Object*: | 145 // Formats of Object*: |
146 // Smi: [31 bit signed int] 0 | 146 // Smi: [31 bit signed int] 0 |
147 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 | 147 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 |
148 // Failure: [30 bit signed int] 11 | 148 // Failure: [30 bit signed int] 11 |
149 | 149 |
150 namespace v8 { | 150 namespace v8 { |
151 namespace internal { | 151 namespace internal { |
152 | 152 |
| 153 // Forward declarations |
| 154 class LookupCacheEntry; |
| 155 |
153 enum CompareMapMode { | 156 enum CompareMapMode { |
154 REQUIRE_EXACT_MAP, | 157 REQUIRE_EXACT_MAP, |
155 ALLOW_ELEMENT_TRANSITION_MAPS | 158 ALLOW_ELEMENT_TRANSITION_MAPS |
156 }; | 159 }; |
157 | 160 |
158 enum KeyedAccessStoreMode { | 161 enum KeyedAccessStoreMode { |
159 STANDARD_STORE, | 162 STANDARD_STORE, |
160 STORE_TRANSITION_SMI_TO_OBJECT, | 163 STORE_TRANSITION_SMI_TO_OBJECT, |
161 STORE_TRANSITION_SMI_TO_DOUBLE, | 164 STORE_TRANSITION_SMI_TO_DOUBLE, |
162 STORE_TRANSITION_DOUBLE_TO_OBJECT, | 165 STORE_TRANSITION_DOUBLE_TO_OBJECT, |
(...skipping 9357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9520 static inline int set(int value, int bit_position, bool v) { | 9523 static inline int set(int value, int bit_position, bool v) { |
9521 if (v) { | 9524 if (v) { |
9522 value |= (1 << bit_position); | 9525 value |= (1 << bit_position); |
9523 } else { | 9526 } else { |
9524 value &= ~(1 << bit_position); | 9527 value &= ~(1 << bit_position); |
9525 } | 9528 } |
9526 return value; | 9529 return value; |
9527 } | 9530 } |
9528 }; | 9531 }; |
9529 | 9532 |
| 9533 |
| 9534 class LookupCache { |
| 9535 public: |
| 9536 explicit LookupCache(Isolate* isolate); |
| 9537 ~LookupCache(); |
| 9538 |
| 9539 void Lookup(Handle<Object> obj, |
| 9540 Handle<Name> name, |
| 9541 LookupResult* result, |
| 9542 bool set_property = false); |
| 9543 MUST_USE_RESULT MaybeObject* GetProperty(Handle<Object> obj, |
| 9544 Handle<Name> name); |
| 9545 MUST_USE_RESULT MaybeObject* SetProperty(Handle<Object> obj, |
| 9546 Handle<Name> name, |
| 9547 Handle<Object> value); |
| 9548 |
| 9549 private: |
| 9550 static const int kCacheEntryCount = 7; |
| 9551 |
| 9552 Isolate* isolate_; |
| 9553 int count_; |
| 9554 LookupCacheEntry* entries_[kCacheEntryCount]; |
| 9555 int hidden_count_; |
| 9556 LookupCacheEntry* hidden_entries_[kCacheEntryCount]; |
| 9557 }; |
| 9558 |
9530 } } // namespace v8::internal | 9559 } } // namespace v8::internal |
9531 | 9560 |
9532 #endif // V8_OBJECTS_H_ | 9561 #endif // V8_OBJECTS_H_ |
OLD | NEW |