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 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 } | 2503 } |
2504 | 2504 |
2505 | 2505 |
2506 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { | 2506 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
2507 HandleScope scope(isolate()); | 2507 HandleScope scope(isolate()); |
2508 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { | 2508 for (int i = 0; i < Builtins::NumberOfJavaScriptBuiltins(); i++) { |
2509 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); | 2509 Builtins::JavaScript id = static_cast<Builtins::JavaScript>(i); |
2510 Handle<Object> function_object = Object::GetProperty( | 2510 Handle<Object> function_object = Object::GetProperty( |
2511 isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); | 2511 isolate(), builtins, Builtins::GetName(id)).ToHandleChecked(); |
2512 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); | 2512 Handle<JSFunction> function = Handle<JSFunction>::cast(function_object); |
| 2513 // TODO(mstarzinger): This is just a temporary hack to make TurboFan work, |
| 2514 // the correct solution is to restore the context register after invoking |
| 2515 // builtins from full-codegen. |
| 2516 function->shared()->DisableOptimization(kBuiltinFunctionCannotBeOptimized); |
2513 builtins->set_javascript_builtin(id, *function); | 2517 builtins->set_javascript_builtin(id, *function); |
2514 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { | 2518 if (!Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { |
2515 return false; | 2519 return false; |
2516 } | 2520 } |
2517 builtins->set_javascript_builtin_code(id, function->shared()->code()); | 2521 builtins->set_javascript_builtin_code(id, function->shared()->code()); |
2518 } | 2522 } |
2519 return true; | 2523 return true; |
2520 } | 2524 } |
2521 | 2525 |
2522 | 2526 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2863 return from + sizeof(NestingCounterType); | 2867 return from + sizeof(NestingCounterType); |
2864 } | 2868 } |
2865 | 2869 |
2866 | 2870 |
2867 // Called when the top-level V8 mutex is destroyed. | 2871 // Called when the top-level V8 mutex is destroyed. |
2868 void Bootstrapper::FreeThreadResources() { | 2872 void Bootstrapper::FreeThreadResources() { |
2869 DCHECK(!IsActive()); | 2873 DCHECK(!IsActive()); |
2870 } | 2874 } |
2871 | 2875 |
2872 } } // namespace v8::internal | 2876 } } // namespace v8::internal |
OLD | NEW |