Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RUNTIME_VM_OBJECT_H_ | 5 #ifndef RUNTIME_VM_OBJECT_H_ |
| 6 #define RUNTIME_VM_OBJECT_H_ | 6 #define RUNTIME_VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2395 // If none exists yet, create one and remember it. | 2395 // If none exists yet, create one and remember it. |
| 2396 RawFunction* ImplicitClosureFunction() const; | 2396 RawFunction* ImplicitClosureFunction() const; |
| 2397 void DropUncompiledImplicitClosureFunction() const; | 2397 void DropUncompiledImplicitClosureFunction() const; |
| 2398 | 2398 |
| 2399 // Return the closure implicitly created for this function. | 2399 // Return the closure implicitly created for this function. |
| 2400 // If none exists yet, create one and remember it. | 2400 // If none exists yet, create one and remember it. |
| 2401 RawInstance* ImplicitStaticClosure() const; | 2401 RawInstance* ImplicitStaticClosure() const; |
| 2402 | 2402 |
| 2403 RawInstance* ImplicitInstanceClosure(const Instance& receiver) const; | 2403 RawInstance* ImplicitInstanceClosure(const Instance& receiver) const; |
| 2404 | 2404 |
| 2405 RawSmi* GetClosureHashCode() const; | 2405 intptr_t GetClosureHashCode() const; |
| 2406 | 2406 |
| 2407 // Redirection information for a redirecting factory. | 2407 // Redirection information for a redirecting factory. |
| 2408 bool IsRedirectingFactory() const; | 2408 bool IsRedirectingFactory() const; |
| 2409 RawType* RedirectionType() const; | 2409 RawType* RedirectionType() const; |
| 2410 void SetRedirectionType(const Type& type) const; | 2410 void SetRedirectionType(const Type& type) const; |
| 2411 RawString* RedirectionIdentifier() const; | 2411 RawString* RedirectionIdentifier() const; |
| 2412 void SetRedirectionIdentifier(const String& identifier) const; | 2412 void SetRedirectionIdentifier(const String& identifier) const; |
| 2413 RawFunction* RedirectionTarget() const; | 2413 RawFunction* RedirectionTarget() const; |
| 2414 void SetRedirectionTarget(const Function& target) const; | 2414 void SetRedirectionTarget(const Function& target) const; |
| 2415 | 2415 |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3065 RawFunction* parent_function() const { return raw_ptr()->parent_function_; } | 3065 RawFunction* parent_function() const { return raw_ptr()->parent_function_; } |
| 3066 void set_parent_function(const Function& value) const; | 3066 void set_parent_function(const Function& value) const; |
| 3067 | 3067 |
| 3068 // Signature type of this closure function. | 3068 // Signature type of this closure function. |
| 3069 RawType* signature_type() const { return raw_ptr()->signature_type_; } | 3069 RawType* signature_type() const { return raw_ptr()->signature_type_; } |
| 3070 void set_signature_type(const Type& value) const; | 3070 void set_signature_type(const Type& value) const; |
| 3071 | 3071 |
| 3072 RawInstance* implicit_static_closure() const { return raw_ptr()->closure_; } | 3072 RawInstance* implicit_static_closure() const { return raw_ptr()->closure_; } |
| 3073 void set_implicit_static_closure(const Instance& closure) const; | 3073 void set_implicit_static_closure(const Instance& closure) const; |
| 3074 | 3074 |
| 3075 RawObject* hash() const { return raw_ptr()->hash_; } | |
| 3076 void set_hash(intptr_t value) const; | |
| 3077 | |
| 3078 static RawClosureData* New(); | 3075 static RawClosureData* New(); |
| 3079 | 3076 |
| 3080 FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object); | 3077 FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object); |
| 3081 friend class Class; | 3078 friend class Class; |
| 3082 friend class Function; | 3079 friend class Function; |
| 3083 friend class HeapProfiler; | 3080 friend class HeapProfiler; |
| 3084 }; | 3081 }; |
| 3085 | 3082 |
| 3086 class SignatureData : public Object { | 3083 class SignatureData : public Object { |
| 3087 public: | 3084 public: |
| (...skipping 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5525 // the formal parameters given in param_names, and is invoked with | 5522 // the formal parameters given in param_names, and is invoked with |
| 5526 // the argument values given in param_values. | 5523 // the argument values given in param_values. |
| 5527 RawObject* Evaluate(const Class& method_cls, | 5524 RawObject* Evaluate(const Class& method_cls, |
| 5528 const String& expr, | 5525 const String& expr, |
| 5529 const Array& param_names, | 5526 const Array& param_names, |
| 5530 const Array& param_values) const; | 5527 const Array& param_values) const; |
| 5531 | 5528 |
| 5532 // Equivalent to invoking hashCode on this instance. | 5529 // Equivalent to invoking hashCode on this instance. |
| 5533 virtual RawObject* HashCode() const; | 5530 virtual RawObject* HashCode() const; |
| 5534 | 5531 |
| 5532 // Equivalent to invoking identityHashCode on this instance. | |
|
rmacnak
2017/07/19 01:00:24
with this instance.
alexmarkov
2017/07/19 17:54:19
Done.
| |
| 5533 RawObject* IdentityHashCode() const; | |
| 5534 | |
| 5535 static intptr_t InstanceSize() { | 5535 static intptr_t InstanceSize() { |
| 5536 return RoundedAllocationSize(sizeof(RawInstance)); | 5536 return RoundedAllocationSize(sizeof(RawInstance)); |
| 5537 } | 5537 } |
| 5538 | 5538 |
| 5539 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew); | 5539 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew); |
| 5540 | 5540 |
| 5541 // Array/list element address computations. | 5541 // Array/list element address computations. |
| 5542 static intptr_t DataOffsetFor(intptr_t cid); | 5542 static intptr_t DataOffsetFor(intptr_t cid); |
| 5543 static intptr_t ElementSizeFor(intptr_t cid); | 5543 static intptr_t ElementSizeFor(intptr_t cid); |
| 5544 | 5544 |
| (...skipping 2788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8333 static intptr_t function_type_arguments_offset() { | 8333 static intptr_t function_type_arguments_offset() { |
| 8334 return OFFSET_OF(RawClosure, function_type_arguments_); | 8334 return OFFSET_OF(RawClosure, function_type_arguments_); |
| 8335 } | 8335 } |
| 8336 | 8336 |
| 8337 RawFunction* function() const { return raw_ptr()->function_; } | 8337 RawFunction* function() const { return raw_ptr()->function_; } |
| 8338 static intptr_t function_offset() { return OFFSET_OF(RawClosure, function_); } | 8338 static intptr_t function_offset() { return OFFSET_OF(RawClosure, function_); } |
| 8339 | 8339 |
| 8340 RawContext* context() const { return raw_ptr()->context_; } | 8340 RawContext* context() const { return raw_ptr()->context_; } |
| 8341 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); } | 8341 static intptr_t context_offset() { return OFFSET_OF(RawClosure, context_); } |
| 8342 | 8342 |
| 8343 RawInteger* cached_hash_code() const { return raw_ptr()->cached_hash_code_; } | |
|
rmacnak
2017/07/19 01:00:24
RawSmi*
alexmarkov
2017/07/19 17:54:19
Done.
| |
| 8344 static intptr_t cached_hash_code_offset() { | |
| 8345 return OFFSET_OF(RawClosure, cached_hash_code_); | |
| 8346 } | |
| 8347 | |
| 8343 static intptr_t InstanceSize() { | 8348 static intptr_t InstanceSize() { |
| 8344 return RoundedAllocationSize(sizeof(RawClosure)); | 8349 return RoundedAllocationSize(sizeof(RawClosure)); |
| 8345 } | 8350 } |
| 8346 | 8351 |
| 8347 // Returns true if all elements are OK for canonicalization. | 8352 // Returns true if all elements are OK for canonicalization. |
| 8348 virtual bool CheckAndCanonicalizeFields(Thread* thread, | 8353 virtual bool CheckAndCanonicalizeFields(Thread* thread, |
| 8349 const char** error_str) const { | 8354 const char** error_str) const { |
| 8350 // None of the fields of a closure are instances. | 8355 // None of the fields of a closure are instances. |
| 8351 return true; | 8356 return true; |
| 8352 } | 8357 } |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8913 | 8918 |
| 8914 inline void TypeArguments::SetHash(intptr_t value) const { | 8919 inline void TypeArguments::SetHash(intptr_t value) const { |
| 8915 // This is only safe because we create a new Smi, which does not cause | 8920 // This is only safe because we create a new Smi, which does not cause |
| 8916 // heap allocation. | 8921 // heap allocation. |
| 8917 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8922 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
| 8918 } | 8923 } |
| 8919 | 8924 |
| 8920 } // namespace dart | 8925 } // namespace dart |
| 8921 | 8926 |
| 8922 #endif // RUNTIME_VM_OBJECT_H_ | 8927 #endif // RUNTIME_VM_OBJECT_H_ |
| OLD | NEW |