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

Side by Side Diff: src/compiler.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/codegen.cc ('k') | src/ia32/codegen-ia32.h » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 #endif 213 #endif
214 214
215 // Allocate function. 215 // Allocate function.
216 Handle<JSFunction> fun = 216 Handle<JSFunction> fun =
217 Factory::NewFunctionBoilerplate(lit->name(), 217 Factory::NewFunctionBoilerplate(lit->name(),
218 lit->materialized_literal_count(), 218 lit->materialized_literal_count(),
219 lit->contains_array_literal(), 219 lit->contains_array_literal(),
220 code); 220 code);
221 221
222 CodeGenerator::SetFunctionInfo(fun, lit->scope()->num_parameters(), 222 ASSERT_EQ(RelocInfo::kNoPosition, lit->function_token_position());
223 RelocInfo::kNoPosition, 223 CodeGenerator::SetFunctionInfo(fun, lit, true, script);
224 lit->start_position(), lit->end_position(),
225 lit->is_expression(), true, script,
226 lit->inferred_name());
227 224
228 // Hint to the runtime system used when allocating space for initial 225 // Hint to the runtime system used when allocating space for initial
229 // property space by setting the expected number of properties for 226 // property space by setting the expected number of properties for
230 // the instances of the function. 227 // the instances of the function.
231 SetExpectedNofPropertiesFromEstimate(fun, lit->expected_property_count()); 228 SetExpectedNofPropertiesFromEstimate(fun, lit->expected_property_count());
232 229
233 #ifdef ENABLE_DEBUGGER_SUPPORT 230 #ifdef ENABLE_DEBUGGER_SUPPORT
234 // Notify debugger 231 // Notify debugger
235 Debugger::OnAfterCompile(script, fun); 232 Debugger::OnAfterCompile(script, fun);
236 #endif 233 #endif
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 // Set the expected number of properties for instances. 425 // Set the expected number of properties for instances.
429 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); 426 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
430 427
431 // Check the function has compiled code. 428 // Check the function has compiled code.
432 ASSERT(shared->is_compiled()); 429 ASSERT(shared->is_compiled());
433 return true; 430 return true;
434 } 431 }
435 432
436 433
437 } } // namespace v8::internal 434 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/ia32/codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698