OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |