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

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

Issue 922023002: Implement DeclarationMirror.location for all but ParameterMirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/parser.cc » ('j') | 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 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 Field& field = Field::Handle(isolate); 1414 Field& field = Field::Handle(isolate);
1415 Smi& value = Smi::Handle(isolate); 1415 Smi& value = Smi::Handle(isolate);
1416 String& field_name = String::Handle(isolate); 1416 String& field_name = String::Handle(isolate);
1417 1417
1418 #define CLASS_LIST_WITH_NULL(V) \ 1418 #define CLASS_LIST_WITH_NULL(V) \
1419 V(Null) \ 1419 V(Null) \
1420 CLASS_LIST_NO_OBJECT(V) 1420 CLASS_LIST_NO_OBJECT(V)
1421 1421
1422 #define ADD_SET_FIELD(clazz) \ 1422 #define ADD_SET_FIELD(clazz) \
1423 field_name = Symbols::New("cid"#clazz); \ 1423 field_name = Symbols::New("cid"#clazz); \
1424 field = Field::New(field_name, true, false, true, false, cls, 0); \ 1424 field = Field::New(field_name, true, false, true, true, cls, 0); \
1425 value = Smi::New(k##clazz##Cid); \ 1425 value = Smi::New(k##clazz##Cid); \
1426 field.set_value(value); \ 1426 field.set_value(value); \
1427 field.set_type(Type::Handle(Type::IntType())); \ 1427 field.set_type(Type::Handle(Type::IntType())); \
1428 cls.AddField(field); \ 1428 cls.AddField(field); \
1429 1429
1430 CLASS_LIST_WITH_NULL(ADD_SET_FIELD) 1430 CLASS_LIST_WITH_NULL(ADD_SET_FIELD)
1431 #undef ADD_SET_FIELD 1431 #undef ADD_SET_FIELD
1432 1432
1433 isolate->object_store()->InitKnownObjects(); 1433 isolate->object_store()->InitKnownObjects();
1434 1434
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 // Set super class to Object. 3051 // Set super class to Object.
3052 cls.set_super_type(Type::Handle(Type::ObjectType())); 3052 cls.set_super_type(Type::Handle(Type::ObjectType()));
3053 // Compute instance size. First word contains a pointer to a properly 3053 // Compute instance size. First word contains a pointer to a properly
3054 // sized typed array once the first native field has been set. 3054 // sized typed array once the first native field has been set.
3055 intptr_t instance_size = sizeof(RawInstance) + kWordSize; 3055 intptr_t instance_size = sizeof(RawInstance) + kWordSize;
3056 cls.set_instance_size(RoundedAllocationSize(instance_size)); 3056 cls.set_instance_size(RoundedAllocationSize(instance_size));
3057 cls.set_next_field_offset(instance_size); 3057 cls.set_next_field_offset(instance_size);
3058 cls.set_num_native_fields(field_count); 3058 cls.set_num_native_fields(field_count);
3059 cls.set_is_finalized(); 3059 cls.set_is_finalized();
3060 cls.set_is_type_finalized(); 3060 cls.set_is_type_finalized();
3061 cls.set_is_synthesized_class();
3061 library.AddClass(cls); 3062 library.AddClass(cls);
3062 return cls.raw(); 3063 return cls.raw();
3063 } else { 3064 } else {
3064 return Class::null(); 3065 return Class::null();
3065 } 3066 }
3066 } 3067 }
3067 3068
3068 3069
3069 RawClass* Class::NewStringClass(intptr_t class_id) { 3070 RawClass* Class::NewStringClass(intptr_t class_id) {
3070 intptr_t instance_size; 3071 intptr_t instance_size;
(...skipping 17608 matching lines...) Expand 10 before | Expand all | Expand 10 after
20679 return tag_label.ToCString(); 20680 return tag_label.ToCString();
20680 } 20681 }
20681 20682
20682 20683
20683 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 20684 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
20684 Instance::PrintJSONImpl(stream, ref); 20685 Instance::PrintJSONImpl(stream, ref);
20685 } 20686 }
20686 20687
20687 20688
20688 } // namespace dart 20689 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698