| 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 3203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3214 static void Copy(const String& dst, | 3214 static void Copy(const String& dst, |
| 3215 intptr_t dst_offset, | 3215 intptr_t dst_offset, |
| 3216 const uint32_t* characters, | 3216 const uint32_t* characters, |
| 3217 intptr_t len); | 3217 intptr_t len); |
| 3218 static void Copy(const String& dst, | 3218 static void Copy(const String& dst, |
| 3219 intptr_t dst_offset, | 3219 intptr_t dst_offset, |
| 3220 const String& src, | 3220 const String& src, |
| 3221 intptr_t src_offset, | 3221 intptr_t src_offset, |
| 3222 intptr_t len); | 3222 intptr_t len); |
| 3223 | 3223 |
| 3224 static RawString* EscapeDoubleQuotes(const String& str); |
| 3225 |
| 3224 static RawString* Concat(const String& str1, | 3226 static RawString* Concat(const String& str1, |
| 3225 const String& str2, | 3227 const String& str2, |
| 3226 Heap::Space space = Heap::kNew); | 3228 Heap::Space space = Heap::kNew); |
| 3227 static RawString* ConcatAll(const Array& strings, | 3229 static RawString* ConcatAll(const Array& strings, |
| 3228 Heap::Space space = Heap::kNew); | 3230 Heap::Space space = Heap::kNew); |
| 3229 | 3231 |
| 3230 static RawString* SubString(const String& str, | 3232 static RawString* SubString(const String& str, |
| 3231 intptr_t begin_index, | 3233 intptr_t begin_index, |
| 3232 Heap::Space space = Heap::kNew); | 3234 Heap::Space space = Heap::kNew); |
| 3233 static RawString* SubString(const String& str, | 3235 static RawString* SubString(const String& str, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3285 class OneByteString : public String { | 3287 class OneByteString : public String { |
| 3286 public: | 3288 public: |
| 3287 virtual int32_t CharAt(intptr_t index) const { | 3289 virtual int32_t CharAt(intptr_t index) const { |
| 3288 return *CharAddr(index); | 3290 return *CharAddr(index); |
| 3289 } | 3291 } |
| 3290 | 3292 |
| 3291 virtual intptr_t CharSize() const { | 3293 virtual intptr_t CharSize() const { |
| 3292 return kOneByteChar; | 3294 return kOneByteChar; |
| 3293 } | 3295 } |
| 3294 | 3296 |
| 3297 RawOneByteString* EscapeDoubleQuotes() const; |
| 3298 |
| 3295 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } | 3299 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } |
| 3296 | 3300 |
| 3297 static intptr_t InstanceSize() { | 3301 static intptr_t InstanceSize() { |
| 3298 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); | 3302 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); |
| 3299 return 0; | 3303 return 0; |
| 3300 } | 3304 } |
| 3301 | 3305 |
| 3302 static intptr_t InstanceSize(intptr_t len) { | 3306 static intptr_t InstanceSize(intptr_t len) { |
| 3303 return RoundedAllocationSize(sizeof(RawOneByteString) + len); | 3307 return RoundedAllocationSize(sizeof(RawOneByteString) + len); |
| 3304 } | 3308 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3344 class TwoByteString : public String { | 3348 class TwoByteString : public String { |
| 3345 public: | 3349 public: |
| 3346 virtual int32_t CharAt(intptr_t index) const { | 3350 virtual int32_t CharAt(intptr_t index) const { |
| 3347 return *CharAddr(index); | 3351 return *CharAddr(index); |
| 3348 } | 3352 } |
| 3349 | 3353 |
| 3350 virtual intptr_t CharSize() const { | 3354 virtual intptr_t CharSize() const { |
| 3351 return kTwoByteChar; | 3355 return kTwoByteChar; |
| 3352 } | 3356 } |
| 3353 | 3357 |
| 3358 RawTwoByteString* EscapeDoubleQuotes() const; |
| 3359 |
| 3354 static intptr_t InstanceSize() { | 3360 static intptr_t InstanceSize() { |
| 3355 ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_)); | 3361 ASSERT(sizeof(RawTwoByteString) == OFFSET_OF(RawTwoByteString, data_)); |
| 3356 return 0; | 3362 return 0; |
| 3357 } | 3363 } |
| 3358 | 3364 |
| 3359 static intptr_t InstanceSize(intptr_t len) { | 3365 static intptr_t InstanceSize(intptr_t len) { |
| 3360 return RoundedAllocationSize(sizeof(RawTwoByteString) + (2 * len)); | 3366 return RoundedAllocationSize(sizeof(RawTwoByteString) + (2 * len)); |
| 3361 } | 3367 } |
| 3362 | 3368 |
| 3363 static RawTwoByteString* New(intptr_t len, | 3369 static RawTwoByteString* New(intptr_t len, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3397 class FourByteString : public String { | 3403 class FourByteString : public String { |
| 3398 public: | 3404 public: |
| 3399 virtual int32_t CharAt(intptr_t index) const { | 3405 virtual int32_t CharAt(intptr_t index) const { |
| 3400 return *CharAddr(index); | 3406 return *CharAddr(index); |
| 3401 } | 3407 } |
| 3402 | 3408 |
| 3403 virtual intptr_t CharSize() const { | 3409 virtual intptr_t CharSize() const { |
| 3404 return kFourByteChar; | 3410 return kFourByteChar; |
| 3405 } | 3411 } |
| 3406 | 3412 |
| 3413 RawFourByteString* EscapeDoubleQuotes() const; |
| 3414 |
| 3407 static intptr_t InstanceSize() { | 3415 static intptr_t InstanceSize() { |
| 3408 ASSERT(sizeof(RawFourByteString) == OFFSET_OF(RawFourByteString, data_)); | 3416 ASSERT(sizeof(RawFourByteString) == OFFSET_OF(RawFourByteString, data_)); |
| 3409 return 0; | 3417 return 0; |
| 3410 } | 3418 } |
| 3411 | 3419 |
| 3412 static intptr_t InstanceSize(intptr_t len) { | 3420 static intptr_t InstanceSize(intptr_t len) { |
| 3413 return RoundedAllocationSize(sizeof(RawFourByteString) + (4 * len)); | 3421 return RoundedAllocationSize(sizeof(RawFourByteString) + (4 * len)); |
| 3414 } | 3422 } |
| 3415 | 3423 |
| 3416 static RawFourByteString* New(intptr_t len, | 3424 static RawFourByteString* New(intptr_t len, |
| (...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5094 } | 5102 } |
| 5095 | 5103 |
| 5096 | 5104 |
| 5097 intptr_t Stackmap::SizeInBits() const { | 5105 intptr_t Stackmap::SizeInBits() const { |
| 5098 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 5106 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
| 5099 } | 5107 } |
| 5100 | 5108 |
| 5101 } // namespace dart | 5109 } // namespace dart |
| 5102 | 5110 |
| 5103 #endif // VM_OBJECT_H_ | 5111 #endif // VM_OBJECT_H_ |
| OLD | NEW |