| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
| (...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 i++) { | 2052 i++) { |
| 2053 if (!CompileBuiltin(isolate(), i)) return false; | 2053 if (!CompileBuiltin(isolate(), i)) return false; |
| 2054 // TODO(ager): We really only need to install the JS builtin | 2054 // TODO(ager): We really only need to install the JS builtin |
| 2055 // functions on the builtins object after compiling and running | 2055 // functions on the builtins object after compiling and running |
| 2056 // runtime.js. | 2056 // runtime.js. |
| 2057 if (!InstallJSBuiltins(builtins)) return false; | 2057 if (!InstallJSBuiltins(builtins)) return false; |
| 2058 } | 2058 } |
| 2059 | 2059 |
| 2060 InstallNativeFunctions(); | 2060 InstallNativeFunctions(); |
| 2061 | 2061 |
| 2062 native_context()->set_function_cache(heap()->empty_fixed_array()); | 2062 auto function_cache = |
| 2063 ObjectHashTable::New(isolate(), ApiNatives::kInitialFunctionCacheSize); |
| 2064 native_context()->set_function_cache(*function_cache); |
| 2063 | 2065 |
| 2064 // Store the map for the string prototype after the natives has been compiled | 2066 // Store the map for the string prototype after the natives has been compiled |
| 2065 // and the String function has been set up. | 2067 // and the String function has been set up. |
| 2066 Handle<JSFunction> string_function(native_context()->string_function()); | 2068 Handle<JSFunction> string_function(native_context()->string_function()); |
| 2067 DCHECK(JSObject::cast( | 2069 DCHECK(JSObject::cast( |
| 2068 string_function->initial_map()->prototype())->HasFastProperties()); | 2070 string_function->initial_map()->prototype())->HasFastProperties()); |
| 2069 native_context()->set_string_function_prototype_map( | 2071 native_context()->set_string_function_prototype_map( |
| 2070 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 2072 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 2071 | 2073 |
| 2072 // Install Function.prototype.call and apply. | 2074 // Install Function.prototype.call and apply. |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 return from + sizeof(NestingCounterType); | 2861 return from + sizeof(NestingCounterType); |
| 2860 } | 2862 } |
| 2861 | 2863 |
| 2862 | 2864 |
| 2863 // Called when the top-level V8 mutex is destroyed. | 2865 // Called when the top-level V8 mutex is destroyed. |
| 2864 void Bootstrapper::FreeThreadResources() { | 2866 void Bootstrapper::FreeThreadResources() { |
| 2865 DCHECK(!IsActive()); | 2867 DCHECK(!IsActive()); |
| 2866 } | 2868 } |
| 2867 | 2869 |
| 2868 } } // namespace v8::internal | 2870 } } // namespace v8::internal |
| OLD | NEW |