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/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/extensions/externalize-string-extension.h" | 9 #include "src/extensions/externalize-string-extension.h" |
10 #include "src/extensions/free-buffer-extension.h" | 10 #include "src/extensions/free-buffer-extension.h" |
(...skipping 2489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 | 2500 |
2501 | 2501 |
2502 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { | 2502 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
2503 HandleScope scope(isolate()); | 2503 HandleScope scope(isolate()); |
2504 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { | 2504 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
2505 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); | 2505 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
2506 Handle<Object> function_object = Object::GetProperty( | 2506 Handle<Object> function_object = Object::GetProperty( |
2507 isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); | 2507 isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); |
2508 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); | 2508 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
2509 builtins->set_javascript_builtin(id, *function); | 2509 builtins->set_javascript_builtin(id, *function); |
2510 // TODO(mstarzinger): This is just a temporary hack to make TurboFan work, | |
2511 // the correct solution is to restore the context register after invoking | |
2512 // builtins from full-codegen. | |
2513 function->shared()->set_disable_optimization_reason(kOptimizationDisabled); | |
2514 function->shared()->set_optimization_disabled(true); | |
2515 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { | 2510 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { |
2516 return false; | 2511 return false; |
2517 } | 2512 } |
2518 builtins->set_javascript_builtin_code(id, function->shared()->code()); | 2513 builtins->set_javascript_builtin_code(id, function->shared()->code()); |
2519 } | 2514 } |
2520 return true; | 2515 return true; |
2521 } | 2516 } |
2522 | 2517 |
2523 | 2518 |
2524 bool Genesis::ConfigureGlobalObjects( | 2519 bool Genesis::ConfigureGlobalObjects( |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2858 return from + sizeof(NestingCounterType); | 2853 return from + sizeof(NestingCounterType); |
2859 } | 2854 } |
2860 | 2855 |
2861 | 2856 |
2862 // Called when the top-level V8 mutex is destroyed. | 2857 // Called when the top-level V8 mutex is destroyed. |
2863 void Bootstrapper::FreeThreadResources() { | 2858 void Bootstrapper::FreeThreadResources() { |
2864 DCHECK(!IsActive()); | 2859 DCHECK(!IsActive()); |
2865 } | 2860 } |
2866 | 2861 |
2867 } } // namespace v8::internal | 2862 } } // namespace v8::internal |
OLD | NEW |