| 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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 // scope info. Please note, that the order of the shared function | 690 // scope info. Please note, that the order of the shared function |
| 691 // info initialization is important since set_scope_info might | 691 // info initialization is important since set_scope_info might |
| 692 // trigger a GC, causing the ASSERT below to be invalid if the code | 692 // trigger a GC, causing the ASSERT below to be invalid if the code |
| 693 // was flushed. By setting the code object last we avoid this. | 693 // was flushed. By setting the code object last we avoid this. |
| 694 Handle<SharedFunctionInfo> shared = info->shared_info(); | 694 Handle<SharedFunctionInfo> shared = info->shared_info(); |
| 695 Handle<Code> code = info->code(); | 695 Handle<Code> code = info->code(); |
| 696 Handle<JSFunction> function = info->closure(); | 696 Handle<JSFunction> function = info->closure(); |
| 697 Handle<ScopeInfo> scope_info = | 697 Handle<ScopeInfo> scope_info = |
| 698 ScopeInfo::Create(info->scope(), info->zone()); | 698 ScopeInfo::Create(info->scope(), info->zone()); |
| 699 shared->set_scope_info(*scope_info); | 699 shared->set_scope_info(*scope_info); |
| 700 shared->set_code(*code); | 700 shared->ReplaceCode(*code); |
| 701 if (!function.is_null()) { | 701 if (!function.is_null()) { |
| 702 function->ReplaceCode(*code); | 702 function->ReplaceCode(*code); |
| 703 ASSERT(!function->IsOptimized()); | 703 ASSERT(!function->IsOptimized()); |
| 704 } | 704 } |
| 705 | 705 |
| 706 // Set the expected number of properties for instances. | 706 // Set the expected number of properties for instances. |
| 707 FunctionLiteral* lit = info->function(); | 707 FunctionLiteral* lit = info->function(); |
| 708 int expected = lit->expected_property_count(); | 708 int expected = lit->expected_property_count(); |
| 709 SetExpectedNofPropertiesFromEstimate(shared, expected); | 709 SetExpectedNofPropertiesFromEstimate(shared, expected); |
| 710 | 710 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 } | 1068 } |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1071 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1072 Handle<Script>(info->script()), | 1072 Handle<Script>(info->script()), |
| 1073 Handle<Code>(info->code()), | 1073 Handle<Code>(info->code()), |
| 1074 info)); | 1074 info)); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 } } // namespace v8::internal | 1077 } } // namespace v8::internal |
| OLD | NEW |