| 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 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 Heap::Space space = Heap::kNew); | 2912 Heap::Space space = Heap::kNew); |
| 2913 | 2913 |
| 2914 static RawString* NewSymbol(const char* str); | 2914 static RawString* NewSymbol(const char* str); |
| 2915 template<typename T> | 2915 template<typename T> |
| 2916 static RawString* NewSymbol(const T* characters, intptr_t len); | 2916 static RawString* NewSymbol(const T* characters, intptr_t len); |
| 2917 static RawString* NewSymbol(const String& str); | 2917 static RawString* NewSymbol(const String& str); |
| 2918 static RawString* NewSymbol(const String& str, | 2918 static RawString* NewSymbol(const String& str, |
| 2919 intptr_t begin_index, | 2919 intptr_t begin_index, |
| 2920 intptr_t length); | 2920 intptr_t length); |
| 2921 | 2921 |
| 2922 static RawString* NewFormatted(const char* format, ...); |
| 2923 |
| 2922 protected: | 2924 protected: |
| 2923 bool HasHash() const { | 2925 bool HasHash() const { |
| 2924 ASSERT(Smi::New(0) == NULL); | 2926 ASSERT(Smi::New(0) == NULL); |
| 2925 return (raw_ptr()->hash_ != NULL); | 2927 return (raw_ptr()->hash_ != NULL); |
| 2926 } | 2928 } |
| 2927 | 2929 |
| 2928 void SetLength(intptr_t value) const { | 2930 void SetLength(intptr_t value) const { |
| 2929 // This is only safe because we create a new Smi, which does not cause | 2931 // This is only safe because we create a new Smi, which does not cause |
| 2930 // heap allocation. | 2932 // heap allocation. |
| 2931 raw_ptr()->length_ = Smi::New(value); | 2933 raw_ptr()->length_ = Smi::New(value); |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3924 } | 3926 } |
| 3925 | 3927 |
| 3926 | 3928 |
| 3927 void Context::SetAt(intptr_t index, const Instance& value) const { | 3929 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3928 StorePointer(InstanceAddr(index), value.raw()); | 3930 StorePointer(InstanceAddr(index), value.raw()); |
| 3929 } | 3931 } |
| 3930 | 3932 |
| 3931 } // namespace dart | 3933 } // namespace dart |
| 3932 | 3934 |
| 3933 #endif // VM_OBJECT_H_ | 3935 #endif // VM_OBJECT_H_ |
| OLD | NEW |