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

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

Issue 19856003: Inline create parameter mirror list functionality. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months 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 | Annotate | Revision Log
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/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 14323 matching lines...) Expand 10 before | Expand all | Expand 10 after
14334 return Function::Cast(Object::Handle(referent())).raw(); 14334 return Function::Cast(Object::Handle(referent())).raw();
14335 } 14335 }
14336 14336
14337 14337
14338 RawLibrary* MirrorReference::GetLibraryReferent() const { 14338 RawLibrary* MirrorReference::GetLibraryReferent() const {
14339 ASSERT(Object::Handle(referent()).IsLibrary()); 14339 ASSERT(Object::Handle(referent()).IsLibrary());
14340 return Library::Cast(Object::Handle(referent())).raw(); 14340 return Library::Cast(Object::Handle(referent())).raw();
14341 } 14341 }
14342 14342
14343 14343
14344 RawMirrorReference* MirrorReference::New(Heap::Space space) { 14344 RawMirrorReference* MirrorReference::New(const Object& referent,
14345 Heap::Space space) {
14345 ASSERT(Isolate::Current()->object_store()->mirror_reference_class() 14346 ASSERT(Isolate::Current()->object_store()->mirror_reference_class()
14346 != Class::null()); 14347 != Class::null());
14347 RawObject* raw = Object::Allocate(MirrorReference::kClassId, 14348 MirrorReference& result = MirrorReference::Handle();
14348 MirrorReference::InstanceSize(), 14349 {
14349 space); 14350 RawObject* raw = Object::Allocate(MirrorReference::kClassId,
14350 return reinterpret_cast<RawMirrorReference*>(raw); 14351 MirrorReference::InstanceSize(),
14352 space);
14353 NoGCScope no_gc;
14354 result ^= raw;
14355 }
14356 result.set_referent(referent);
14357 return result.raw();
14351 } 14358 }
14352 14359
14353 14360
14354 const char* MirrorReference::ToCString() const { 14361 const char* MirrorReference::ToCString() const {
14355 return "_MirrorReference"; 14362 return "_MirrorReference";
14356 } 14363 }
14357 14364
14358 14365
14359 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 14366 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
14360 stream->OpenObject(); 14367 stream->OpenObject();
14361 stream->CloseObject(); 14368 stream->CloseObject();
14362 } 14369 }
14363 14370
14364 14371
14365 } // namespace dart 14372 } // namespace dart
OLDNEW
« runtime/lib/mirrors.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698