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

Side by Side Diff: src/hydrogen.cc

Issue 6321012: Version 3.0.9... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 11 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 | « src/hydrogen.h ('k') | src/hydrogen-instructions.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 next_block_id_(0), 680 next_block_id_(0),
681 info_(info), 681 info_(info),
682 blocks_(8), 682 blocks_(8),
683 values_(16), 683 values_(16),
684 phi_list_(NULL) { 684 phi_list_(NULL) {
685 start_environment_ = new HEnvironment(NULL, info->scope(), info->closure()); 685 start_environment_ = new HEnvironment(NULL, info->scope(), info->closure());
686 start_environment_->set_ast_id(info->function()->id()); 686 start_environment_->set_ast_id(info->function()->id());
687 } 687 }
688 688
689 689
690 bool HGraph::AllowAggressiveOptimizations() const {
691 return info()->shared_info()->opt_count() + 1 < Compiler::kDefaultMaxOptCount;
692 }
693
694
690 Handle<Code> HGraph::Compile() { 695 Handle<Code> HGraph::Compile() {
691 int values = GetMaximumValueID(); 696 int values = GetMaximumValueID();
692 if (values > LAllocator::max_initial_value_ids()) { 697 if (values > LAllocator::max_initial_value_ids()) {
693 if (FLAG_trace_bailout) PrintF("Function is too big\n"); 698 if (FLAG_trace_bailout) PrintF("Function is too big\n");
694 return Handle<Code>::null(); 699 return Handle<Code>::null();
695 } 700 }
696 701
697 LAllocator allocator(values, this); 702 LAllocator allocator(values, this);
698 LChunkBuilder builder(this, &allocator); 703 LChunkBuilder builder(this, &allocator);
699 LChunk* chunk = builder.Build(); 704 LChunk* chunk = builder.Build();
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 } 1451 }
1447 } 1452 }
1448 1453
1449 // Only move instructions that postdominate the loop header (i.e. are 1454 // Only move instructions that postdominate the loop header (i.e. are
1450 // always executed inside the loop). This is to avoid unnecessary 1455 // always executed inside the loop). This is to avoid unnecessary
1451 // deoptimizations assuming the loop is executed at least once. 1456 // deoptimizations assuming the loop is executed at least once.
1452 // TODO(fschneider): Better type feedback should give us information 1457 // TODO(fschneider): Better type feedback should give us information
1453 // about code that was never executed. 1458 // about code that was never executed.
1454 bool HGlobalValueNumberer::ShouldMove(HInstruction* instr, 1459 bool HGlobalValueNumberer::ShouldMove(HInstruction* instr,
1455 HBasicBlock* loop_header) { 1460 HBasicBlock* loop_header) {
1456 if (!instr->IsChange() && 1461 if (FLAG_aggressive_loop_invariant_motion &&
1457 FLAG_aggressive_loop_invariant_motion) return true; 1462 !instr->IsChange() &&
1463 (!instr->IsCheckInstruction() ||
1464 graph_->AllowAggressiveOptimizations())) {
1465 return true;
1466 }
1458 HBasicBlock* block = instr->block(); 1467 HBasicBlock* block = instr->block();
1459 bool result = true; 1468 bool result = true;
1460 if (block != loop_header) { 1469 if (block != loop_header) {
1461 for (int i = 1; i < loop_header->predecessors()->length(); ++i) { 1470 for (int i = 1; i < loop_header->predecessors()->length(); ++i) {
1462 bool found = false; 1471 bool found = false;
1463 HBasicBlock* pred = loop_header->predecessors()->at(i); 1472 HBasicBlock* pred = loop_header->predecessors()->at(i);
1464 while (pred != loop_header) { 1473 while (pred != loop_header) {
1465 if (pred == block) found = true; 1474 if (pred == block) found = true;
1466 pred = pred->dominator(); 1475 pred = pred->dominator();
1467 } 1476 }
(...skipping 4339 matching lines...) Expand 10 before | Expand all | Expand 10 after
5807 } 5816 }
5808 } 5817 }
5809 5818
5810 #ifdef DEBUG 5819 #ifdef DEBUG
5811 if (graph_ != NULL) graph_->Verify(); 5820 if (graph_ != NULL) graph_->Verify();
5812 if (allocator_ != NULL) allocator_->Verify(); 5821 if (allocator_ != NULL) allocator_->Verify();
5813 #endif 5822 #endif
5814 } 5823 }
5815 5824
5816 } } // namespace v8::internal 5825 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698