| 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 ASSERT(public_class_name.Length() > 0); | 893 ASSERT(public_class_name.Length() > 0); |
| 894 ASSERT(public_class_name.CharAt(0) == '_'); | 894 ASSERT(public_class_name.CharAt(0) == '_'); |
| 895 String& str = String::Handle(); | 895 String& str = String::Handle(); |
| 896 str = lib.PrivateName(public_class_name); | 896 str = lib.PrivateName(public_class_name); |
| 897 cls.set_name(str); | 897 cls.set_name(str); |
| 898 lib.AddClass(cls); | 898 lib.AddClass(cls); |
| 899 } | 899 } |
| 900 | 900 |
| 901 | 901 |
| 902 RawError* Object::Init(Isolate* isolate) { | 902 RawError* Object::Init(Isolate* isolate) { |
| 903 TIMERSCOPE(isolate, time_bootstrap); | 903 TIMERSCOPE(time_bootstrap); |
| 904 ObjectStore* object_store = isolate->object_store(); | 904 ObjectStore* object_store = isolate->object_store(); |
| 905 | 905 |
| 906 Class& cls = Class::Handle(); | 906 Class& cls = Class::Handle(); |
| 907 Type& type = Type::Handle(); | 907 Type& type = Type::Handle(); |
| 908 Array& array = Array::Handle(); | 908 Array& array = Array::Handle(); |
| 909 Library& lib = Library::Handle(); | 909 Library& lib = Library::Handle(); |
| 910 | 910 |
| 911 // All RawArray fields will be initialized to an empty array, therefore | 911 // All RawArray fields will be initialized to an empty array, therefore |
| 912 // initialize array class first. | 912 // initialize array class first. |
| 913 cls = Class::New<Array>(); | 913 cls = Class::New<Array>(); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1327 Intrinsifier::InitializeState(); | 1327 Intrinsifier::InitializeState(); |
| 1328 | 1328 |
| 1329 // Set up recognized state of all functions (core, math and typed data). | 1329 // Set up recognized state of all functions (core, math and typed data). |
| 1330 MethodRecognizer::InitializeState(); | 1330 MethodRecognizer::InitializeState(); |
| 1331 | 1331 |
| 1332 return Error::null(); | 1332 return Error::null(); |
| 1333 } | 1333 } |
| 1334 | 1334 |
| 1335 | 1335 |
| 1336 void Object::InitFromSnapshot(Isolate* isolate) { | 1336 void Object::InitFromSnapshot(Isolate* isolate) { |
| 1337 TIMERSCOPE(isolate, time_bootstrap); | 1337 TIMERSCOPE(time_bootstrap); |
| 1338 ObjectStore* object_store = isolate->object_store(); | 1338 ObjectStore* object_store = isolate->object_store(); |
| 1339 | 1339 |
| 1340 Class& cls = Class::Handle(); | 1340 Class& cls = Class::Handle(); |
| 1341 | 1341 |
| 1342 // Set up empty classes in the object store, these will get | 1342 // Set up empty classes in the object store, these will get |
| 1343 // initialized correctly when we read from the snapshot. | 1343 // initialized correctly when we read from the snapshot. |
| 1344 // This is done to allow bootstrapping of reading classes from the snapshot. | 1344 // This is done to allow bootstrapping of reading classes from the snapshot. |
| 1345 cls = Class::New<Instance>(kInstanceCid); | 1345 cls = Class::New<Instance>(kInstanceCid); |
| 1346 object_store->set_object_class(cls); | 1346 object_store->set_object_class(cls); |
| 1347 | 1347 |
| (...skipping 5941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7289 | 7289 |
| 7290 | 7290 |
| 7291 void Script::Tokenize(const String& private_key) const { | 7291 void Script::Tokenize(const String& private_key) const { |
| 7292 const TokenStream& tkns = TokenStream::Handle(tokens()); | 7292 const TokenStream& tkns = TokenStream::Handle(tokens()); |
| 7293 if (!tkns.IsNull()) { | 7293 if (!tkns.IsNull()) { |
| 7294 // Already tokenized. | 7294 // Already tokenized. |
| 7295 return; | 7295 return; |
| 7296 } | 7296 } |
| 7297 | 7297 |
| 7298 // Get the source, scan and allocate the token stream. | 7298 // Get the source, scan and allocate the token stream. |
| 7299 Isolate* isolate = Isolate::Current(); | 7299 TimerScope timer(FLAG_compiler_stats, &CompilerStats::scanner_timer); |
| 7300 TimerScope timer(FLAG_compiler_stats, &CompilerStats::scanner_timer, isolate); | 7300 const String& src = String::Handle(Source()); |
| 7301 const String& src = String::Handle(isolate, Source()); | |
| 7302 Scanner scanner(src, private_key); | 7301 Scanner scanner(src, private_key); |
| 7303 set_tokens(TokenStream::Handle(isolate, TokenStream::New(scanner.GetStream(), | 7302 set_tokens(TokenStream::Handle(TokenStream::New(scanner.GetStream(), |
| 7304 private_key))); | 7303 private_key))); |
| 7305 if (FLAG_compiler_stats) { | 7304 if (FLAG_compiler_stats) { |
| 7306 CompilerStats::src_length += src.Length(); | 7305 CompilerStats::src_length += src.Length(); |
| 7307 } | 7306 } |
| 7308 } | 7307 } |
| 7309 | 7308 |
| 7310 | 7309 |
| 7311 void Script::SetLocationOffset(intptr_t line_offset, | 7310 void Script::SetLocationOffset(intptr_t line_offset, |
| 7312 intptr_t col_offset) const { | 7311 intptr_t col_offset) const { |
| 7313 ASSERT(line_offset >= 0); | 7312 ASSERT(line_offset >= 0); |
| 7314 ASSERT(col_offset >= 0); | 7313 ASSERT(col_offset >= 0); |
| (...skipping 10142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17457 return "_MirrorReference"; | 17456 return "_MirrorReference"; |
| 17458 } | 17457 } |
| 17459 | 17458 |
| 17460 | 17459 |
| 17461 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 17460 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 17462 Instance::PrintToJSONStream(stream, ref); | 17461 Instance::PrintToJSONStream(stream, ref); |
| 17463 } | 17462 } |
| 17464 | 17463 |
| 17465 | 17464 |
| 17466 } // namespace dart | 17465 } // namespace dart |
| OLD | NEW |