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 3522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3533 void SetHash(intptr_t value) const { | 3533 void SetHash(intptr_t value) const { |
3534 // This is only safe because we create a new Smi, which does not cause | 3534 // This is only safe because we create a new Smi, which does not cause |
3535 // heap allocation. | 3535 // heap allocation. |
3536 raw_ptr()->hash_ = Smi::New(value); | 3536 raw_ptr()->hash_ = Smi::New(value); |
3537 } | 3537 } |
3538 | 3538 |
3539 template<typename HandleType, typename ElementType> | 3539 template<typename HandleType, typename ElementType> |
3540 static void ReadFromImpl(SnapshotReader* reader, | 3540 static void ReadFromImpl(SnapshotReader* reader, |
3541 HandleType* str_obj, | 3541 HandleType* str_obj, |
3542 intptr_t len, | 3542 intptr_t len, |
3543 intptr_t tags); | 3543 intptr_t tags, |
| 3544 Snapshot::Kind kind); |
3544 | 3545 |
3545 HEAP_OBJECT_IMPLEMENTATION(String, Instance); | 3546 HEAP_OBJECT_IMPLEMENTATION(String, Instance); |
3546 | 3547 |
3547 friend class Symbols; | 3548 friend class Symbols; |
3548 }; | 3549 }; |
3549 | 3550 |
3550 | 3551 |
3551 class OneByteString : public String { | 3552 class OneByteString : public String { |
3552 public: | 3553 public: |
3553 virtual int32_t CharAt(intptr_t index) const { | 3554 virtual int32_t CharAt(intptr_t index) const { |
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5536 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5537 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5537 return false; | 5538 return false; |
5538 } | 5539 } |
5539 } | 5540 } |
5540 return true; | 5541 return true; |
5541 } | 5542 } |
5542 | 5543 |
5543 } // namespace dart | 5544 } // namespace dart |
5544 | 5545 |
5545 #endif // VM_OBJECT_H_ | 5546 #endif // VM_OBJECT_H_ |
OLD | NEW |