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. |
10247 DECL_ACCESSORS(getter, Object) | 10248 DECL_ACCESSORS(getter, Object) |
10248 DECL_ACCESSORS(setter, Object) | 10249 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) |
10249 DECL_ACCESSORS(data, Object) | 10253 DECL_ACCESSORS(data, Object) |
10250 | 10254 |
| 10255 #ifdef USE_SIMULATOR |
| 10256 static Address redirect(Isolate* isolate, Address address, |
| 10257 AccessorComponent component); |
| 10258 Address redirected_getter() const; |
| 10259 #endif |
| 10260 |
10251 // Dispatched behavior. | 10261 // Dispatched behavior. |
10252 DECLARE_PRINTER(AccessorInfo) | 10262 DECLARE_PRINTER(AccessorInfo) |
10253 | 10263 |
10254 inline bool all_can_read(); | 10264 inline bool all_can_read(); |
10255 inline void set_all_can_read(bool value); | 10265 inline void set_all_can_read(bool value); |
10256 | 10266 |
10257 inline bool all_can_write(); | 10267 inline bool all_can_write(); |
10258 inline void set_all_can_write(bool value); | 10268 inline void set_all_can_write(bool value); |
10259 | 10269 |
10260 inline bool is_special_data_property(); | 10270 inline bool is_special_data_property(); |
(...skipping 15 matching lines...) Expand all Loading... |
10276 | 10286 |
10277 // Append all descriptors to the array that are not already there. | 10287 // Append all descriptors to the array that are not already there. |
10278 // Return number added. | 10288 // Return number added. |
10279 static int AppendUnique(Handle<Object> descriptors, | 10289 static int AppendUnique(Handle<Object> descriptors, |
10280 Handle<FixedArray> array, | 10290 Handle<FixedArray> array, |
10281 int valid_descriptors); | 10291 int valid_descriptors); |
10282 | 10292 |
10283 static const int kNameOffset = HeapObject::kHeaderSize; | 10293 static const int kNameOffset = HeapObject::kHeaderSize; |
10284 static const int kFlagOffset = kNameOffset + kPointerSize; | 10294 static const int kFlagOffset = kNameOffset + kPointerSize; |
10285 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; | 10295 static const int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize; |
10286 static const int kGetterOffset = kExpectedReceiverTypeOffset + kPointerSize; | 10296 static const int kSetterOffset = kExpectedReceiverTypeOffset + kPointerSize; |
10287 static const int kSetterOffset = kGetterOffset + kPointerSize; | 10297 static const int kGetterOffset = kSetterOffset + kPointerSize; |
10288 static const int kDataOffset = kSetterOffset + kPointerSize; | 10298 #ifdef USE_SIMULATOR |
| 10299 static const int kJsGetterOffset = kGetterOffset + kPointerSize; |
| 10300 #else |
| 10301 static const int kJsGetterOffset = kGetterOffset; |
| 10302 #endif |
| 10303 static const int kDataOffset = kJsGetterOffset + kPointerSize; |
10289 static const int kSize = kDataOffset + kPointerSize; | 10304 static const int kSize = kDataOffset + kPointerSize; |
10290 | 10305 |
10291 | 10306 |
10292 private: | 10307 private: |
10293 inline bool HasExpectedReceiverType(); | 10308 inline bool HasExpectedReceiverType(); |
10294 | 10309 |
10295 // Bit positions in flag. | 10310 // Bit positions in flag. |
10296 static const int kAllCanReadBit = 0; | 10311 static const int kAllCanReadBit = 0; |
10297 static const int kAllCanWriteBit = 1; | 10312 static const int kAllCanWriteBit = 1; |
10298 static const int kSpecialDataProperty = 2; | 10313 static const int kSpecialDataProperty = 2; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10780 } | 10795 } |
10781 return value; | 10796 return value; |
10782 } | 10797 } |
10783 }; | 10798 }; |
10784 | 10799 |
10785 | 10800 |
10786 } // NOLINT, false-positive due to second-order macros. | 10801 } // NOLINT, false-positive due to second-order macros. |
10787 } // NOLINT, false-positive due to second-order macros. | 10802 } // NOLINT, false-positive due to second-order macros. |
10788 | 10803 |
10789 #endif // V8_OBJECTS_H_ | 10804 #endif // V8_OBJECTS_H_ |
OLD | NEW |