Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: vm/object.h

Issue 11969029: Allow externalization of canonical strings also. Only restrict canonical strings (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4037 matching lines...) Expand 10 before | Expand all | Expand 10 after
4048 4048
4049 static RawString* Transform(int32_t (*mapping)(int32_t ch), 4049 static RawString* Transform(int32_t (*mapping)(int32_t ch),
4050 const String& str, 4050 const String& str,
4051 Heap::Space space = Heap::kNew); 4051 Heap::Space space = Heap::kNew);
4052 4052
4053 static RawString* ToUpperCase(const String& str, 4053 static RawString* ToUpperCase(const String& str,
4054 Heap::Space space = Heap::kNew); 4054 Heap::Space space = Heap::kNew);
4055 static RawString* ToLowerCase(const String& str, 4055 static RawString* ToLowerCase(const String& str,
4056 Heap::Space space = Heap::kNew); 4056 Heap::Space space = Heap::kNew);
4057 4057
4058 static bool EqualsIgnoringPrivateKey(const String& str1,
4059 const String& str2);
4060
4058 static RawString* NewFormatted(const char* format, ...) 4061 static RawString* NewFormatted(const char* format, ...)
4059 PRINTF_ATTRIBUTE(1, 2); 4062 PRINTF_ATTRIBUTE(1, 2);
4060 static RawString* NewFormattedV(const char* format, va_list args); 4063 static RawString* NewFormattedV(const char* format, va_list args);
4061 4064
4062 protected: 4065 protected:
4063 bool HasHash() const { 4066 bool HasHash() const {
4064 ASSERT(Smi::New(0) == NULL); 4067 ASSERT(Smi::New(0) == NULL);
4065 return (raw_ptr()->hash_ != NULL); 4068 return (raw_ptr()->hash_ != NULL);
4066 } 4069 }
4067 4070
(...skipping 30 matching lines...) Expand all
4098 4101
4099 class OneByteString : public AllStatic { 4102 class OneByteString : public AllStatic {
4100 public: 4103 public:
4101 static int32_t CharAt(const String& str, intptr_t index) { 4104 static int32_t CharAt(const String& str, intptr_t index) {
4102 return *CharAddr(str, index); 4105 return *CharAddr(str, index);
4103 } 4106 }
4104 4107
4105 static RawOneByteString* EscapeSpecialCharacters(const String& str, 4108 static RawOneByteString* EscapeSpecialCharacters(const String& str,
4106 bool raw_str); 4109 bool raw_str);
4107 4110
4108 static bool EqualsIgnoringPrivateKey(const String& str1,
4109 const String& str2);
4110
4111 // We use the same maximum elements for all strings. 4111 // We use the same maximum elements for all strings.
4112 static const intptr_t kBytesPerElement = 1; 4112 static const intptr_t kBytesPerElement = 1;
4113 static const intptr_t kMaxElements = String::kMaxElements; 4113 static const intptr_t kMaxElements = String::kMaxElements;
4114 4114
4115 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); } 4115 static intptr_t data_offset() { return OFFSET_OF(RawOneByteString, data_); }
4116 4116
4117 static intptr_t InstanceSize() { 4117 static intptr_t InstanceSize() {
4118 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_)); 4118 ASSERT(sizeof(RawOneByteString) == OFFSET_OF(RawOneByteString, data_));
4119 return 0; 4119 return 0;
4120 } 4120 }
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
6252 6252
6253 6253
6254 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6254 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6255 intptr_t index) { 6255 intptr_t index) {
6256 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6256 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6257 } 6257 }
6258 6258
6259 } // namespace dart 6259 } // namespace dart
6260 6260
6261 #endif // VM_OBJECT_H_ 6261 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « vm/dart_api_impl_test.cc ('k') | vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698