| 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 #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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |