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 5981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5992 | 5992 |
5993 | 5993 |
5994 intptr_t Instance::GetNativeField(Isolate* isolate, int index) const { | 5994 intptr_t Instance::GetNativeField(Isolate* isolate, int index) const { |
5995 ASSERT(IsValidNativeIndex(index)); | 5995 ASSERT(IsValidNativeIndex(index)); |
5996 NoGCScope no_gc; | 5996 NoGCScope no_gc; |
5997 RawTypedData* native_fields = | 5997 RawTypedData* native_fields = |
5998 reinterpret_cast<RawTypedData*>(*NativeFieldsAddr()); | 5998 reinterpret_cast<RawTypedData*>(*NativeFieldsAddr()); |
5999 if (native_fields == TypedData::null()) { | 5999 if (native_fields == TypedData::null()) { |
6000 return 0; | 6000 return 0; |
6001 } | 6001 } |
6002 return *(reinterpret_cast<intptr_t*>(native_fields->ptr()->data_) + index); | 6002 return reinterpret_cast<intptr_t*>(native_fields->ptr()->data_)[index]; |
6003 } | 6003 } |
6004 | 6004 |
6005 | 6005 |
6006 bool String::Equals(const String& str) const { | 6006 bool String::Equals(const String& str) const { |
6007 if (raw() == str.raw()) { | 6007 if (raw() == str.raw()) { |
6008 return true; // Both handles point to the same raw instance. | 6008 return true; // Both handles point to the same raw instance. |
6009 } | 6009 } |
6010 if (str.IsNull()) { | 6010 if (str.IsNull()) { |
6011 return false; | 6011 return false; |
6012 } | 6012 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6048 | 6048 |
6049 | 6049 |
6050 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6050 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6051 intptr_t index) { | 6051 intptr_t index) { |
6052 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6052 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6053 } | 6053 } |
6054 | 6054 |
6055 } // namespace dart | 6055 } // namespace dart |
6056 | 6056 |
6057 #endif // VM_OBJECT_H_ | 6057 #endif // VM_OBJECT_H_ |
OLD | NEW |