| 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 VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define 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 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 bool TestParameterType(TypeTestKind test_kind, | 1990 bool TestParameterType(TypeTestKind test_kind, |
| 1991 intptr_t parameter_position, | 1991 intptr_t parameter_position, |
| 1992 intptr_t other_parameter_position, | 1992 intptr_t other_parameter_position, |
| 1993 const AbstractTypeArguments& type_arguments, | 1993 const AbstractTypeArguments& type_arguments, |
| 1994 const Function& other, | 1994 const Function& other, |
| 1995 const AbstractTypeArguments& other_type_arguments, | 1995 const AbstractTypeArguments& other_type_arguments, |
| 1996 Error* bound_error) const; | 1996 Error* bound_error) const; |
| 1997 | 1997 |
| 1998 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object); | 1998 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object); |
| 1999 friend class Class; | 1999 friend class Class; |
| 2000 friend class RawFunction; |
| 2000 }; | 2001 }; |
| 2001 | 2002 |
| 2002 | 2003 |
| 2003 class ClosureData: public Object { | 2004 class ClosureData: public Object { |
| 2004 public: | 2005 public: |
| 2005 static intptr_t InstanceSize() { | 2006 static intptr_t InstanceSize() { |
| 2006 return RoundedAllocationSize(sizeof(RawClosureData)); | 2007 return RoundedAllocationSize(sizeof(RawClosureData)); |
| 2007 } | 2008 } |
| 2008 | 2009 |
| 2009 private: | 2010 private: |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3347 intptr_t BinarySearchInSCallTable(uword pc) const; | 3348 intptr_t BinarySearchInSCallTable(uword pc) const; |
| 3348 | 3349 |
| 3349 // New is a private method as RawInstruction and RawCode objects should | 3350 // New is a private method as RawInstruction and RawCode objects should |
| 3350 // only be created using the Code::FinalizeCode method. This method creates | 3351 // only be created using the Code::FinalizeCode method. This method creates |
| 3351 // the RawInstruction and RawCode objects, sets up the pointer offsets | 3352 // the RawInstruction and RawCode objects, sets up the pointer offsets |
| 3352 // and links the two in a GC safe manner. | 3353 // and links the two in a GC safe manner. |
| 3353 static RawCode* New(intptr_t pointer_offsets_length); | 3354 static RawCode* New(intptr_t pointer_offsets_length); |
| 3354 | 3355 |
| 3355 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); | 3356 FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object); |
| 3356 friend class Class; | 3357 friend class Class; |
| 3358 |
| 3359 // So that the RawFunction pointer visitor can determine whether code the |
| 3360 // function points to is optimized. |
| 3361 friend class RawFunction; |
| 3357 }; | 3362 }; |
| 3358 | 3363 |
| 3359 | 3364 |
| 3360 class Context : public Object { | 3365 class Context : public Object { |
| 3361 public: | 3366 public: |
| 3362 RawContext* parent() const { return raw_ptr()->parent_; } | 3367 RawContext* parent() const { return raw_ptr()->parent_; } |
| 3363 void set_parent(const Context& parent) const { | 3368 void set_parent(const Context& parent) const { |
| 3364 ASSERT(parent.IsNull() || parent.isolate() == Isolate::Current()); | 3369 ASSERT(parent.IsNull() || parent.isolate() == Isolate::Current()); |
| 3365 StorePointer(&raw_ptr()->parent_, parent.raw()); | 3370 StorePointer(&raw_ptr()->parent_, parent.raw()); |
| 3366 } | 3371 } |
| (...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4972 Snapshot::Kind kind); | 4977 Snapshot::Kind kind); |
| 4973 | 4978 |
| 4974 FINAL_HEAP_OBJECT_IMPLEMENTATION(String, Instance); | 4979 FINAL_HEAP_OBJECT_IMPLEMENTATION(String, Instance); |
| 4975 | 4980 |
| 4976 friend class Class; | 4981 friend class Class; |
| 4977 friend class Symbols; | 4982 friend class Symbols; |
| 4978 friend class OneByteString; | 4983 friend class OneByteString; |
| 4979 friend class TwoByteString; | 4984 friend class TwoByteString; |
| 4980 friend class ExternalOneByteString; | 4985 friend class ExternalOneByteString; |
| 4981 friend class ExternalTwoByteString; | 4986 friend class ExternalTwoByteString; |
| 4987 // So that the MarkingVisitor can print a debug string from a NoHandleScope. |
| 4988 friend class MarkingVisitor; |
| 4982 }; | 4989 }; |
| 4983 | 4990 |
| 4984 | 4991 |
| 4985 class OneByteString : public AllStatic { | 4992 class OneByteString : public AllStatic { |
| 4986 public: | 4993 public: |
| 4987 static int32_t CharAt(const String& str, intptr_t index) { | 4994 static int32_t CharAt(const String& str, intptr_t index) { |
| 4988 return *CharAddr(str, index); | 4995 return *CharAddr(str, index); |
| 4989 } | 4996 } |
| 4990 | 4997 |
| 4991 static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) { | 4998 static void SetCharAt(const String& str, intptr_t index, uint8_t code_point) { |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6387 | 6394 |
| 6388 | 6395 |
| 6389 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6396 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6390 intptr_t index) { | 6397 intptr_t index) { |
| 6391 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6398 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6392 } | 6399 } |
| 6393 | 6400 |
| 6394 } // namespace dart | 6401 } // namespace dart |
| 6395 | 6402 |
| 6396 #endif // VM_OBJECT_H_ | 6403 #endif // VM_OBJECT_H_ |
| OLD | NEW |