OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 10226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10237 // the request is ignored. | 10237 // the request is ignored. |
10238 // | 10238 // |
10239 // If the accessor in the prototype has the READ_ONLY property attribute, then | 10239 // If the accessor in the prototype has the READ_ONLY property attribute, then |
10240 // a new value is added to the derived object when the property is set. | 10240 // a new value is added to the derived object when the property is set. |
10241 // This shadows the accessor in the prototype. | 10241 // This shadows the accessor in the prototype. |
10242 class AccessorInfo: public Struct { | 10242 class AccessorInfo: public Struct { |
10243 public: | 10243 public: |
10244 DECL_ACCESSORS(name, Object) | 10244 DECL_ACCESSORS(name, Object) |
10245 DECL_INT_ACCESSORS(flag) | 10245 DECL_INT_ACCESSORS(flag) |
10246 DECL_ACCESSORS(expected_receiver_type, Object) | 10246 DECL_ACCESSORS(expected_receiver_type, Object) |
10247 // This directly points at a foreign C function to be used from the runtime. | |
10248 DECL_ACCESSORS(getter, Object) | 10247 DECL_ACCESSORS(getter, Object) |
10249 DECL_ACCESSORS(setter, Object) | 10248 DECL_ACCESSORS(setter, Object) |
10250 // This either points at the same as above, or a trampoline in case we are | |
10251 // running with the simulator. Use these entries from generated code. | |
10252 DECL_ACCESSORS(js_getter, Object) | |
10253 DECL_ACCESSORS(data, Object) | 10249 DECL_ACCESSORS(data, Object) |
10254 | 10250 |
10255 #ifdef USE_SIMULATOR | |
10256 static Address redirect(Isolate* isolate, Address address, | |
10257 AccessorComponent component); | |
10258 Address redirected_getter() const; | |
10259 #endif | |
10260 | |
10261 // Dispatched behavior. | 10251 // Dispatched behavior. |
10262 DECLARE_PRINTER(AccessorInfo) | 10252 DECLARE_PRINTER(AccessorInfo) |
10263 | 10253 |
10264 inline bool all_can_read(); | 10254 inline bool all_can_read(); |
10265 inline void set_all_can_read(bool value); | 10255 inline void set_all_can_read(bool value); |
10266 | 10256 |
10267 inline bool all_can_write(); | 10257 inline bool all_can_write(); |
10268 inline void set_all_can_write(bool value); | 10258 inline void set_all_can_write(bool value); |
10269 | 10259 |
10270 inline bool is_special_data_property(); | 10260 inline bool is_special_data_property(); |
(...skipping 15 matching lines...) Expand all Loading... |
10286 | 10276 |
10287 // Append all descriptors to the array that are not already there. | 10277 // Append all descriptors to the array that are not already there. |
10288 // Return number added. | 10278 // Return number added. |
10289 static int AppendUnique(Handle<Object> descriptors, | 10279 static int AppendUnique(Handle<Object> descriptors, |
10290 Handle<FixedArray> array, | 10280 Handle<FixedArray> array, |
10291 int valid_descriptors); | 10281 int valid_descriptors); |
10292 | 10282 |
10293 static const int kNameOffset = HeapObject::kHeaderSize; | 10283 static const int kNameOffset = HeapObject::kHeaderSize; |
10294 static const int kFlagOffset = kNameOffset + kPointerSize; | 10284 static const int kFlagOffset = kNameOffset + kPointerSize; |
10295 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10285 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
10296 static const int kSetterOffset = kExpectedReceiverTypeOffset + kPointerSize; | 10286 static const int kGetterOffset = kExpectedReceiverTypeOffset + kPointerSize; |
10297 static const int kGetterOffset = kSetterOffset + kPointerSize; | 10287 static const int kSetterOffset = kGetterOffset + kPointerSize; |
10298 #ifdef USE_SIMULATOR | 10288 static const int kDataOffset = kSetterOffset + kPointerSize; |
10299 static const int kJsGetterOffset = kGetterOffset + kPointerSize; | |
10300 #else | |
10301 static const int kJsGetterOffset = kGetterOffset; | |
10302 #endif | |
10303 static const int kDataOffset = kJsGetterOffset + kPointerSize; | |
10304 static const int kSize = kDataOffset + kPointerSize; | 10289 static const int kSize = kDataOffset + kPointerSize; |
10305 | 10290 |
10306 | 10291 |
10307 private: | 10292 private: |
10308 inline bool HasExpectedReceiverType(); | 10293 inline bool HasExpectedReceiverType(); |
10309 | 10294 |
10310 // Bit positions in flag. | 10295 // Bit positions in flag. |
10311 static const int kAllCanReadBit = 0; | 10296 static const int kAllCanReadBit = 0; |
10312 static const int kAllCanWriteBit = 1; | 10297 static const int kAllCanWriteBit = 1; |
10313 static const int kSpecialDataProperty = 2; | 10298 static const int kSpecialDataProperty = 2; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10795 } | 10780 } |
10796 return value; | 10781 return value; |
10797 } | 10782 } |
10798 }; | 10783 }; |
10799 | 10784 |
10800 | 10785 |
10801 } // NOLINT, false-positive due to second-order macros. | 10786 } // NOLINT, false-positive due to second-order macros. |
10802 } // NOLINT, false-positive due to second-order macros. | 10787 } // NOLINT, false-positive due to second-order macros. |
10803 | 10788 |
10804 #endif // V8_OBJECTS_H_ | 10789 #endif // V8_OBJECTS_H_ |
OLD | NEW |