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 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 | 2587 |
2588 | 2588 |
2589 Genesis::Genesis(Isolate* isolate, | 2589 Genesis::Genesis(Isolate* isolate, |
2590 MaybeHandle<JSGlobalProxy> maybe_global_proxy, | 2590 MaybeHandle<JSGlobalProxy> maybe_global_proxy, |
2591 v8::Handle<v8::ObjectTemplate> global_proxy_template, | 2591 v8::Handle<v8::ObjectTemplate> global_proxy_template, |
2592 v8::ExtensionConfiguration* extensions) | 2592 v8::ExtensionConfiguration* extensions) |
2593 : isolate_(isolate), | 2593 : isolate_(isolate), |
2594 active_(isolate->bootstrapper()) { | 2594 active_(isolate->bootstrapper()) { |
2595 NoTrackDoubleFieldsForSerializerScope disable_scope(isolate); | 2595 NoTrackDoubleFieldsForSerializerScope disable_scope(isolate); |
2596 result_ = Handle<Context>::null(); | 2596 result_ = Handle<Context>::null(); |
| 2597 // If V8 cannot be initialized, just return. |
| 2598 if (!V8::Initialize(NULL)) return; |
| 2599 |
2597 // Before creating the roots we must save the context and restore it | 2600 // Before creating the roots we must save the context and restore it |
2598 // on all function exits. | 2601 // on all function exits. |
2599 SaveContext saved_context(isolate); | 2602 SaveContext saved_context(isolate); |
2600 | 2603 |
2601 // During genesis, the boilerplate for stack overflow won't work until the | 2604 // During genesis, the boilerplate for stack overflow won't work until the |
2602 // environment has been at least partially initialized. Add a stack check | 2605 // environment has been at least partially initialized. Add a stack check |
2603 // before entering JS code to catch overflow early. | 2606 // before entering JS code to catch overflow early. |
2604 StackLimitCheck check(isolate); | 2607 StackLimitCheck check(isolate); |
2605 if (check.HasOverflowed()) return; | 2608 if (check.HasOverflowed()) return; |
2606 | 2609 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 return from + sizeof(NestingCounterType); | 2716 return from + sizeof(NestingCounterType); |
2714 } | 2717 } |
2715 | 2718 |
2716 | 2719 |
2717 // Called when the top-level V8 mutex is destroyed. | 2720 // Called when the top-level V8 mutex is destroyed. |
2718 void Bootstrapper::FreeThreadResources() { | 2721 void Bootstrapper::FreeThreadResources() { |
2719 DCHECK(!IsActive()); | 2722 DCHECK(!IsActive()); |
2720 } | 2723 } |
2721 | 2724 |
2722 } } // namespace v8::internal | 2725 } } // namespace v8::internal |
OLD | NEW |