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 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2419 factory()->search_symbol()); | 2419 factory()->search_symbol()); |
2420 InstallPublicSymbol(factory(), native_context(), "split", | 2420 InstallPublicSymbol(factory(), native_context(), "split", |
2421 factory()->split_symbol()); | 2421 factory()->split_symbol()); |
2422 } | 2422 } |
2423 | 2423 |
2424 | 2424 |
2425 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { | 2425 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { |
2426 if (!FLAG_harmony_sharedarraybuffer) return; | 2426 if (!FLAG_harmony_sharedarraybuffer) return; |
2427 | 2427 |
2428 Handle<JSGlobalObject> global(native_context()->global_object()); | 2428 Handle<JSGlobalObject> global(native_context()->global_object()); |
| 2429 Isolate* isolate = global->GetIsolate(); |
| 2430 Factory* factory = isolate->factory(); |
| 2431 |
2429 Handle<JSFunction> shared_array_buffer_fun = | 2432 Handle<JSFunction> shared_array_buffer_fun = |
2430 InstallArrayBuffer(global, "SharedArrayBuffer"); | 2433 InstallArrayBuffer(global, "SharedArrayBuffer"); |
2431 native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun); | 2434 native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun); |
| 2435 |
| 2436 Handle<String> name = factory->InternalizeUtf8String("Atomics"); |
| 2437 Handle<JSFunction> cons = factory->NewFunction(name); |
| 2438 JSFunction::SetInstancePrototype( |
| 2439 cons, |
| 2440 Handle<Object>(native_context()->initial_object_prototype(), isolate)); |
| 2441 Handle<JSObject> atomics_object = factory->NewJSObject(cons, TENURED); |
| 2442 DCHECK(atomics_object->IsJSObject()); |
| 2443 JSObject::AddProperty(global, name, atomics_object, DONT_ENUM); |
| 2444 |
| 2445 SimpleInstallFunction(atomics_object, factory->InternalizeUtf8String("load"), |
| 2446 Builtins::kAtomicsLoadCheck, 2, true); |
2432 } | 2447 } |
2433 | 2448 |
2434 | 2449 |
2435 void Genesis::InitializeGlobal_harmony_simd() { | 2450 void Genesis::InitializeGlobal_harmony_simd() { |
2436 if (!FLAG_harmony_simd) return; | 2451 if (!FLAG_harmony_simd) return; |
2437 | 2452 |
2438 Handle<JSGlobalObject> global( | 2453 Handle<JSGlobalObject> global( |
2439 JSGlobalObject::cast(native_context()->global_object())); | 2454 JSGlobalObject::cast(native_context()->global_object())); |
2440 Isolate* isolate = global->GetIsolate(); | 2455 Isolate* isolate = global->GetIsolate(); |
2441 Factory* factory = isolate->factory(); | 2456 Factory* factory = isolate->factory(); |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3614 } | 3629 } |
3615 | 3630 |
3616 | 3631 |
3617 // Called when the top-level V8 mutex is destroyed. | 3632 // Called when the top-level V8 mutex is destroyed. |
3618 void Bootstrapper::FreeThreadResources() { | 3633 void Bootstrapper::FreeThreadResources() { |
3619 DCHECK(!IsActive()); | 3634 DCHECK(!IsActive()); |
3620 } | 3635 } |
3621 | 3636 |
3622 } // namespace internal | 3637 } // namespace internal |
3623 } // namespace v8 | 3638 } // namespace v8 |
OLD | NEW |