OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 5279 matching lines...) Loading... |
5290 context = Add<HLoadNamedField>( | 5290 context = Add<HLoadNamedField>( |
5291 context, nullptr, | 5291 context, nullptr, |
5292 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); | 5292 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); |
5293 } | 5293 } |
5294 return context; | 5294 return context; |
5295 } | 5295 } |
5296 | 5296 |
5297 | 5297 |
5298 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { | 5298 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { |
5299 if (expr->is_this()) { | 5299 if (expr->is_this()) { |
5300 current_info()->set_this_has_uses(true); | 5300 current_info()->parse_info()->set_this_has_uses(true); |
5301 } | 5301 } |
5302 | 5302 |
5303 DCHECK(!HasStackOverflow()); | 5303 DCHECK(!HasStackOverflow()); |
5304 DCHECK(current_block() != NULL); | 5304 DCHECK(current_block() != NULL); |
5305 DCHECK(current_block()->HasPredecessor()); | 5305 DCHECK(current_block()->HasPredecessor()); |
5306 Variable* variable = expr->var(); | 5306 Variable* variable = expr->var(); |
5307 switch (variable->location()) { | 5307 switch (variable->location()) { |
5308 case Variable::UNALLOCATED: { | 5308 case Variable::UNALLOCATED: { |
5309 if (IsLexicalVariableMode(variable->mode())) { | 5309 if (IsLexicalVariableMode(variable->mode())) { |
5310 // TODO(rossberg): should this be an DCHECK? | 5310 // TODO(rossberg): should this be an DCHECK? |
(...skipping 2523 matching lines...) Loading... |
7834 | 7834 |
7835 // We don't want to add more than a certain number of nodes from inlining. | 7835 // We don't want to add more than a certain number of nodes from inlining. |
7836 // Always inline small methods (<= 10 nodes). | 7836 // Always inline small methods (<= 10 nodes). |
7837 if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, | 7837 if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, |
7838 kUnlimitedMaxInlinedNodesCumulative)) { | 7838 kUnlimitedMaxInlinedNodesCumulative)) { |
7839 TraceInline(target, caller, "cumulative AST node limit reached"); | 7839 TraceInline(target, caller, "cumulative AST node limit reached"); |
7840 return false; | 7840 return false; |
7841 } | 7841 } |
7842 | 7842 |
7843 // Parse and allocate variables. | 7843 // Parse and allocate variables. |
7844 CompilationInfo target_info(target, zone()); | |
7845 // Use the same AstValueFactory for creating strings in the sub-compilation | 7844 // Use the same AstValueFactory for creating strings in the sub-compilation |
7846 // step, but don't transfer ownership to target_info. | 7845 // step, but don't transfer ownership to target_info. |
7847 target_info.SetAstValueFactory(top_info()->ast_value_factory(), false); | 7846 ParseInfo parse_info(zone()); |
| 7847 parse_info.InitializeFromJSFunction(target); |
| 7848 parse_info.set_ast_value_factory( |
| 7849 top_info()->parse_info()->ast_value_factory()); |
| 7850 parse_info.set_ast_value_factory_owned(false); |
| 7851 |
| 7852 CompilationInfo target_info(&parse_info); |
7848 Handle<SharedFunctionInfo> target_shared(target->shared()); | 7853 Handle<SharedFunctionInfo> target_shared(target->shared()); |
7849 if (!Compiler::ParseAndAnalyze(&target_info)) { | 7854 if (!Compiler::ParseAndAnalyze(target_info.parse_info())) { |
7850 if (target_info.isolate()->has_pending_exception()) { | 7855 if (target_info.isolate()->has_pending_exception()) { |
7851 // Parse or scope error, never optimize this function. | 7856 // Parse or scope error, never optimize this function. |
7852 SetStackOverflow(); | 7857 SetStackOverflow(); |
7853 target_shared->DisableOptimization(kParseScopeError); | 7858 target_shared->DisableOptimization(kParseScopeError); |
7854 } | 7859 } |
7855 TraceInline(target, caller, "parse failure"); | 7860 TraceInline(target, caller, "parse failure"); |
7856 return false; | 7861 return false; |
7857 } | 7862 } |
7858 | 7863 |
7859 if (target_info.scope()->num_heap_slots() > 0) { | 7864 if (target_info.scope()->num_heap_slots() > 0) { |
(...skipping 5557 matching lines...) Loading... |
13417 if (ShouldProduceTraceOutput()) { | 13422 if (ShouldProduceTraceOutput()) { |
13418 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13423 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13419 } | 13424 } |
13420 | 13425 |
13421 #ifdef DEBUG | 13426 #ifdef DEBUG |
13422 graph_->Verify(false); // No full verify. | 13427 graph_->Verify(false); // No full verify. |
13423 #endif | 13428 #endif |
13424 } | 13429 } |
13425 | 13430 |
13426 } } // namespace v8::internal | 13431 } } // namespace v8::internal |
OLD | NEW |