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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 5033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5044 DCHECK(current_block() != NULL); | 5044 DCHECK(current_block() != NULL); |
5045 DCHECK(current_block()->HasPredecessor()); | 5045 DCHECK(current_block()->HasPredecessor()); |
5046 Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo( | 5046 Handle<SharedFunctionInfo> shared_info = Compiler::GetSharedFunctionInfo( |
5047 expr, current_info()->script(), top_info()); | 5047 expr, current_info()->script(), top_info()); |
5048 // We also have a stack overflow if the recursive compilation did. | 5048 // We also have a stack overflow if the recursive compilation did. |
5049 if (HasStackOverflow()) return; | 5049 if (HasStackOverflow()) return; |
5050 // Use the fast case closure allocation code that allocates in new | 5050 // Use the fast case closure allocation code that allocates in new |
5051 // space for nested functions that don't need pretenuring. | 5051 // space for nested functions that don't need pretenuring. |
5052 HConstant* shared_info_value = Add<HConstant>(shared_info); | 5052 HConstant* shared_info_value = Add<HConstant>(shared_info); |
5053 HInstruction* instr; | 5053 HInstruction* instr; |
| 5054 Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate()); |
| 5055 HValue* vector_value = Add<HConstant>(vector); |
| 5056 int index = TypeFeedbackVector::GetIndex(expr->LiteralFeedbackSlot()); |
| 5057 HValue* index_value = Add<HConstant>(index); |
5054 if (!expr->pretenure()) { | 5058 if (!expr->pretenure()) { |
5055 Callable callable = CodeFactory::FastNewClosure(isolate()); | 5059 Callable callable = CodeFactory::FastNewClosure(isolate()); |
5056 HValue* values[] = {shared_info_value}; | 5060 HValue* values[] = {shared_info_value, vector_value, index_value}; |
5057 HConstant* stub_value = Add<HConstant>(callable.code()); | 5061 HConstant* stub_value = Add<HConstant>(callable.code()); |
5058 instr = New<HCallWithDescriptor>(stub_value, 0, callable.descriptor(), | 5062 instr = New<HCallWithDescriptor>(stub_value, 0, callable.descriptor(), |
5059 ArrayVector(values)); | 5063 ArrayVector(values)); |
5060 } else { | 5064 } else { |
5061 Add<HPushArguments>(shared_info_value); | 5065 Add<HPushArguments>(shared_info_value); |
| 5066 Add<HPushArguments>(vector_value); |
| 5067 Add<HPushArguments>(index_value); |
5062 Runtime::FunctionId function_id = | 5068 Runtime::FunctionId function_id = |
5063 expr->pretenure() ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure; | 5069 expr->pretenure() ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure; |
5064 instr = New<HCallRuntime>(Runtime::FunctionForId(function_id), 1); | 5070 instr = New<HCallRuntime>(Runtime::FunctionForId(function_id), 3); |
5065 } | 5071 } |
5066 return ast_context()->ReturnInstruction(instr, expr->id()); | 5072 return ast_context()->ReturnInstruction(instr, expr->id()); |
5067 } | 5073 } |
5068 | 5074 |
5069 | 5075 |
5070 void HOptimizedGraphBuilder::VisitClassLiteral(ClassLiteral* lit) { | 5076 void HOptimizedGraphBuilder::VisitClassLiteral(ClassLiteral* lit) { |
5071 DCHECK(!HasStackOverflow()); | 5077 DCHECK(!HasStackOverflow()); |
5072 DCHECK(current_block() != NULL); | 5078 DCHECK(current_block() != NULL); |
5073 DCHECK(current_block()->HasPredecessor()); | 5079 DCHECK(current_block()->HasPredecessor()); |
5074 return Bailout(kClassLiteral); | 5080 return Bailout(kClassLiteral); |
(...skipping 7927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13002 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13008 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13003 } | 13009 } |
13004 | 13010 |
13005 #ifdef DEBUG | 13011 #ifdef DEBUG |
13006 graph_->Verify(false); // No full verify. | 13012 graph_->Verify(false); // No full verify. |
13007 #endif | 13013 #endif |
13008 } | 13014 } |
13009 | 13015 |
13010 } // namespace internal | 13016 } // namespace internal |
13011 } // namespace v8 | 13017 } // namespace v8 |
OLD | NEW |