| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 info->script(), | 409 info->script(), |
| 410 code); | 410 code); |
| 411 | 411 |
| 412 // Update the shared function info with the compiled code and the scope info. | 412 // Update the shared function info with the compiled code and the scope info. |
| 413 // Please note, that the order of the sharedfunction initialization is | 413 // Please note, that the order of the sharedfunction initialization is |
| 414 // important since set_scope_info might trigger a GC, causing the ASSERT | 414 // important since set_scope_info might trigger a GC, causing the ASSERT |
| 415 // below to be invalid if the code was flushed. By settting the code | 415 // below to be invalid if the code was flushed. By settting the code |
| 416 // object last we avoid this. | 416 // object last we avoid this. |
| 417 shared->set_scope_info(*SerializedScopeInfo::Create(info->scope())); | 417 shared->set_scope_info(*SerializedScopeInfo::Create(info->scope())); |
| 418 shared->set_code(*code); | 418 shared->set_code(*code); |
| 419 if (!info->closure().is_null()) { |
| 420 info->closure()->set_code(*code); |
| 421 } |
| 419 | 422 |
| 420 // Set the expected number of properties for instances. | 423 // Set the expected number of properties for instances. |
| 421 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); | 424 SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count()); |
| 422 | 425 |
| 423 // Set the optimication hints after performing lazy compilation, as these are | 426 // Set the optimication hints after performing lazy compilation, as these are |
| 424 // not set when the function is set up as a lazily compiled function. | 427 // not set when the function is set up as a lazily compiled function. |
| 425 shared->SetThisPropertyAssignmentsInfo( | 428 shared->SetThisPropertyAssignmentsInfo( |
| 426 lit->has_only_simple_this_property_assignments(), | 429 lit->has_only_simple_this_property_assignments(), |
| 427 *lit->this_property_assignments()); | 430 *lit->this_property_assignments()); |
| 428 | 431 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), | 569 PROFILE(CodeCreateEvent(Logger::ToNativeByScript(tag, *script), |
| 567 *code, *func_name)); | 570 *code, *func_name)); |
| 568 OPROFILE(CreateNativeCodeRegion(*func_name, | 571 OPROFILE(CreateNativeCodeRegion(*func_name, |
| 569 code->instruction_start(), | 572 code->instruction_start(), |
| 570 code->instruction_size())); | 573 code->instruction_size())); |
| 571 } | 574 } |
| 572 } | 575 } |
| 573 } | 576 } |
| 574 | 577 |
| 575 } } // namespace v8::internal | 578 } } // namespace v8::internal |
| OLD | NEW |