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

Unified Diff: src/codegen.cc

Issue 165527: Refactor SetFunctionInfo to reduce long argument list (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.cc
===================================================================
--- src/codegen.cc (revision 2686)
+++ src/codegen.cc (working copy)
@@ -243,23 +243,18 @@
// in the full script source. When counting characters in the script source the
// the first character is number 0 (not 1).
void CodeGenerator::SetFunctionInfo(Handle<JSFunction> fun,
- int length,
- int function_token_position,
- int start_position,
- int end_position,
- bool is_expression,
+ FunctionLiteral* lit,
bool is_toplevel,
- Handle<Script> script,
- Handle<String> inferred_name) {
- fun->shared()->set_length(length);
- fun->shared()->set_formal_parameter_count(length);
+ Handle<Script> script) {
+ fun->shared()->set_length(lit->num_parameters());
+ fun->shared()->set_formal_parameter_count(lit->num_parameters());
fun->shared()->set_script(*script);
- fun->shared()->set_function_token_position(function_token_position);
- fun->shared()->set_start_position(start_position);
- fun->shared()->set_end_position(end_position);
- fun->shared()->set_is_expression(is_expression);
+ fun->shared()->set_function_token_position(lit->function_token_position());
+ fun->shared()->set_start_position(lit->start_position());
+ fun->shared()->set_end_position(lit->end_position());
+ fun->shared()->set_is_expression(lit->is_expression());
fun->shared()->set_is_toplevel(is_toplevel);
- fun->shared()->set_inferred_name(*inferred_name);
+ fun->shared()->set_inferred_name(*lit->inferred_name());
}
@@ -317,11 +312,7 @@
node->materialized_literal_count(),
node->contains_array_literal(),
code);
- CodeGenerator::SetFunctionInfo(function, node->num_parameters(),
- node->function_token_position(),
- node->start_position(), node->end_position(),
- node->is_expression(), false, script_,
- node->inferred_name());
+ CodeGenerator::SetFunctionInfo(function, node, false, script_);
#ifdef ENABLE_DEBUGGER_SUPPORT
// Notify debugger that a new function has been added.
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698