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