OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 builder_->set_current_block(exit_block_); | 956 builder_->set_current_block(exit_block_); |
957 // Pop the phi from the expression stack | 957 // Pop the phi from the expression stack |
958 builder_->environment()->Pop(); | 958 builder_->environment()->Pop(); |
959 finished_ = true; | 959 finished_ = true; |
960 } | 960 } |
961 | 961 |
962 | 962 |
963 HGraph* HGraphBuilder::CreateGraph() { | 963 HGraph* HGraphBuilder::CreateGraph() { |
964 graph_ = new(zone()) HGraph(info_); | 964 graph_ = new(zone()) HGraph(info_); |
965 if (FLAG_hydrogen_stats) isolate()->GetHStatistics()->Initialize(info_); | 965 if (FLAG_hydrogen_stats) isolate()->GetHStatistics()->Initialize(info_); |
966 CompilationPhase phase("H_Block building", isolate(), zone()); | 966 CompilationPhase phase("H_Block building", info_); |
967 set_current_block(graph()->entry_block()); | 967 set_current_block(graph()->entry_block()); |
968 if (!BuildGraph()) return NULL; | 968 if (!BuildGraph()) return NULL; |
969 graph()->FinalizeUniqueValueIds(); | 969 graph()->FinalizeUniqueValueIds(); |
970 return graph_; | 970 return graph_; |
971 } | 971 } |
972 | 972 |
973 | 973 |
974 HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) { | 974 HInstruction* HGraphBuilder::AddInstruction(HInstruction* instr) { |
975 ASSERT(current_block() != NULL); | 975 ASSERT(current_block() != NULL); |
976 current_block()->AddInstruction(instr); | 976 current_block()->AddInstruction(instr); |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 HLoopInformation* loop_; | 2377 HLoopInformation* loop_; |
2378 HBasicBlock* block_; | 2378 HBasicBlock* block_; |
2379 HBasicBlock* loop_header_; | 2379 HBasicBlock* loop_header_; |
2380 int loop_index; | 2380 int loop_index; |
2381 int loop_length; | 2381 int loop_length; |
2382 HSuccessorIterator successor_iterator; | 2382 HSuccessorIterator successor_iterator; |
2383 }; | 2383 }; |
2384 | 2384 |
2385 | 2385 |
2386 void HGraph::OrderBlocks() { | 2386 void HGraph::OrderBlocks() { |
2387 CompilationPhase phase("H_Block ordering", isolate(), zone()); | 2387 CompilationPhase phase("H_Block ordering", info()); |
2388 BitVector visited(blocks_.length(), zone()); | 2388 BitVector visited(blocks_.length(), zone()); |
2389 | 2389 |
2390 ZoneList<HBasicBlock*> reverse_result(8, zone()); | 2390 ZoneList<HBasicBlock*> reverse_result(8, zone()); |
2391 HBasicBlock* start = blocks_[0]; | 2391 HBasicBlock* start = blocks_[0]; |
2392 PostorderProcessor* postorder = | 2392 PostorderProcessor* postorder = |
2393 PostorderProcessor::CreateEntryProcessor(zone(), start, &visited); | 2393 PostorderProcessor::CreateEntryProcessor(zone(), start, &visited); |
2394 while (postorder != NULL) { | 2394 while (postorder != NULL) { |
2395 postorder = postorder->PerformStep(zone(), &visited, &reverse_result); | 2395 postorder = postorder->PerformStep(zone(), &visited, &reverse_result); |
2396 } | 2396 } |
2397 blocks_.Rewind(0); | 2397 blocks_.Rewind(0); |
(...skipping 5527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7925 } | 7925 } |
7926 | 7926 |
7927 // We don't want to add more than a certain number of nodes from inlining. | 7927 // We don't want to add more than a certain number of nodes from inlining. |
7928 if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, | 7928 if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, |
7929 kUnlimitedMaxInlinedNodesCumulative)) { | 7929 kUnlimitedMaxInlinedNodesCumulative)) { |
7930 TraceInline(target, caller, "cumulative AST node limit reached"); | 7930 TraceInline(target, caller, "cumulative AST node limit reached"); |
7931 return false; | 7931 return false; |
7932 } | 7932 } |
7933 | 7933 |
7934 // Parse and allocate variables. | 7934 // Parse and allocate variables. |
7935 CompilationInfo target_info(target, zone(), current_info()->phase_zone()); | 7935 CompilationInfo target_info(target, zone()); |
7936 Handle<SharedFunctionInfo> target_shared(target->shared()); | 7936 Handle<SharedFunctionInfo> target_shared(target->shared()); |
7937 if (!Parser::Parse(&target_info) || !Scope::Analyze(&target_info)) { | 7937 if (!Parser::Parse(&target_info) || !Scope::Analyze(&target_info)) { |
7938 if (target_info.isolate()->has_pending_exception()) { | 7938 if (target_info.isolate()->has_pending_exception()) { |
7939 // Parse or scope error, never optimize this function. | 7939 // Parse or scope error, never optimize this function. |
7940 SetStackOverflow(); | 7940 SetStackOverflow(); |
7941 target_shared->DisableOptimization("parse/scope error"); | 7941 target_shared->DisableOptimization("parse/scope error"); |
7942 } | 7942 } |
7943 TraceInline(target, caller, "parse failure"); | 7943 TraceInline(target, caller, "parse failure"); |
7944 return false; | 7944 return false; |
7945 } | 7945 } |
(...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11554 if (ShouldProduceTraceOutput()) { | 11554 if (ShouldProduceTraceOutput()) { |
11555 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11555 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11556 } | 11556 } |
11557 | 11557 |
11558 #ifdef DEBUG | 11558 #ifdef DEBUG |
11559 graph_->Verify(false); // No full verify. | 11559 graph_->Verify(false); // No full verify. |
11560 #endif | 11560 #endif |
11561 } | 11561 } |
11562 | 11562 |
11563 } } // namespace v8::internal | 11563 } } // namespace v8::internal |
OLD | NEW |