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

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

Issue 539153002: Port and integrate the irregexp engine from V8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Explicitly null IC-Data, whitespace fixes in tests. Created 6 years, 2 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) 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 FLAG_deoptimize_filter) != NULL) { 220 FLAG_deoptimize_filter) != NULL) {
221 return true; 221 return true;
222 } 222 }
223 return false; 223 return false;
224 } 224 }
225 225
226 226
227 static bool IsEmptyBlock(BlockEntryInstr* block) { 227 static bool IsEmptyBlock(BlockEntryInstr* block) {
228 return !block->HasParallelMove() && 228 return !block->HasParallelMove() &&
229 block->next()->IsGoto() && 229 block->next()->IsGoto() &&
230 !block->next()->AsGoto()->HasParallelMove(); 230 !block->next()->AsGoto()->HasParallelMove() &&
231 !block->IsIndirectEntry();
231 } 232 }
232 233
233 234
234 void FlowGraphCompiler::CompactBlock(BlockEntryInstr* block) { 235 void FlowGraphCompiler::CompactBlock(BlockEntryInstr* block) {
235 BlockInfo* block_info = block_info_[block->postorder_number()]; 236 BlockInfo* block_info = block_info_[block->postorder_number()];
236 237
237 // Break out of cycles in the control flow graph. 238 // Break out of cycles in the control flow graph.
238 if (block_info->is_marked()) { 239 if (block_info->is_marked()) {
239 return; 240 return;
240 } 241 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 BlockEntryInstr* entry = block_order()[i]; 348 BlockEntryInstr* entry = block_order()[i];
348 assembler()->Comment("B%" Pd "", entry->block_id()); 349 assembler()->Comment("B%" Pd "", entry->block_id());
349 set_current_block(entry); 350 set_current_block(entry);
350 351
351 if (WasCompacted(entry)) { 352 if (WasCompacted(entry)) {
352 continue; 353 continue;
353 } 354 }
354 355
355 LoopInfoComment(assembler(), *entry, *loop_headers); 356 LoopInfoComment(assembler(), *entry, *loop_headers);
356 357
358 entry->set_offset(assembler()->CodeSize());
357 entry->EmitNativeCode(this); 359 entry->EmitNativeCode(this);
358 // Compile all successors until an exit, branch, or a block entry. 360 // Compile all successors until an exit, branch, or a block entry.
359 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) { 361 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
360 Instruction* instr = it.Current(); 362 Instruction* instr = it.Current();
361 if (FLAG_code_comments || 363 if (FLAG_code_comments ||
362 FLAG_disassemble || 364 FLAG_disassemble ||
363 FLAG_disassemble_optimized) { 365 FLAG_disassemble_optimized) {
364 if (FLAG_source_lines) { 366 if (FLAG_source_lines) {
365 EmitSourceLine(instr); 367 EmitSourceLine(instr);
366 } 368 }
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 } else { 812 } else {
811 // Finalize the stack map array and add it to the code object. 813 // Finalize the stack map array and add it to the code object.
812 ASSERT(is_optimizing()); 814 ASSERT(is_optimizing());
813 code.set_stackmaps( 815 code.set_stackmaps(
814 Array::Handle(stackmap_table_builder_->FinalizeStackmaps(code))); 816 Array::Handle(stackmap_table_builder_->FinalizeStackmaps(code)));
815 } 817 }
816 } 818 }
817 819
818 820
819 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) { 821 void FlowGraphCompiler::FinalizeVarDescriptors(const Code& code) {
822 // Irregexp functions do not have a node sequence.
Vyacheslav Egorov (Google) 2014/10/07 15:48:30 I wonder what happens if somebody tries to break i
jgruber1 2014/10/07 17:16:51 Done.
823 if (flow_graph().IsIrregexpFunction()) return;
824
820 const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle( 825 const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle(
821 parsed_function_.node_sequence()->scope()->GetVarDescriptors( 826 parsed_function_.node_sequence()->scope()->GetVarDescriptors(
822 parsed_function_.function())); 827 parsed_function_.function()));
823 code.set_var_descriptors(var_descs); 828 code.set_var_descriptors(var_descs);
824 } 829 }
825 830
826 831
827 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) { 832 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) {
828 ASSERT(code.static_calls_target_table() == Array::null()); 833 ASSERT(code.static_calls_target_table() == Array::null());
829 code.set_static_calls_target_table( 834 code.set_static_calls_target_table(
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 threshold = FLAG_optimization_counter_scale * basic_blocks + 1487 threshold = FLAG_optimization_counter_scale * basic_blocks +
1483 FLAG_min_optimization_counter_threshold; 1488 FLAG_min_optimization_counter_threshold;
1484 if (threshold > FLAG_optimization_counter_threshold) { 1489 if (threshold > FLAG_optimization_counter_threshold) {
1485 threshold = FLAG_optimization_counter_threshold; 1490 threshold = FLAG_optimization_counter_threshold;
1486 } 1491 }
1487 } 1492 }
1488 return threshold; 1493 return threshold;
1489 } 1494 }
1490 1495
1491 } // namespace dart 1496 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698