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

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

Issue 1457313002: [turbofan] Pass new.target to arguments adaptor trampoline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/compiler/js-typed-lowering.cc ('k') | src/ia32/interface-descriptors-ia32.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 <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast-numbering.h" 10 #include "src/ast-numbering.h"
(...skipping 7959 matching lines...) Expand 10 before | Expand all | Expand 10 after
7970 7970
7971 HInstruction* HOptimizedGraphBuilder::NewPlainFunctionCall(HValue* fun, 7971 HInstruction* HOptimizedGraphBuilder::NewPlainFunctionCall(HValue* fun,
7972 int argument_count) { 7972 int argument_count) {
7973 return New<HCallJSFunction>(fun, argument_count); 7973 return New<HCallJSFunction>(fun, argument_count);
7974 } 7974 }
7975 7975
7976 7976
7977 HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall( 7977 HInstruction* HOptimizedGraphBuilder::NewArgumentAdaptorCall(
7978 HValue* fun, HValue* context, 7978 HValue* fun, HValue* context,
7979 int argument_count, HValue* expected_param_count) { 7979 int argument_count, HValue* expected_param_count) {
7980 ArgumentAdaptorDescriptor descriptor(isolate()); 7980 HValue* new_target = graph()->GetConstantUndefined();
7981 HValue* arity = Add<HConstant>(argument_count - 1); 7981 HValue* arity = Add<HConstant>(argument_count - 1);
7982 7982
7983 HValue* op_vals[] = { context, fun, arity, expected_param_count }; 7983 HValue* op_vals[] = {context, fun, new_target, arity, expected_param_count};
7984 7984
7985 Handle<Code> adaptor = 7985 Callable callable = CodeFactory::ArgumentAdaptor(isolate());
7986 isolate()->builtins()->ArgumentsAdaptorTrampoline(); 7986 HConstant* stub = Add<HConstant>(callable.code());
7987 HConstant* adaptor_value = Add<HConstant>(adaptor);
7988 7987
7989 return New<HCallWithDescriptor>(adaptor_value, argument_count, descriptor, 7988 return New<HCallWithDescriptor>(stub, argument_count, callable.descriptor(),
7990 Vector<HValue*>(op_vals, arraysize(op_vals))); 7989 Vector<HValue*>(op_vals, arraysize(op_vals)));
7991 } 7990 }
7992 7991
7993 7992
7994 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction( 7993 HInstruction* HOptimizedGraphBuilder::BuildCallConstantFunction(
7995 Handle<JSFunction> jsfun, int argument_count) { 7994 Handle<JSFunction> jsfun, int argument_count) {
7996 HValue* target = Add<HConstant>(jsfun); 7995 HValue* target = Add<HConstant>(jsfun);
7997 // For constant functions, we try to avoid calling the 7996 // For constant functions, we try to avoid calling the
7998 // argument adaptor and instead call the function directly 7997 // argument adaptor and instead call the function directly
7999 int formal_parameter_count = 7998 int formal_parameter_count =
(...skipping 5630 matching lines...) Expand 10 before | Expand all | Expand 10 after
13630 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13629 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13631 } 13630 }
13632 13631
13633 #ifdef DEBUG 13632 #ifdef DEBUG
13634 graph_->Verify(false); // No full verify. 13633 graph_->Verify(false); // No full verify.
13635 #endif 13634 #endif
13636 } 13635 }
13637 13636
13638 } // namespace internal 13637 } // namespace internal
13639 } // namespace v8 13638 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698