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