| 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 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 } | 812 } |
| 813 | 813 |
| 814 | 814 |
| 815 Handle<JSFunction> Execution::InstantiateFunction( | 815 Handle<JSFunction> Execution::InstantiateFunction( |
| 816 Handle<FunctionTemplateInfo> data, | 816 Handle<FunctionTemplateInfo> data, |
| 817 bool* exc) { | 817 bool* exc) { |
| 818 Isolate* isolate = data->GetIsolate(); | 818 Isolate* isolate = data->GetIsolate(); |
| 819 if (!data->do_not_cache()) { | 819 if (!data->do_not_cache()) { |
| 820 // Fast case: see if the function has already been instantiated | 820 // Fast case: see if the function has already been instantiated |
| 821 int serial_number = Smi::cast(data->serial_number())->value(); | 821 int serial_number = Smi::cast(data->serial_number())->value(); |
| 822 Object* elm = | 822 Handle<JSObject> cache(isolate->native_context()->function_cache()); |
| 823 isolate->native_context()->function_cache()-> | 823 Handle<Object> elm = |
| 824 GetElementNoExceptionThrown(isolate, serial_number); | 824 Object::GetElementNoExceptionThrown(isolate, cache, serial_number); |
| 825 if (elm->IsJSFunction()) return Handle<JSFunction>(JSFunction::cast(elm)); | 825 if (elm->IsJSFunction()) return Handle<JSFunction>::cast(elm); |
| 826 } | 826 } |
| 827 // The function has not yet been instantiated in this context; do it. | 827 // The function has not yet been instantiated in this context; do it. |
| 828 Handle<Object> args[] = { data }; | 828 Handle<Object> args[] = { data }; |
| 829 Handle<Object> result = Call(isolate, | 829 Handle<Object> result = Call(isolate, |
| 830 isolate->instantiate_fun(), | 830 isolate->instantiate_fun(), |
| 831 isolate->js_builtins_object(), | 831 isolate->js_builtins_object(), |
| 832 ARRAY_SIZE(args), | 832 ARRAY_SIZE(args), |
| 833 args, | 833 args, |
| 834 exc); | 834 exc); |
| 835 if (*exc) return Handle<JSFunction>::null(); | 835 if (*exc) return Handle<JSFunction>::null(); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 ASSERT(isolate->concurrent_recompilation_enabled()); | 1056 ASSERT(isolate->concurrent_recompilation_enabled()); |
| 1057 stack_guard->Continue(INSTALL_CODE); | 1057 stack_guard->Continue(INSTALL_CODE); |
| 1058 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 1058 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 1059 } | 1059 } |
| 1060 isolate->runtime_profiler()->OptimizeNow(); | 1060 isolate->runtime_profiler()->OptimizeNow(); |
| 1061 return isolate->heap()->undefined_value(); | 1061 return isolate->heap()->undefined_value(); |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 | 1064 |
| 1065 } } // namespace v8::internal | 1065 } } // namespace v8::internal |
| OLD | NEW |