| 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/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 20316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20327 } | 20327 } |
| 20328 result.set_label(label); | 20328 result.set_label(label); |
| 20329 AddTagToIsolate(isolate, result); | 20329 AddTagToIsolate(isolate, result); |
| 20330 return result.raw(); | 20330 return result.raw(); |
| 20331 } | 20331 } |
| 20332 | 20332 |
| 20333 | 20333 |
| 20334 RawUserTag* UserTag::DefaultTag() { | 20334 RawUserTag* UserTag::DefaultTag() { |
| 20335 Isolate* isolate = Isolate::Current(); | 20335 Isolate* isolate = Isolate::Current(); |
| 20336 ASSERT(isolate != NULL); | 20336 ASSERT(isolate != NULL); |
| 20337 ASSERT(isolate->object_store() != NULL); | 20337 if (isolate->default_tag() != UserTag::null()) { |
| 20338 if (isolate->object_store()->default_tag() != UserTag::null()) { | |
| 20339 // Already created. | 20338 // Already created. |
| 20340 return isolate->object_store()->default_tag(); | 20339 return isolate->default_tag(); |
| 20341 } | 20340 } |
| 20342 // Create default tag. | 20341 // Create default tag. |
| 20343 const UserTag& result = UserTag::Handle(isolate, | 20342 const UserTag& result = UserTag::Handle(isolate, |
| 20344 UserTag::New(Symbols::Default())); | 20343 UserTag::New(Symbols::Default())); |
| 20345 ASSERT(result.tag() == UserTags::kDefaultUserTag); | 20344 ASSERT(result.tag() == UserTags::kDefaultUserTag); |
| 20346 isolate->object_store()->set_default_tag(result); | 20345 isolate->set_default_tag(result); |
| 20347 return result.raw(); | 20346 return result.raw(); |
| 20348 } | 20347 } |
| 20349 | 20348 |
| 20350 | 20349 |
| 20351 RawUserTag* UserTag::FindTagInIsolate(Isolate* isolate, const String& label) { | 20350 RawUserTag* UserTag::FindTagInIsolate(Isolate* isolate, const String& label) { |
| 20352 ASSERT(isolate->tag_table() != GrowableObjectArray::null()); | 20351 ASSERT(isolate->tag_table() != GrowableObjectArray::null()); |
| 20353 const GrowableObjectArray& tag_table = GrowableObjectArray::Handle( | 20352 const GrowableObjectArray& tag_table = GrowableObjectArray::Handle( |
| 20354 isolate, isolate->tag_table()); | 20353 isolate, isolate->tag_table()); |
| 20355 UserTag& other = UserTag::Handle(isolate); | 20354 UserTag& other = UserTag::Handle(isolate); |
| 20356 String& tag_label = String::Handle(isolate); | 20355 String& tag_label = String::Handle(isolate); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 20421 return tag_label.ToCString(); | 20420 return tag_label.ToCString(); |
| 20422 } | 20421 } |
| 20423 | 20422 |
| 20424 | 20423 |
| 20425 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20424 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20426 Instance::PrintJSONImpl(stream, ref); | 20425 Instance::PrintJSONImpl(stream, ref); |
| 20427 } | 20426 } |
| 20428 | 20427 |
| 20429 | 20428 |
| 20430 } // namespace dart | 20429 } // namespace dart |
| OLD | NEW |