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/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2381 // Called the first time an object is observed with ES7 Object.observe. | 2381 // Called the first time an object is observed with ES7 Object.observe. |
2382 static void SetObserved(Handle<JSObject> object); | 2382 static void SetObserved(Handle<JSObject> object); |
2383 | 2383 |
2384 // Copy object. | 2384 // Copy object. |
2385 enum DeepCopyHints { kNoHints = 0, kObjectIsShallow = 1 }; | 2385 enum DeepCopyHints { kNoHints = 0, kObjectIsShallow = 1 }; |
2386 | 2386 |
2387 MUST_USE_RESULT static MaybeHandle<JSObject> DeepCopy( | 2387 MUST_USE_RESULT static MaybeHandle<JSObject> DeepCopy( |
2388 Handle<JSObject> object, | 2388 Handle<JSObject> object, |
2389 AllocationSiteUsageContext* site_context, | 2389 AllocationSiteUsageContext* site_context, |
2390 DeepCopyHints hints = kNoHints); | 2390 DeepCopyHints hints = kNoHints); |
2391 MUST_USE_RESULT static MaybeHandle<JSObject> DeepCopy( | |
2392 Handle<JSObject> object, DeepCopyHints hints = kNoHints); | |
2393 MUST_USE_RESULT static MaybeHandle<JSObject> DeepWalk( | 2391 MUST_USE_RESULT static MaybeHandle<JSObject> DeepWalk( |
2394 Handle<JSObject> object, | 2392 Handle<JSObject> object, |
2395 AllocationSiteCreationContext* site_context); | 2393 AllocationSiteCreationContext* site_context); |
2396 | 2394 |
2397 DECLARE_CAST(JSObject) | 2395 DECLARE_CAST(JSObject) |
2398 | 2396 |
2399 // Dispatched behavior. | 2397 // Dispatched behavior. |
2400 void JSObjectShortPrint(StringStream* accumulator); | 2398 void JSObjectShortPrint(StringStream* accumulator); |
2401 DECLARE_PRINTER(JSObject) | 2399 DECLARE_PRINTER(JSObject) |
2402 DECLARE_VERIFIER(JSObject) | 2400 DECLARE_VERIFIER(JSObject) |
(...skipping 8061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10464 static const int kSize = kFastHandlerOffset + kPointerSize; | 10462 static const int kSize = kFastHandlerOffset + kPointerSize; |
10465 | 10463 |
10466 private: | 10464 private: |
10467 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); | 10465 DISALLOW_IMPLICIT_CONSTRUCTORS(CallHandlerInfo); |
10468 }; | 10466 }; |
10469 | 10467 |
10470 | 10468 |
10471 class TemplateInfo: public Struct { | 10469 class TemplateInfo: public Struct { |
10472 public: | 10470 public: |
10473 DECL_ACCESSORS(tag, Object) | 10471 DECL_ACCESSORS(tag, Object) |
10474 DECL_ACCESSORS(serial_number, Object) | 10472 inline int number_of_properties() const; |
10475 DECL_INT_ACCESSORS(number_of_properties) | 10473 inline void set_number_of_properties(int value); |
10476 DECL_ACCESSORS(property_list, Object) | 10474 DECL_ACCESSORS(property_list, Object) |
10477 DECL_ACCESSORS(property_accessors, Object) | 10475 DECL_ACCESSORS(property_accessors, Object) |
10478 | 10476 |
10479 DECLARE_VERIFIER(TemplateInfo) | 10477 DECLARE_VERIFIER(TemplateInfo) |
10480 | 10478 |
10481 static const int kTagOffset = HeapObject::kHeaderSize; | 10479 static const int kTagOffset = HeapObject::kHeaderSize; |
10482 static const int kSerialNumberOffset = kTagOffset + kPointerSize; | 10480 static const int kNumberOfProperties = kTagOffset + kPointerSize; |
10483 static const int kNumberOfProperties = kSerialNumberOffset + kPointerSize; | |
10484 static const int kPropertyListOffset = kNumberOfProperties + kPointerSize; | 10481 static const int kPropertyListOffset = kNumberOfProperties + kPointerSize; |
10485 static const int kPropertyAccessorsOffset = | 10482 static const int kPropertyAccessorsOffset = |
10486 kPropertyListOffset + kPointerSize; | 10483 kPropertyListOffset + kPointerSize; |
10487 static const int kPropertyIntrinsicsOffset = | 10484 static const int kPropertyIntrinsicsOffset = |
10488 kPropertyAccessorsOffset + kPointerSize; | 10485 kPropertyAccessorsOffset + kPointerSize; |
10489 static const int kHeaderSize = kPropertyIntrinsicsOffset + kPointerSize; | 10486 static const int kHeaderSize = kPropertyIntrinsicsOffset + kPointerSize; |
10490 | 10487 |
10491 private: | 10488 private: |
10492 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); | 10489 DISALLOW_IMPLICIT_CONSTRUCTORS(TemplateInfo); |
10493 }; | 10490 }; |
10494 | 10491 |
10495 | 10492 |
10496 class FunctionTemplateInfo: public TemplateInfo { | 10493 class FunctionTemplateInfo: public TemplateInfo { |
10497 public: | 10494 public: |
| 10495 DECL_ACCESSORS(serial_number, Object) |
10498 DECL_ACCESSORS(call_code, Object) | 10496 DECL_ACCESSORS(call_code, Object) |
10499 DECL_ACCESSORS(prototype_template, Object) | 10497 DECL_ACCESSORS(prototype_template, Object) |
10500 DECL_ACCESSORS(parent_template, Object) | 10498 DECL_ACCESSORS(parent_template, Object) |
10501 DECL_ACCESSORS(named_property_handler, Object) | 10499 DECL_ACCESSORS(named_property_handler, Object) |
10502 DECL_ACCESSORS(indexed_property_handler, Object) | 10500 DECL_ACCESSORS(indexed_property_handler, Object) |
10503 DECL_ACCESSORS(instance_template, Object) | 10501 DECL_ACCESSORS(instance_template, Object) |
10504 DECL_ACCESSORS(class_name, Object) | 10502 DECL_ACCESSORS(class_name, Object) |
10505 DECL_ACCESSORS(signature, Object) | 10503 DECL_ACCESSORS(signature, Object) |
10506 DECL_ACCESSORS(instance_call_handler, Object) | 10504 DECL_ACCESSORS(instance_call_handler, Object) |
10507 DECL_ACCESSORS(access_check_info, Object) | 10505 DECL_ACCESSORS(access_check_info, Object) |
(...skipping 13 matching lines...) Expand all Loading... |
10521 DECL_BOOLEAN_ACCESSORS(do_not_cache) | 10519 DECL_BOOLEAN_ACCESSORS(do_not_cache) |
10522 DECL_BOOLEAN_ACCESSORS(instantiated) | 10520 DECL_BOOLEAN_ACCESSORS(instantiated) |
10523 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) | 10521 DECL_BOOLEAN_ACCESSORS(accept_any_receiver) |
10524 | 10522 |
10525 DECLARE_CAST(FunctionTemplateInfo) | 10523 DECLARE_CAST(FunctionTemplateInfo) |
10526 | 10524 |
10527 // Dispatched behavior. | 10525 // Dispatched behavior. |
10528 DECLARE_PRINTER(FunctionTemplateInfo) | 10526 DECLARE_PRINTER(FunctionTemplateInfo) |
10529 DECLARE_VERIFIER(FunctionTemplateInfo) | 10527 DECLARE_VERIFIER(FunctionTemplateInfo) |
10530 | 10528 |
10531 static const int kCallCodeOffset = TemplateInfo::kHeaderSize; | 10529 static const int kSerialNumberOffset = TemplateInfo::kHeaderSize; |
| 10530 static const int kCallCodeOffset = kSerialNumberOffset + kPointerSize; |
10532 static const int kPrototypeTemplateOffset = | 10531 static const int kPrototypeTemplateOffset = |
10533 kCallCodeOffset + kPointerSize; | 10532 kCallCodeOffset + kPointerSize; |
10534 static const int kParentTemplateOffset = | 10533 static const int kParentTemplateOffset = |
10535 kPrototypeTemplateOffset + kPointerSize; | 10534 kPrototypeTemplateOffset + kPointerSize; |
10536 static const int kNamedPropertyHandlerOffset = | 10535 static const int kNamedPropertyHandlerOffset = |
10537 kParentTemplateOffset + kPointerSize; | 10536 kParentTemplateOffset + kPointerSize; |
10538 static const int kIndexedPropertyHandlerOffset = | 10537 static const int kIndexedPropertyHandlerOffset = |
10539 kNamedPropertyHandlerOffset + kPointerSize; | 10538 kNamedPropertyHandlerOffset + kPointerSize; |
10540 static const int kInstanceTemplateOffset = | 10539 static const int kInstanceTemplateOffset = |
10541 kIndexedPropertyHandlerOffset + kPointerSize; | 10540 kIndexedPropertyHandlerOffset + kPointerSize; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10806 } | 10805 } |
10807 return value; | 10806 return value; |
10808 } | 10807 } |
10809 }; | 10808 }; |
10810 | 10809 |
10811 | 10810 |
10812 } // NOLINT, false-positive due to second-order macros. | 10811 } // NOLINT, false-positive due to second-order macros. |
10813 } // NOLINT, false-positive due to second-order macros. | 10812 } // NOLINT, false-positive due to second-order macros. |
10814 | 10813 |
10815 #endif // V8_OBJECTS_H_ | 10814 #endif // V8_OBJECTS_H_ |
OLD | NEW |