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 14209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14220 return "_WeakProperty"; | 14220 return "_WeakProperty"; |
14221 } | 14221 } |
14222 | 14222 |
14223 | 14223 |
14224 void WeakProperty::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14224 void WeakProperty::PrintToJSONStream(JSONStream* stream, bool ref) const { |
14225 stream->OpenObject(); | 14225 stream->OpenObject(); |
14226 stream->CloseObject(); | 14226 stream->CloseObject(); |
14227 } | 14227 } |
14228 | 14228 |
14229 | 14229 |
| 14230 RawClass* MirrorReference::GetClassReferent() const { |
| 14231 ASSERT(Object::Handle(referent()).IsClass()); |
| 14232 return Class::Cast(Object::Handle(referent())).raw(); |
| 14233 } |
| 14234 |
| 14235 |
14230 RawFunction* MirrorReference::GetFunctionReferent() const { | 14236 RawFunction* MirrorReference::GetFunctionReferent() const { |
14231 ASSERT(Object::Handle(referent()).IsFunction()); | 14237 ASSERT(Object::Handle(referent()).IsFunction()); |
14232 return Function::Cast(Object::Handle(referent())).raw(); | 14238 return Function::Cast(Object::Handle(referent())).raw(); |
14233 } | 14239 } |
14234 | 14240 |
14235 | 14241 |
| 14242 RawLibrary* MirrorReference::GetLibraryReferent() const { |
| 14243 ASSERT(Object::Handle(referent()).IsLibrary()); |
| 14244 return Library::Cast(Object::Handle(referent())).raw(); |
| 14245 } |
| 14246 |
| 14247 |
14236 RawMirrorReference* MirrorReference::New(Heap::Space space) { | 14248 RawMirrorReference* MirrorReference::New(Heap::Space space) { |
14237 ASSERT(Isolate::Current()->object_store()->mirror_reference_class() | 14249 ASSERT(Isolate::Current()->object_store()->mirror_reference_class() |
14238 != Class::null()); | 14250 != Class::null()); |
14239 RawObject* raw = Object::Allocate(MirrorReference::kClassId, | 14251 RawObject* raw = Object::Allocate(MirrorReference::kClassId, |
14240 MirrorReference::InstanceSize(), | 14252 MirrorReference::InstanceSize(), |
14241 space); | 14253 space); |
14242 return reinterpret_cast<RawMirrorReference*>(raw); | 14254 return reinterpret_cast<RawMirrorReference*>(raw); |
14243 } | 14255 } |
14244 | 14256 |
14245 | 14257 |
14246 const char* MirrorReference::ToCString() const { | 14258 const char* MirrorReference::ToCString() const { |
14247 return "_MirrorReference"; | 14259 return "_MirrorReference"; |
14248 } | 14260 } |
14249 | 14261 |
14250 | 14262 |
14251 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14263 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
14252 stream->OpenObject(); | 14264 stream->OpenObject(); |
14253 stream->CloseObject(); | 14265 stream->CloseObject(); |
14254 } | 14266 } |
14255 | 14267 |
14256 | 14268 |
14257 } // namespace dart | 14269 } // namespace dart |
OLD | NEW |