| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 | 763 |
| 764 Vector<const char> name = Natives::GetScriptName(index); | 764 Vector<const char> name = Natives::GetScriptName(index); |
| 765 | 765 |
| 766 Handle<JSFunction> boilerplate; | 766 Handle<JSFunction> boilerplate; |
| 767 | 767 |
| 768 if (!Bootstrapper::NativesCacheLookup(name, &boilerplate)) { | 768 if (!Bootstrapper::NativesCacheLookup(name, &boilerplate)) { |
| 769 Handle<String> source_code = Bootstrapper::NativesSourceLookup(index); | 769 Handle<String> source_code = Bootstrapper::NativesSourceLookup(index); |
| 770 Handle<String> script_name = Factory::NewStringFromAscii(name); | 770 Handle<String> script_name = Factory::NewStringFromAscii(name); |
| 771 bool allow_natives_syntax = FLAG_allow_natives_syntax; | 771 bool allow_natives_syntax = FLAG_allow_natives_syntax; |
| 772 FLAG_allow_natives_syntax = true; | 772 FLAG_allow_natives_syntax = true; |
| 773 boilerplate = Compiler::Compile(source_code, script_name, 0, 0, NULL, NULL); | 773 boilerplate = Compiler::Compile(source_code, script_name, 0, 0, NULL, NULL, |
| 774 Handle<String>::null()); |
| 774 FLAG_allow_natives_syntax = allow_natives_syntax; | 775 FLAG_allow_natives_syntax = allow_natives_syntax; |
| 775 // If the compilation failed (possibly due to stack overflows), we | 776 // If the compilation failed (possibly due to stack overflows), we |
| 776 // should never enter the result in the natives cache. Instead we | 777 // should never enter the result in the natives cache. Instead we |
| 777 // return from the function without marking the function as having | 778 // return from the function without marking the function as having |
| 778 // been lazily loaded. | 779 // been lazily loaded. |
| 779 if (boilerplate.is_null()) { | 780 if (boilerplate.is_null()) { |
| 780 *pending_exception = true; | 781 *pending_exception = true; |
| 781 return; | 782 return; |
| 782 } | 783 } |
| 783 Bootstrapper::NativesCacheAdd(name, boilerplate); | 784 Bootstrapper::NativesCacheAdd(name, boilerplate); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); | 829 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); |
| 829 obj->set_map(*new_map); | 830 obj->set_map(*new_map); |
| 830 new_map->set_needs_loading(true); | 831 new_map->set_needs_loading(true); |
| 831 // Store the lazy loading info in the constructor field. We'll | 832 // Store the lazy loading info in the constructor field. We'll |
| 832 // reestablish the constructor from the fixed array after loading. | 833 // reestablish the constructor from the fixed array after loading. |
| 833 new_map->set_constructor(*arr); | 834 new_map->set_constructor(*arr); |
| 834 ASSERT(!obj->IsLoaded()); | 835 ASSERT(!obj->IsLoaded()); |
| 835 } | 836 } |
| 836 | 837 |
| 837 } } // namespace v8::internal | 838 } } // namespace v8::internal |
| OLD | NEW |