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

Side by Side Diff: runtime/vm/dart_api_message.cc

Issue 1526123002: VM: Const-correctness fixes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/intermediate_language.h » ('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 #include "vm/dart_api_message.h" 5 #include "vm/dart_api_message.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/snapshot_ids.h" 7 #include "vm/snapshot_ids.h"
8 #include "vm/symbols.h" 8 #include "vm/symbols.h"
9 #include "vm/unicode.h" 9 #include "vm/unicode.h"
10 10
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 intptr_t cid = raw->GetClassId(); 225 intptr_t cid = raw->GetClassId();
226 switch (cid) { 226 switch (cid) {
227 case kOneByteStringCid: { 227 case kOneByteStringCid: {
228 RawOneByteString* raw_str = reinterpret_cast<RawOneByteString*>(raw); 228 RawOneByteString* raw_str = reinterpret_cast<RawOneByteString*>(raw);
229 const char* str = reinterpret_cast<const char*>(raw_str->ptr()->data()); 229 const char* str = reinterpret_cast<const char*>(raw_str->ptr()->data());
230 ASSERT(str != NULL); 230 ASSERT(str != NULL);
231 Dart_CObject* object = NULL; 231 Dart_CObject* object = NULL;
232 for (intptr_t i = 0; i < vm_isolate_references_.length(); i++) { 232 for (intptr_t i = 0; i < vm_isolate_references_.length(); i++) {
233 object = vm_isolate_references_.At(i); 233 object = vm_isolate_references_.At(i);
234 if (object->type == Dart_CObject_kString) { 234 if (object->type == Dart_CObject_kString) {
235 if (strcmp(str, const_cast<char*>(object->value.as_string)) == 0) { 235 if (strcmp(str, object->value.as_string) == 0) {
236 return object; 236 return object;
237 } 237 }
238 } 238 }
239 } 239 }
240 object = CreateDartCObjectString(raw); 240 object = CreateDartCObjectString(raw);
241 vm_isolate_references_.Add(object); 241 vm_isolate_references_.Add(object);
242 return object; 242 return object;
243 } 243 }
244 244
245 case kMintCid: { 245 case kMintCid: {
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 if (!success) { 1337 if (!success) {
1338 UnmarkAllCObjects(object); 1338 UnmarkAllCObjects(object);
1339 return false; 1339 return false;
1340 } 1340 }
1341 } 1341 }
1342 UnmarkAllCObjects(object); 1342 UnmarkAllCObjects(object);
1343 return true; 1343 return true;
1344 } 1344 }
1345 1345
1346 } // namespace dart 1346 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698