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 | 3533 |
3534 static RawString* Transform(int32_t (*mapping)(int32_t ch), | 3534 static RawString* Transform(int32_t (*mapping)(int32_t ch), |
3535 const String& str, | 3535 const String& str, |
3536 Heap::Space space = Heap::kNew); | 3536 Heap::Space space = Heap::kNew); |
3537 | 3537 |
3538 static RawString* ToUpperCase(const String& str, | 3538 static RawString* ToUpperCase(const String& str, |
3539 Heap::Space space = Heap::kNew); | 3539 Heap::Space space = Heap::kNew); |
3540 static RawString* ToLowerCase(const String& str, | 3540 static RawString* ToLowerCase(const String& str, |
3541 Heap::Space space = Heap::kNew); | 3541 Heap::Space space = Heap::kNew); |
3542 | 3542 |
3543 static RawString* NewFormatted(const char* format, ...); | 3543 static RawString* NewFormatted(const char* format, ...) |
| 3544 PRINTF_ATTRIBUTE(1, 2); |
3544 | 3545 |
3545 protected: | 3546 protected: |
3546 bool HasHash() const { | 3547 bool HasHash() const { |
3547 ASSERT(Smi::New(0) == NULL); | 3548 ASSERT(Smi::New(0) == NULL); |
3548 return (raw_ptr()->hash_ != NULL); | 3549 return (raw_ptr()->hash_ != NULL); |
3549 } | 3550 } |
3550 | 3551 |
3551 void SetLength(intptr_t value) const { | 3552 void SetLength(intptr_t value) const { |
3552 // This is only safe because we create a new Smi, which does not cause | 3553 // This is only safe because we create a new Smi, which does not cause |
3553 // heap allocation. | 3554 // heap allocation. |
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5562 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5563 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5563 return false; | 5564 return false; |
5564 } | 5565 } |
5565 } | 5566 } |
5566 return true; | 5567 return true; |
5567 } | 5568 } |
5568 | 5569 |
5569 } // namespace dart | 5570 } // namespace dart |
5570 | 5571 |
5571 #endif // VM_OBJECT_H_ | 5572 #endif // VM_OBJECT_H_ |
OLD | NEW |