| 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 14328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14339 return Function::Cast(Object::Handle(referent())).raw(); | 14339 return Function::Cast(Object::Handle(referent())).raw(); |
| 14340 } | 14340 } |
| 14341 | 14341 |
| 14342 | 14342 |
| 14343 RawLibrary* MirrorReference::GetLibraryReferent() const { | 14343 RawLibrary* MirrorReference::GetLibraryReferent() const { |
| 14344 ASSERT(Object::Handle(referent()).IsLibrary()); | 14344 ASSERT(Object::Handle(referent()).IsLibrary()); |
| 14345 return Library::Cast(Object::Handle(referent())).raw(); | 14345 return Library::Cast(Object::Handle(referent())).raw(); |
| 14346 } | 14346 } |
| 14347 | 14347 |
| 14348 | 14348 |
| 14349 RawTypeParameter* MirrorReference::GetTypeParameterReferent() const { |
| 14350 ASSERT(Object::Handle(referent()).IsTypeParameter()); |
| 14351 return TypeParameter::Cast(Object::Handle(referent())).raw(); |
| 14352 } |
| 14353 |
| 14354 |
| 14349 RawMirrorReference* MirrorReference::New(const Object& referent, | 14355 RawMirrorReference* MirrorReference::New(const Object& referent, |
| 14350 Heap::Space space) { | 14356 Heap::Space space) { |
| 14351 ASSERT(Isolate::Current()->object_store()->mirror_reference_class() | 14357 ASSERT(Isolate::Current()->object_store()->mirror_reference_class() |
| 14352 != Class::null()); | 14358 != Class::null()); |
| 14353 MirrorReference& result = MirrorReference::Handle(); | 14359 MirrorReference& result = MirrorReference::Handle(); |
| 14354 { | 14360 { |
| 14355 RawObject* raw = Object::Allocate(MirrorReference::kClassId, | 14361 RawObject* raw = Object::Allocate(MirrorReference::kClassId, |
| 14356 MirrorReference::InstanceSize(), | 14362 MirrorReference::InstanceSize(), |
| 14357 space); | 14363 space); |
| 14358 NoGCScope no_gc; | 14364 NoGCScope no_gc; |
| 14359 result ^= raw; | 14365 result ^= raw; |
| 14360 } | 14366 } |
| 14361 result.set_referent(referent); | 14367 result.set_referent(referent); |
| 14362 return result.raw(); | 14368 return result.raw(); |
| 14363 } | 14369 } |
| 14364 | 14370 |
| 14365 | 14371 |
| 14366 const char* MirrorReference::ToCString() const { | 14372 const char* MirrorReference::ToCString() const { |
| 14367 return "_MirrorReference"; | 14373 return "_MirrorReference"; |
| 14368 } | 14374 } |
| 14369 | 14375 |
| 14370 | 14376 |
| 14371 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14377 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14372 stream->OpenObject(); | 14378 stream->OpenObject(); |
| 14373 stream->CloseObject(); | 14379 stream->CloseObject(); |
| 14374 } | 14380 } |
| 14375 | 14381 |
| 14376 | 14382 |
| 14377 } // namespace dart | 14383 } // namespace dart |
| OLD | NEW |