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

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

Issue 351673002: Add class id constants fields to dart:_internal class 'ClassID'. Use the fields in the library (mor… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1365
1366 ClassFinalizer::VerifyBootstrapClasses(); 1366 ClassFinalizer::VerifyBootstrapClasses();
1367 MarkInvisibleFunctions(); 1367 MarkInvisibleFunctions();
1368 1368
1369 // Set up the intrinsic state of all functions (core, math and typed data). 1369 // Set up the intrinsic state of all functions (core, math and typed data).
1370 Intrinsifier::InitializeState(); 1370 Intrinsifier::InitializeState();
1371 1371
1372 // Set up recognized state of all functions (core, math and typed data). 1372 // Set up recognized state of all functions (core, math and typed data).
1373 MethodRecognizer::InitializeState(); 1373 MethodRecognizer::InitializeState();
1374 1374
1375 // Adds static const fields (class ids) to the class 'ClassID');
1376 lib = Library::LookupLibrary(Symbols::DartInternal());
1377 ASSERT(!lib.IsNull());
1378 cls = lib.LookupClassAllowPrivate(Symbols::ClassID());
1379 ASSERT(!cls.IsNull());
1380 Field& field = Field::Handle(isolate);
1381 Smi& value = Smi::Handle(isolate);
1382
1383 #define CLASS_LIST_WITH_NULL(V) \
1384 V(Null) \
1385 CLASS_LIST_NO_OBJECT(V)
1386
1387 #define ADD_SET_FIELD(clazz) \
1388 field = Field::New(String::Handle(Symbols::New("cid"#clazz)), \
siva 2014/06/23 21:23:31 This String::Handle can also be hoisted out and th
srdjan 2014/06/23 22:27:35 Done.
1389 true, false, true, cls, 0); \
1390 value = Smi::New(k##clazz##Cid); \
1391 field.set_value(value); \
1392 field.set_type(Type::Handle(Type::IntType())); \
1393 cls.AddField(field); \
1394
1395 CLASS_LIST_WITH_NULL(ADD_SET_FIELD)
1396 #undef ADD_SET_FIELD
1397
1375 return Error::null(); 1398 return Error::null();
1376 } 1399 }
1377 1400
1378 1401
1379 void Object::InitFromSnapshot(Isolate* isolate) { 1402 void Object::InitFromSnapshot(Isolate* isolate) {
1380 TIMERSCOPE(isolate, time_bootstrap); 1403 TIMERSCOPE(isolate, time_bootstrap);
1381 ObjectStore* object_store = isolate->object_store(); 1404 ObjectStore* object_store = isolate->object_store();
1382 1405
1383 Class& cls = Class::Handle(); 1406 Class& cls = Class::Handle();
1384 1407
(...skipping 17670 matching lines...) Expand 10 before | Expand all | Expand 10 after
19055 return tag_label.ToCString(); 19078 return tag_label.ToCString();
19056 } 19079 }
19057 19080
19058 19081
19059 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19082 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19060 Instance::PrintJSONImpl(stream, ref); 19083 Instance::PrintJSONImpl(stream, ref);
19061 } 19084 }
19062 19085
19063 19086
19064 } // namespace dart 19087 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698