| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); | 621 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, shared); |
| 622 | 622 |
| 623 if (info->IsOptimizing()) { | 623 if (info->IsOptimizing()) { |
| 624 ASSERT(shared->scope_info() != ScopeInfo::Empty()); | 624 ASSERT(shared->scope_info() != ScopeInfo::Empty()); |
| 625 function->ReplaceCode(*code); | 625 function->ReplaceCode(*code); |
| 626 } else { | 626 } else { |
| 627 // Update the shared function info with the compiled code and the | 627 // Update the shared function info with the compiled code and the |
| 628 // scope info. Please note, that the order of the shared function | 628 // scope info. Please note, that the order of the shared function |
| 629 // info initialization is important since set_scope_info might | 629 // info initialization is important since set_scope_info might |
| 630 // trigger a GC, causing the ASSERT below to be invalid if the code | 630 // trigger a GC, causing the ASSERT below to be invalid if the code |
| 631 // was flushed. By settting the code object last we avoid this. | 631 // was flushed. By setting the code object last we avoid this. |
| 632 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope()); | 632 Handle<ScopeInfo> scope_info = ScopeInfo::Create(info->scope()); |
| 633 shared->set_scope_info(*scope_info); | 633 shared->set_scope_info(*scope_info); |
| 634 shared->set_code(*code); | 634 shared->set_code(*code); |
| 635 if (!function.is_null()) { | 635 if (!function.is_null()) { |
| 636 function->ReplaceCode(*code); | 636 function->ReplaceCode(*code); |
| 637 ASSERT(!function->IsOptimized()); | 637 ASSERT(!function->IsOptimized()); |
| 638 } | 638 } |
| 639 | 639 |
| 640 // Set the expected number of properties for instances. | 640 // Set the expected number of properties for instances. |
| 641 FunctionLiteral* lit = info->function(); | 641 FunctionLiteral* lit = info->function(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 } | 786 } |
| 787 } | 787 } |
| 788 | 788 |
| 789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 789 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 790 Handle<Script>(info->script()), | 790 Handle<Script>(info->script()), |
| 791 Handle<Code>(info->code()), | 791 Handle<Code>(info->code()), |
| 792 info)); | 792 info)); |
| 793 } | 793 } |
| 794 | 794 |
| 795 } } // namespace v8::internal | 795 } } // namespace v8::internal |
| OLD | NEW |