Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 2607563002: [builtins] FastNewClosureStub becomes a builtin. (Closed)
Patch Set: Renames. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/contexts.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5034 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!expr->pretenure()) { 5054 if (!expr->pretenure()) {
5055 FastNewClosureStub stub(isolate()); 5055 Callable callable = CodeFactory::FastNewClosure(isolate());
5056 FastNewClosureDescriptor descriptor(isolate());
5057 HValue* values[] = {shared_info_value}; 5056 HValue* values[] = {shared_info_value};
5058 HConstant* stub_value = Add<HConstant>(stub.GetCode()); 5057 HConstant* stub_value = Add<HConstant>(callable.code());
5059 instr = New<HCallWithDescriptor>(stub_value, 0, descriptor, 5058 instr = New<HCallWithDescriptor>(stub_value, 0, callable.descriptor(),
5060 ArrayVector(values)); 5059 ArrayVector(values));
5061 } else { 5060 } else {
5062 Add<HPushArguments>(shared_info_value); 5061 Add<HPushArguments>(shared_info_value);
5063 Runtime::FunctionId function_id = 5062 Runtime::FunctionId function_id =
5064 expr->pretenure() ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure; 5063 expr->pretenure() ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure;
5065 instr = New<HCallRuntime>(Runtime::FunctionForId(function_id), 1); 5064 instr = New<HCallRuntime>(Runtime::FunctionForId(function_id), 1);
5066 } 5065 }
5067 return ast_context()->ReturnInstruction(instr, expr->id()); 5066 return ast_context()->ReturnInstruction(instr, expr->id());
5068 } 5067 }
5069 5068
(...skipping 7928 matching lines...) Expand 10 before | Expand all | Expand 10 after
12998 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 12997 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12999 } 12998 }
13000 12999
13001 #ifdef DEBUG 13000 #ifdef DEBUG
13002 graph_->Verify(false); // No full verify. 13001 graph_->Verify(false); // No full verify.
13003 #endif 13002 #endif
13004 } 13003 }
13005 13004
13006 } // namespace internal 13005 } // namespace internal
13007 } // namespace v8 13006 } // namespace v8
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698