| 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 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 bool ContainsInstructionAt(uword addr) const { | 2898 bool ContainsInstructionAt(uword addr) const { |
| 2899 const Instructions& instr = Instructions::Handle(instructions()); | 2899 const Instructions& instr = Instructions::Handle(instructions()); |
| 2900 const uword offset = addr - instr.EntryPoint(); | 2900 const uword offset = addr - instr.EntryPoint(); |
| 2901 return offset < static_cast<uword>(instr.size()); | 2901 return offset < static_cast<uword>(instr.size()); |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 RawPcDescriptors* pc_descriptors() const { | 2904 RawPcDescriptors* pc_descriptors() const { |
| 2905 return raw_ptr()->pc_descriptors_; | 2905 return raw_ptr()->pc_descriptors_; |
| 2906 } | 2906 } |
| 2907 void set_pc_descriptors(const PcDescriptors& descriptors) const { | 2907 void set_pc_descriptors(const PcDescriptors& descriptors) const { |
| 2908 ASSERT(descriptors.IsOld()); |
| 2908 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw()); | 2909 StorePointer(&raw_ptr()->pc_descriptors_, descriptors.raw()); |
| 2909 } | 2910 } |
| 2910 | 2911 |
| 2911 // Array of DeoptInfo objects. | 2912 // Array of DeoptInfo objects. |
| 2912 RawArray* deopt_info_array() const { | 2913 RawArray* deopt_info_array() const { |
| 2913 return raw_ptr()->deopt_info_array_; | 2914 return raw_ptr()->deopt_info_array_; |
| 2914 } | 2915 } |
| 2915 void set_deopt_info_array(const Array& array) const; | 2916 void set_deopt_info_array(const Array& array) const; |
| 2916 | 2917 |
| 2917 RawArray* object_table() const { | 2918 RawArray* object_table() const { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 }; | 2977 }; |
| 2977 | 2978 |
| 2978 | 2979 |
| 2979 const Comments& comments() const; | 2980 const Comments& comments() const; |
| 2980 void set_comments(const Comments& comments) const; | 2981 void set_comments(const Comments& comments) const; |
| 2981 | 2982 |
| 2982 RawLocalVarDescriptors* var_descriptors() const { | 2983 RawLocalVarDescriptors* var_descriptors() const { |
| 2983 return raw_ptr()->var_descriptors_; | 2984 return raw_ptr()->var_descriptors_; |
| 2984 } | 2985 } |
| 2985 void set_var_descriptors(const LocalVarDescriptors& value) const { | 2986 void set_var_descriptors(const LocalVarDescriptors& value) const { |
| 2987 ASSERT(value.IsOld()); |
| 2986 StorePointer(&raw_ptr()->var_descriptors_, value.raw()); | 2988 StorePointer(&raw_ptr()->var_descriptors_, value.raw()); |
| 2987 } | 2989 } |
| 2988 | 2990 |
| 2989 RawExceptionHandlers* exception_handlers() const { | 2991 RawExceptionHandlers* exception_handlers() const { |
| 2990 return raw_ptr()->exception_handlers_; | 2992 return raw_ptr()->exception_handlers_; |
| 2991 } | 2993 } |
| 2992 void set_exception_handlers(const ExceptionHandlers& handlers) const { | 2994 void set_exception_handlers(const ExceptionHandlers& handlers) const { |
| 2995 ASSERT(handlers.IsOld()); |
| 2993 StorePointer(&raw_ptr()->exception_handlers_, handlers.raw()); | 2996 StorePointer(&raw_ptr()->exception_handlers_, handlers.raw()); |
| 2994 } | 2997 } |
| 2995 | 2998 |
| 2996 RawFunction* function() const { | 2999 RawFunction* function() const { |
| 2997 return raw_ptr()->function_; | 3000 return raw_ptr()->function_; |
| 2998 } | 3001 } |
| 2999 void set_function(const Function& function) const { | 3002 void set_function(const Function& function) const { |
| 3003 ASSERT(function.IsOld()); |
| 3000 StorePointer(&raw_ptr()->function_, function.raw()); | 3004 StorePointer(&raw_ptr()->function_, function.raw()); |
| 3001 } | 3005 } |
| 3002 | 3006 |
| 3003 // We would have a VisitPointers function here to traverse all the | 3007 // We would have a VisitPointers function here to traverse all the |
| 3004 // embedded objects in the instructions using pointer_offsets. | 3008 // embedded objects in the instructions using pointer_offsets. |
| 3005 | 3009 |
| 3006 static const intptr_t kBytesPerElement = | 3010 static const intptr_t kBytesPerElement = |
| 3007 sizeof(reinterpret_cast<RawCode*>(0)->data_[0]); | 3011 sizeof(reinterpret_cast<RawCode*>(0)->data_[0]); |
| 3008 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 3012 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
| 3009 | 3013 |
| (...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6025 | 6029 |
| 6026 | 6030 |
| 6027 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6031 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6028 intptr_t index) { | 6032 intptr_t index) { |
| 6029 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6033 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6030 } | 6034 } |
| 6031 | 6035 |
| 6032 } // namespace dart | 6036 } // namespace dart |
| 6033 | 6037 |
| 6034 #endif // VM_OBJECT_H_ | 6038 #endif // VM_OBJECT_H_ |
| OLD | NEW |