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

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

Issue 2327693002: Add --parse-all option in order to benchmark and measure the scanner/parser performance. (Closed)
Patch Set: Address review comments. Created 4 years, 3 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
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/become.h" 10 #include "vm/become.h"
(...skipping 11396 matching lines...) Expand 10 before | Expand all | Expand 10 after
11407 return error.raw(); 11407 return error.raw();
11408 } 11408 }
11409 func.ClearICDataArray(); 11409 func.ClearICDataArray();
11410 func.ClearCode(); 11410 func.ClearCode();
11411 } 11411 }
11412 } 11412 }
11413 return error.raw(); 11413 return error.raw();
11414 } 11414 }
11415 11415
11416 11416
11417 RawError* Library::ParseAll(Thread* thread) {
11418 Zone* zone = thread->zone();
11419 Error& error = Error::Handle(zone);
11420 Isolate* isolate = thread->isolate();
11421 const GrowableObjectArray& libs = GrowableObjectArray::Handle(
11422 isolate->object_store()->libraries());
11423 Library& lib = Library::Handle(zone);
11424 Class& cls = Class::Handle(zone);
11425 for (int i = 0; i < libs.Length(); i++) {
11426 lib ^= libs.At(i);
11427 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
11428 while (it.HasNext()) {
11429 cls = it.GetNextClass();
11430 error = cls.EnsureIsFinalized(thread);
11431 if (!error.IsNull()) {
11432 return error.raw();
11433 }
11434 error = Compiler::ParseAllFunctions(cls);
11435 if (!error.IsNull()) {
11436 return error.raw();
11437 }
11438 }
11439 }
11440
11441 // Inner functions get added to the closures array. As part of compilation
11442 // more closures can be added to the end of the array. Compile all the
11443 // closures until we have reached the end of the "worklist".
11444 const GrowableObjectArray& closures = GrowableObjectArray::Handle(zone,
11445 Isolate::Current()->object_store()->closure_functions());
11446 Function& func = Function::Handle(zone);
11447 for (int i = 0; i < closures.Length(); i++) {
11448 func ^= closures.At(i);
11449 if (!func.HasCode()) {
11450 error = Compiler::ParseFunction(thread, func);
11451 if (!error.IsNull()) {
11452 return error.raw();
11453 }
11454 func.ClearICDataArray();
11455 func.ClearCode();
11456 }
11457 }
11458 return error.raw();
11459 }
11460
11461
11417 // Return Function::null() if function does not exist in libs. 11462 // Return Function::null() if function does not exist in libs.
11418 RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs, 11463 RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs,
11419 const char* class_name, 11464 const char* class_name,
11420 const char* function_name) { 11465 const char* function_name) {
11421 Thread* thread = Thread::Current(); 11466 Thread* thread = Thread::Current();
11422 Zone* zone = thread->zone(); 11467 Zone* zone = thread->zone();
11423 Function& func = Function::Handle(zone); 11468 Function& func = Function::Handle(zone);
11424 String& class_str = String::Handle(zone); 11469 String& class_str = String::Handle(zone);
11425 String& func_str = String::Handle(zone); 11470 String& func_str = String::Handle(zone);
11426 Class& cls = Class::Handle(zone); 11471 Class& cls = Class::Handle(zone);
(...skipping 11534 matching lines...) Expand 10 before | Expand all | Expand 10 after
22961 return UserTag::null(); 23006 return UserTag::null();
22962 } 23007 }
22963 23008
22964 23009
22965 const char* UserTag::ToCString() const { 23010 const char* UserTag::ToCString() const {
22966 const String& tag_label = String::Handle(label()); 23011 const String& tag_label = String::Handle(label());
22967 return tag_label.ToCString(); 23012 return tag_label.ToCString();
22968 } 23013 }
22969 23014
22970 } // namespace dart 23015 } // namespace dart
OLDNEW
« runtime/vm/compiler.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/parser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698