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

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

Issue 1410363005: Make ICData changes thread safe (first compute array, then set it). Install code in the main thread… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/flow_graph_inliner.h" 5 #include "vm/flow_graph_inliner.h"
6 6
7 #include "vm/block_scheduler.h" 7 #include "vm/block_scheduler.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/flow_graph.h" 10 #include "vm/flow_graph.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 ZoneGrowableArray<const ICData*>* ic_data_array = 701 ZoneGrowableArray<const ICData*>* ic_data_array =
702 new(Z) ZoneGrowableArray<const ICData*>(); 702 new(Z) ZoneGrowableArray<const ICData*>();
703 function.RestoreICDataMap(ic_data_array); 703 function.RestoreICDataMap(ic_data_array);
704 704
705 // Build the callee graph. 705 // Build the callee graph.
706 InlineExitCollector* exit_collector = 706 InlineExitCollector* exit_collector =
707 new(Z) InlineExitCollector(caller_graph_, call); 707 new(Z) InlineExitCollector(caller_graph_, call);
708 FlowGraphBuilder builder(*parsed_function, 708 FlowGraphBuilder builder(*parsed_function,
709 *ic_data_array, 709 *ic_data_array,
710 exit_collector, 710 exit_collector,
711 Thread::kNoDeoptId); 711 Compiler::kNoOSRDeoptId);
712 builder.SetInitialBlockId(caller_graph_->max_block_id()); 712 builder.SetInitialBlockId(caller_graph_->max_block_id());
713 FlowGraph* callee_graph; 713 FlowGraph* callee_graph;
714 { 714 {
715 CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer); 715 CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer);
716 callee_graph = builder.BuildGraph(); 716 callee_graph = builder.BuildGraph();
717 } 717 }
718 718
719 // The parameter stubs are a copy of the actual arguments providing 719 // The parameter stubs are a copy of the actual arguments providing
720 // concrete information about the values, for example constant values, 720 // concrete information about the values, for example constant values,
721 // without linking between the caller and callee graphs. 721 // without linking between the caller and callee graphs.
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 result, 1499 result,
1500 call_->env(), // Return can become deoptimization target. 1500 call_->env(), // Return can become deoptimization target.
1501 FlowGraph::kEffect); 1501 FlowGraph::kEffect);
1502 entry->set_last_instruction(result); 1502 entry->set_last_instruction(result);
1503 exit_collector->AddExit(result); 1503 exit_collector->AddExit(result);
1504 ParsedFunction* temp_parsed_function = 1504 ParsedFunction* temp_parsed_function =
1505 new ParsedFunction(Thread::Current(), target); 1505 new ParsedFunction(Thread::Current(), target);
1506 GraphEntryInstr* graph_entry = 1506 GraphEntryInstr* graph_entry =
1507 new(Z) GraphEntryInstr(*temp_parsed_function, 1507 new(Z) GraphEntryInstr(*temp_parsed_function,
1508 entry, 1508 entry,
1509 Thread::kNoDeoptId); // No OSR id. 1509 Compiler::kNoOSRDeoptId);
1510 // Update polymorphic inliner state. 1510 // Update polymorphic inliner state.
1511 inlined_entries_.Add(graph_entry); 1511 inlined_entries_.Add(graph_entry);
1512 exit_collector_->Union(exit_collector); 1512 exit_collector_->Union(exit_collector);
1513 return true; 1513 return true;
1514 } 1514 }
1515 return false; 1515 return false;
1516 } 1516 }
1517 1517
1518 1518
1519 // Build a DAG to dispatch to the inlined function bodies. Load the class 1519 // Build a DAG to dispatch to the inlined function bodies. Load the class
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 intptr_t FlowGraphInliner::NextInlineId(const Function& function, 1893 intptr_t FlowGraphInliner::NextInlineId(const Function& function,
1894 intptr_t parent_id) { 1894 intptr_t parent_id) {
1895 const intptr_t id = inline_id_to_function_->length(); 1895 const intptr_t id = inline_id_to_function_->length();
1896 inline_id_to_function_->Add(&function); 1896 inline_id_to_function_->Add(&function);
1897 caller_inline_id_->Add(parent_id); 1897 caller_inline_id_->Add(parent_id);
1898 return id; 1898 return id;
1899 } 1899 }
1900 1900
1901 1901
1902 } // namespace dart 1902 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698