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

Side by Side Diff: src/compiler/js-operator.cc

Issue 1596293003: Use default argument count for runtime function calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/js-operator.h" 5 #include "src/compiler/js-operator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/lazy-instance.h" 9 #include "src/base/lazy-instance.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 CallFunctionParameters parameters(arity, language_mode, feedback, 739 CallFunctionParameters parameters(arity, language_mode, feedback,
740 tail_call_mode, convert_mode); 740 tail_call_mode, convert_mode);
741 return new (zone()) Operator1<CallFunctionParameters>( // -- 741 return new (zone()) Operator1<CallFunctionParameters>( // --
742 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode 742 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode
743 "JSCallFunction", // name 743 "JSCallFunction", // name
744 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs 744 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs
745 parameters); // parameter 745 parameters); // parameter
746 } 746 }
747 747
748 748
749 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id) {
750 const Runtime::Function* f = Runtime::FunctionForId(id);
751 return CallRuntime(f, f->nargs);
752 }
753
754
749 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id, 755 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id,
750 size_t arity) { 756 size_t arity) {
751 CallRuntimeParameters parameters(id, arity); 757 const Runtime::Function* f = Runtime::FunctionForId(id);
752 const Runtime::Function* f = Runtime::FunctionForId(parameters.id()); 758 return CallRuntime(f, arity);
759 }
760
761
762 const Operator* JSOperatorBuilder::CallRuntime(const Runtime::Function* f,
763 size_t arity) {
764 CallRuntimeParameters parameters(f->function_id, arity);
753 DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity())); 765 DCHECK(f->nargs == -1 || f->nargs == static_cast<int>(parameters.arity()));
754 return new (zone()) Operator1<CallRuntimeParameters>( // -- 766 return new (zone()) Operator1<CallRuntimeParameters>( // --
755 IrOpcode::kJSCallRuntime, Operator::kNoProperties, // opcode 767 IrOpcode::kJSCallRuntime, Operator::kNoProperties, // opcode
756 "JSCallRuntime", // name 768 "JSCallRuntime", // name
757 parameters.arity(), 1, 1, f->result_size, 1, 2, // inputs/outputs 769 parameters.arity(), 1, 1, f->result_size, 1, 2, // inputs/outputs
758 parameters); // parameter 770 parameters); // parameter
759 } 771 }
760 772
761 773
762 const Operator* JSOperatorBuilder::CallConstruct( 774 const Operator* JSOperatorBuilder::CallConstruct(
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- 1013 return new (zone()) Operator1<Handle<ScopeInfo>>( // --
1002 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode 1014 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
1003 "JSCreateScriptContext", // name 1015 "JSCreateScriptContext", // name
1004 1, 1, 1, 1, 1, 2, // counts 1016 1, 1, 1, 1, 1, 2, // counts
1005 scpope_info); // parameter 1017 scpope_info); // parameter
1006 } 1018 }
1007 1019
1008 } // namespace compiler 1020 } // namespace compiler
1009 } // namespace internal 1021 } // namespace internal
1010 } // namespace v8 1022 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698