| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 // scope info. Please note, that the order of the shared function | 732 // scope info. Please note, that the order of the shared function |
| 733 // info initialization is important since set_scope_info might | 733 // info initialization is important since set_scope_info might |
| 734 // trigger a GC, causing the ASSERT below to be invalid if the code | 734 // trigger a GC, causing the ASSERT below to be invalid if the code |
| 735 // was flushed. By setting the code object last we avoid this. | 735 // was flushed. By setting the code object last we avoid this. |
| 736 Handle<SharedFunctionInfo> shared = info->shared_info(); | 736 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 737 Handle<Code> code = info->code(); | 737 Handle<Code> code = info->code(); |
| 738 Handle<JSFunction> function = info->closure(); | 738 Handle<JSFunction> function = info->closure(); |
| 739 Handle<ScopeInfo> scope_info = | 739 Handle<ScopeInfo> scope_info = |
| 740 ScopeInfo::Create(info->scope(), info->zone()); | 740 ScopeInfo::Create(info->scope(), info->zone()); |
| 741 shared->set_scope_info(*scope_info); | 741 shared->set_scope_info(*scope_info); |
| 742 shared->set_code(*code); | 742 shared->ReplaceCode(*code); |
| 743 if (!function.is_null()) { | 743 if (!function.is_null()) { |
| 744 function->ReplaceCode(*code); | 744 function->ReplaceCode(*code); |
| 745 ASSERT(!function->IsOptimized()); | 745 ASSERT(!function->IsOptimized()); |
| 746 } | 746 } |
| 747 | 747 |
| 748 // Set the expected number of properties for instances. | 748 // Set the expected number of properties for instances. |
| 749 FunctionLiteral* lit = info->function(); | 749 FunctionLiteral* lit = info->function(); |
| 750 int expected = lit->expected_property_count(); | 750 int expected = lit->expected_property_count(); |
| 751 SetExpectedNofPropertiesFromEstimate(shared, expected); | 751 SetExpectedNofPropertiesFromEstimate(shared, expected); |
| 752 | 752 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 } | 1110 } |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1113 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1114 Handle<Script>(info->script()), | 1114 Handle<Script>(info->script()), |
| 1115 Handle<Code>(info->code()), | 1115 Handle<Code>(info->code()), |
| 1116 info)); | 1116 info)); |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 } } // namespace v8::internal | 1119 } } // namespace v8::internal |
| OLD | NEW |