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