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

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

Issue 1016973002: Move CHA state keeping from Isolate to Thread. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « runtime/vm/cha_test.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 volatile bool use_far_branches = false; 390 volatile bool use_far_branches = false;
391 while (!done) { 391 while (!done) {
392 const intptr_t prev_deopt_id = isolate->deopt_id(); 392 const intptr_t prev_deopt_id = isolate->deopt_id();
393 isolate->set_deopt_id(0); 393 isolate->set_deopt_id(0);
394 LongJumpScope jump; 394 LongJumpScope jump;
395 if (setjmp(*jump.Set()) == 0) { 395 if (setjmp(*jump.Set()) == 0) {
396 FlowGraph* flow_graph = NULL; 396 FlowGraph* flow_graph = NULL;
397 397
398 // Class hierarchy analysis is registered with the isolate in the 398 // Class hierarchy analysis is registered with the isolate in the
399 // constructor and unregisters itself upon destruction. 399 // constructor and unregisters itself upon destruction.
400 CHA cha(isolate); 400 CHA cha(thread);
401 401
402 // TimerScope needs an isolate to be properly terminated in case of a 402 // TimerScope needs an isolate to be properly terminated in case of a
403 // LongJump. 403 // LongJump.
404 { 404 {
405 TimerScope timer(FLAG_compiler_stats, 405 TimerScope timer(FLAG_compiler_stats,
406 &CompilerStats::graphbuilder_timer, 406 &CompilerStats::graphbuilder_timer,
407 isolate); 407 isolate);
408 ZoneGrowableArray<const ICData*>* ic_data_array = 408 ZoneGrowableArray<const ICData*>* ic_data_array =
409 new(zone) ZoneGrowableArray<const ICData*>(); 409 new(zone) ZoneGrowableArray<const ICData*>();
410 if (optimized) { 410 if (optimized) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 } 738 }
739 ISL_Print("Patch unoptimized '%s' entry point %#" Px "\n", 739 ISL_Print("Patch unoptimized '%s' entry point %#" Px "\n",
740 function.ToFullyQualifiedCString(), 740 function.ToFullyQualifiedCString(),
741 Code::Handle(function.unoptimized_code()).EntryPoint()); 741 Code::Handle(function.unoptimized_code()).EntryPoint());
742 } 742 }
743 } 743 }
744 function.AttachCode(code); 744 function.AttachCode(code);
745 745
746 // Register code with the classes it depends on because of CHA. 746 // Register code with the classes it depends on because of CHA.
747 for (intptr_t i = 0; 747 for (intptr_t i = 0;
748 i < isolate->cha()->leaf_classes().length(); 748 i < thread->cha()->leaf_classes().length();
749 ++i) { 749 ++i) {
750 isolate->cha()->leaf_classes()[i]->RegisterCHACode(code); 750 thread->cha()->leaf_classes()[i]->RegisterCHACode(code);
751 } 751 }
752 752
753 for (intptr_t i = 0; 753 for (intptr_t i = 0;
754 i < flow_graph->guarded_fields()->length(); 754 i < flow_graph->guarded_fields()->length();
755 i++) { 755 i++) {
756 const Field* field = (*flow_graph->guarded_fields())[i]; 756 const Field* field = (*flow_graph->guarded_fields())[i];
757 field->RegisterDependentCode(code); 757 field->RegisterDependentCode(code);
758 } 758 }
759 } else { // not optimized. 759 } else { // not optimized.
760 if (function.ic_data_array() == Array::null()) { 760 if (function.ic_data_array() == Array::null()) {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 const Object& result = 1231 const Object& result =
1232 PassiveObject::Handle(isolate->object_store()->sticky_error()); 1232 PassiveObject::Handle(isolate->object_store()->sticky_error());
1233 isolate->object_store()->clear_sticky_error(); 1233 isolate->object_store()->clear_sticky_error();
1234 return result.raw(); 1234 return result.raw();
1235 } 1235 }
1236 UNREACHABLE(); 1236 UNREACHABLE();
1237 return Object::null(); 1237 return Object::null();
1238 } 1238 }
1239 1239
1240 } // namespace dart 1240 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698