| 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 5277 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5288     context = Add<HLoadNamedField>( | 5288     context = Add<HLoadNamedField>( | 
| 5289         context, nullptr, | 5289         context, nullptr, | 
| 5290         HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); | 5290         HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); | 
| 5291   } | 5291   } | 
| 5292   return context; | 5292   return context; | 
| 5293 } | 5293 } | 
| 5294 | 5294 | 
| 5295 | 5295 | 
| 5296 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { | 5296 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { | 
| 5297   if (expr->is_this()) { | 5297   if (expr->is_this()) { | 
| 5298     current_info()->set_this_has_uses(true); | 5298     current_info()->parse_info()->set_this_has_uses(true); | 
| 5299   } | 5299   } | 
| 5300 | 5300 | 
| 5301   DCHECK(!HasStackOverflow()); | 5301   DCHECK(!HasStackOverflow()); | 
| 5302   DCHECK(current_block() != NULL); | 5302   DCHECK(current_block() != NULL); | 
| 5303   DCHECK(current_block()->HasPredecessor()); | 5303   DCHECK(current_block()->HasPredecessor()); | 
| 5304   Variable* variable = expr->var(); | 5304   Variable* variable = expr->var(); | 
| 5305   switch (variable->location()) { | 5305   switch (variable->location()) { | 
| 5306     case Variable::UNALLOCATED: { | 5306     case Variable::UNALLOCATED: { | 
| 5307       if (IsLexicalVariableMode(variable->mode())) { | 5307       if (IsLexicalVariableMode(variable->mode())) { | 
| 5308         // TODO(rossberg): should this be an DCHECK? | 5308         // TODO(rossberg): should this be an DCHECK? | 
| (...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 7832 | 7832 | 
| 7833   // We don't want to add more than a certain number of nodes from inlining. | 7833   // We don't want to add more than a certain number of nodes from inlining. | 
| 7834   // Always inline small methods (<= 10 nodes). | 7834   // Always inline small methods (<= 10 nodes). | 
| 7835   if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, | 7835   if (inlined_count_ > Min(FLAG_max_inlined_nodes_cumulative, | 
| 7836                            kUnlimitedMaxInlinedNodesCumulative)) { | 7836                            kUnlimitedMaxInlinedNodesCumulative)) { | 
| 7837     TraceInline(target, caller, "cumulative AST node limit reached"); | 7837     TraceInline(target, caller, "cumulative AST node limit reached"); | 
| 7838     return false; | 7838     return false; | 
| 7839   } | 7839   } | 
| 7840 | 7840 | 
| 7841   // Parse and allocate variables. | 7841   // Parse and allocate variables. | 
| 7842   CompilationInfo target_info(target, zone()); |  | 
| 7843   // Use the same AstValueFactory for creating strings in the sub-compilation | 7842   // Use the same AstValueFactory for creating strings in the sub-compilation | 
| 7844   // step, but don't transfer ownership to target_info. | 7843   // step, but don't transfer ownership to target_info. | 
| 7845   target_info.SetAstValueFactory(top_info()->ast_value_factory(), false); | 7844   ParseInfo parse_info(zone()); | 
|  | 7845   parse_info.InitializeFromJSFunction(target); | 
|  | 7846   parse_info.set_ast_value_factory( | 
|  | 7847       top_info()->parse_info()->ast_value_factory()); | 
|  | 7848   parse_info.set_ast_value_factory_owned(false); | 
|  | 7849 | 
|  | 7850   CompilationInfo target_info(&parse_info); | 
| 7846   Handle<SharedFunctionInfo> target_shared(target->shared()); | 7851   Handle<SharedFunctionInfo> target_shared(target->shared()); | 
| 7847   if (!Compiler::ParseAndAnalyze(&target_info)) { | 7852   if (!Compiler::ParseAndAnalyze(target_info.parse_info())) { | 
| 7848     if (target_info.isolate()->has_pending_exception()) { | 7853     if (target_info.isolate()->has_pending_exception()) { | 
| 7849       // Parse or scope error, never optimize this function. | 7854       // Parse or scope error, never optimize this function. | 
| 7850       SetStackOverflow(); | 7855       SetStackOverflow(); | 
| 7851       target_shared->DisableOptimization(kParseScopeError); | 7856       target_shared->DisableOptimization(kParseScopeError); | 
| 7852     } | 7857     } | 
| 7853     TraceInline(target, caller, "parse failure"); | 7858     TraceInline(target, caller, "parse failure"); | 
| 7854     return false; | 7859     return false; | 
| 7855   } | 7860   } | 
| 7856 | 7861 | 
| 7857   if (target_info.scope()->num_heap_slots() > 0) { | 7862   if (target_info.scope()->num_heap_slots() > 0) { | 
| (...skipping 5564 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 13422   if (ShouldProduceTraceOutput()) { | 13427   if (ShouldProduceTraceOutput()) { | 
| 13423     isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13428     isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 
| 13424   } | 13429   } | 
| 13425 | 13430 | 
| 13426 #ifdef DEBUG | 13431 #ifdef DEBUG | 
| 13427   graph_->Verify(false);  // No full verify. | 13432   graph_->Verify(false);  // No full verify. | 
| 13428 #endif | 13433 #endif | 
| 13429 } | 13434 } | 
| 13430 | 13435 | 
| 13431 } }  // namespace v8::internal | 13436 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|