| 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 5273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 | 5284 |
| 5285 void HOptimizedGraphBuilder::VisitCaseClause(CaseClause* clause) { | 5285 void HOptimizedGraphBuilder::VisitCaseClause(CaseClause* clause) { |
| 5286 UNREACHABLE(); | 5286 UNREACHABLE(); |
| 5287 } | 5287 } |
| 5288 | 5288 |
| 5289 | 5289 |
| 5290 void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { | 5290 void HOptimizedGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
| 5291 DCHECK(!HasStackOverflow()); | 5291 DCHECK(!HasStackOverflow()); |
| 5292 DCHECK(current_block() != NULL); | 5292 DCHECK(current_block() != NULL); |
| 5293 DCHECK(current_block()->HasPredecessor()); | 5293 DCHECK(current_block()->HasPredecessor()); |
| 5294 Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo( | 5294 Handle<SharedFunctionInfo> shared_info = expr->shared_info(); |
| 5295 expr, current_info()->script(), top_info()); | 5295 if (shared_info.is_null()) { |
| 5296 shared_info = |
| 5297 Compiler::BuildFunctionInfo(expr, current_info()->script(), top_info()); |
| 5298 } |
| 5296 // We also have a stack overflow if the recursive compilation did. | 5299 // We also have a stack overflow if the recursive compilation did. |
| 5297 if (HasStackOverflow()) return; | 5300 if (HasStackOverflow()) return; |
| 5298 HFunctionLiteral* instr = | 5301 HFunctionLiteral* instr = |
| 5299 New<HFunctionLiteral>(shared_info, expr->pretenure()); | 5302 New<HFunctionLiteral>(shared_info, expr->pretenure()); |
| 5300 return ast_context()->ReturnInstruction(instr, expr->id()); | 5303 return ast_context()->ReturnInstruction(instr, expr->id()); |
| 5301 } | 5304 } |
| 5302 | 5305 |
| 5303 | 5306 |
| 5304 void HOptimizedGraphBuilder::VisitClassLiteral(ClassLiteral* lit) { | 5307 void HOptimizedGraphBuilder::VisitClassLiteral(ClassLiteral* lit) { |
| 5305 DCHECK(!HasStackOverflow()); | 5308 DCHECK(!HasStackOverflow()); |
| (...skipping 6353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11659 } | 11662 } |
| 11660 | 11663 |
| 11661 | 11664 |
| 11662 void HOptimizedGraphBuilder::VisitFunctionDeclaration( | 11665 void HOptimizedGraphBuilder::VisitFunctionDeclaration( |
| 11663 FunctionDeclaration* declaration) { | 11666 FunctionDeclaration* declaration) { |
| 11664 VariableProxy* proxy = declaration->proxy(); | 11667 VariableProxy* proxy = declaration->proxy(); |
| 11665 Variable* variable = proxy->var(); | 11668 Variable* variable = proxy->var(); |
| 11666 switch (variable->location()) { | 11669 switch (variable->location()) { |
| 11667 case Variable::UNALLOCATED: { | 11670 case Variable::UNALLOCATED: { |
| 11668 globals_.Add(variable->name(), zone()); | 11671 globals_.Add(variable->name(), zone()); |
| 11669 Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo( | 11672 Handle<SharedFunctionInfo> function = Compiler::BuildFunctionInfo( |
| 11670 declaration->fun(), current_info()->script(), top_info()); | 11673 declaration->fun(), current_info()->script(), top_info()); |
| 11671 // Check for stack-overflow exception. | 11674 // Check for stack-overflow exception. |
| 11672 if (function.is_null()) return SetStackOverflow(); | 11675 if (function.is_null()) return SetStackOverflow(); |
| 11673 globals_.Add(function, zone()); | 11676 globals_.Add(function, zone()); |
| 11674 return; | 11677 return; |
| 11675 } | 11678 } |
| 11676 case Variable::PARAMETER: | 11679 case Variable::PARAMETER: |
| 11677 case Variable::LOCAL: { | 11680 case Variable::LOCAL: { |
| 11678 CHECK_ALIVE(VisitForValue(declaration->fun())); | 11681 CHECK_ALIVE(VisitForValue(declaration->fun())); |
| 11679 HValue* value = Pop(); | 11682 HValue* value = Pop(); |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13204 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13207 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13205 } | 13208 } |
| 13206 | 13209 |
| 13207 #ifdef DEBUG | 13210 #ifdef DEBUG |
| 13208 graph_->Verify(false); // No full verify. | 13211 graph_->Verify(false); // No full verify. |
| 13209 #endif | 13212 #endif |
| 13210 } | 13213 } |
| 13211 | 13214 |
| 13212 } // namespace internal | 13215 } // namespace internal |
| 13213 } // namespace v8 | 13216 } // namespace v8 |
| OLD | NEW |