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

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

Issue 202853007: Fix http://dartbug.com/17555 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 NoGCScope no_gc; 1673 NoGCScope no_gc;
1674 result ^= raw; 1674 result ^= raw;
1675 } 1675 }
1676 FakeObject fake; 1676 FakeObject fake;
1677 result.set_handle_vtable(fake.vtable()); 1677 result.set_handle_vtable(fake.vtable());
1678 result.set_instance_size(FakeObject::InstanceSize()); 1678 result.set_instance_size(FakeObject::InstanceSize());
1679 result.set_next_field_offset(FakeObject::NextFieldOffset()); 1679 result.set_next_field_offset(FakeObject::NextFieldOffset());
1680 ASSERT((FakeObject::kClassId != kInstanceCid)); 1680 ASSERT((FakeObject::kClassId != kInstanceCid));
1681 result.set_id(FakeObject::kClassId); 1681 result.set_id(FakeObject::kClassId);
1682 result.set_state_bits(0); 1682 result.set_state_bits(0);
1683 // VM backed classes are almost ready: run checks and resolve class 1683 if (FakeObject::kClassId < kInstanceCid) {
1684 // references, but do not recompute size. 1684 // VM internal classes are done. There is no finalization needed or
1685 result.set_is_prefinalized(); 1685 // possible in this case.
1686 result.set_is_finalized();
1687 } else {
1688 // VM backed classes are almost ready: run checks and resolve class
1689 // references, but do not recompute size.
1690 result.set_is_prefinalized();
1691 }
1686 result.set_type_arguments_field_offset_in_words(kNoTypeArguments); 1692 result.set_type_arguments_field_offset_in_words(kNoTypeArguments);
1687 result.set_num_type_arguments(0); 1693 result.set_num_type_arguments(0);
1688 result.set_num_own_type_arguments(0); 1694 result.set_num_own_type_arguments(0);
1689 result.set_num_native_fields(0); 1695 result.set_num_native_fields(0);
1690 result.set_token_pos(Scanner::kNoSourcePos); 1696 result.set_token_pos(Scanner::kNoSourcePos);
1691 result.InitEmptyFields(); 1697 result.InitEmptyFields();
1692 Isolate::Current()->RegisterClass(result); 1698 Isolate::Current()->RegisterClass(result);
1693 return result.raw(); 1699 return result.raw();
1694 } 1700 }
1695 1701
(...skipping 2086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3782 jsobj.AddProperty("error", err); 3788 jsobj.AddProperty("error", err);
3783 } 3789 }
3784 jsobj.AddProperty("implemented", is_implemented()); 3790 jsobj.AddProperty("implemented", is_implemented());
3785 jsobj.AddProperty("abstract", is_abstract()); 3791 jsobj.AddProperty("abstract", is_abstract());
3786 jsobj.AddProperty("patch", is_patch()); 3792 jsobj.AddProperty("patch", is_patch());
3787 jsobj.AddProperty("finalized", is_finalized()); 3793 jsobj.AddProperty("finalized", is_finalized());
3788 jsobj.AddProperty("const", is_const()); 3794 jsobj.AddProperty("const", is_const());
3789 jsobj.AddProperty("super", Class::Handle(SuperClass())); 3795 jsobj.AddProperty("super", Class::Handle(SuperClass()));
3790 jsobj.AddProperty("library", Object::Handle(library())); 3796 jsobj.AddProperty("library", Object::Handle(library()));
3791 const Script& script = Script::Handle(this->script()); 3797 const Script& script = Script::Handle(this->script());
3792 intptr_t line_number = 0; 3798 if (!script.IsNull()) {
3793 intptr_t column_number = 0; 3799 intptr_t line_number = 0;
3794 script.GetTokenLocation(token_pos(), &line_number, &column_number); 3800 intptr_t column_number = 0;
3795 jsobj.AddProperty("script", script); 3801 script.GetTokenLocation(token_pos(), &line_number, &column_number);
3796 jsobj.AddProperty("line", line_number); 3802 jsobj.AddProperty("script", script);
3797 jsobj.AddProperty("col", column_number); 3803 jsobj.AddProperty("line", line_number);
3804 jsobj.AddProperty("col", column_number);
3805 }
3798 { 3806 {
3799 JSONArray interfaces_array(&jsobj, "interfaces"); 3807 JSONArray interfaces_array(&jsobj, "interfaces");
3800 const Array& interface_array = Array::Handle(interfaces()); 3808 const Array& interface_array = Array::Handle(interfaces());
3801 Type& interface_type = Type::Handle(); 3809 Type& interface_type = Type::Handle();
3802 Class& interface_cls = Class::Handle(); 3810 Class& interface_cls = Class::Handle();
3803 if (!interface_array.IsNull()) { 3811 if (!interface_array.IsNull()) {
3804 for (intptr_t i = 0; i < interface_array.Length(); ++i) { 3812 for (intptr_t i = 0; i < interface_array.Length(); ++i) {
3805 // TODO(turnidge): Use the Type directly once regis has added 3813 // TODO(turnidge): Use the Type directly once regis has added
3806 // types to the vmservice. 3814 // types to the vmservice.
3807 interface_type ^= interface_array.At(i); 3815 interface_type ^= interface_array.At(i);
(...skipping 13889 matching lines...) Expand 10 before | Expand all | Expand 10 after
17697 return "_MirrorReference"; 17705 return "_MirrorReference";
17698 } 17706 }
17699 17707
17700 17708
17701 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17709 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17702 Instance::PrintToJSONStream(stream, ref); 17710 Instance::PrintToJSONStream(stream, ref);
17703 } 17711 }
17704 17712
17705 17713
17706 } // namespace dart 17714 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698