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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
11 #include "src/extensions/externalize-string-extension.h" | 11 #include "src/extensions/externalize-string-extension.h" |
12 #include "src/extensions/free-buffer-extension.h" | 12 #include "src/extensions/free-buffer-extension.h" |
13 #include "src/extensions/gc-extension.h" | 13 #include "src/extensions/gc-extension.h" |
14 #include "src/extensions/statistics-extension.h" | 14 #include "src/extensions/statistics-extension.h" |
15 #include "src/extensions/trigger-failure-extension.h" | 15 #include "src/extensions/trigger-failure-extension.h" |
16 #include "src/heap/heap.h" | 16 #include "src/heap/heap.h" |
17 #include "src/snapshot/natives.h" | 17 #include "src/snapshot/natives.h" |
18 #include "src/snapshot/snapshot.h" | 18 #include "src/snapshot/snapshot.h" |
19 #include "third_party/fdlibm/fdlibm.h" | 19 #include "third_party/fdlibm/fdlibm.h" |
20 | 20 |
| 21 #if defined(V8_WASM) |
| 22 #include "src/wasm/wasm-js.h" |
| 23 #endif |
| 24 |
21 namespace v8 { | 25 namespace v8 { |
22 namespace internal { | 26 namespace internal { |
23 | 27 |
24 Bootstrapper::Bootstrapper(Isolate* isolate) | 28 Bootstrapper::Bootstrapper(Isolate* isolate) |
25 : isolate_(isolate), | 29 : isolate_(isolate), |
26 nesting_(0), | 30 nesting_(0), |
27 extensions_cache_(Script::TYPE_EXTENSION) {} | 31 extensions_cache_(Script::TYPE_EXTENSION) {} |
28 | 32 |
29 template <class Source> | 33 template <class Source> |
30 Handle<String> Bootstrapper::SourceLookup(int index) { | 34 Handle<String> Bootstrapper::SourceLookup(int index) { |
(...skipping 2628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 // the shell native context to allow calling between these (otherwise | 2663 // the shell native context to allow calling between these (otherwise |
2660 // exposing debug global object doesn't make much sense). | 2664 // exposing debug global object doesn't make much sense). |
2661 debug_context->set_security_token(native_context->security_token()); | 2665 debug_context->set_security_token(native_context->security_token()); |
2662 Handle<String> debug_string = | 2666 Handle<String> debug_string = |
2663 factory->InternalizeUtf8String(FLAG_expose_debug_as); | 2667 factory->InternalizeUtf8String(FLAG_expose_debug_as); |
2664 uint32_t index; | 2668 uint32_t index; |
2665 if (debug_string->AsArrayIndex(&index)) return true; | 2669 if (debug_string->AsArrayIndex(&index)) return true; |
2666 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); | 2670 Handle<Object> global_proxy(debug_context->global_proxy(), isolate); |
2667 JSObject::AddProperty(global, debug_string, global_proxy, DONT_ENUM); | 2671 JSObject::AddProperty(global, debug_string, global_proxy, DONT_ENUM); |
2668 } | 2672 } |
| 2673 |
| 2674 #if defined(V8_WASM) |
| 2675 WasmJs::Install(isolate, global); |
| 2676 #endif |
| 2677 |
2669 return true; | 2678 return true; |
2670 } | 2679 } |
2671 | 2680 |
2672 | 2681 |
2673 static uint32_t Hash(RegisteredExtension* extension) { | 2682 static uint32_t Hash(RegisteredExtension* extension) { |
2674 return v8::internal::ComputePointerHash(extension); | 2683 return v8::internal::ComputePointerHash(extension); |
2675 } | 2684 } |
2676 | 2685 |
2677 | 2686 |
2678 Genesis::ExtensionStates::ExtensionStates() : map_(HashMap::PointersMatch, 8) {} | 2687 Genesis::ExtensionStates::ExtensionStates() : map_(HashMap::PointersMatch, 8) {} |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3159 } | 3168 } |
3160 | 3169 |
3161 | 3170 |
3162 // Called when the top-level V8 mutex is destroyed. | 3171 // Called when the top-level V8 mutex is destroyed. |
3163 void Bootstrapper::FreeThreadResources() { | 3172 void Bootstrapper::FreeThreadResources() { |
3164 DCHECK(!IsActive()); | 3173 DCHECK(!IsActive()); |
3165 } | 3174 } |
3166 | 3175 |
3167 } // namespace internal | 3176 } // namespace internal |
3168 } // namespace v8 | 3177 } // namespace v8 |
OLD | NEW |