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" |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 isolate->array_buffer_allocator()->Allocate(byte_length)); | 1812 isolate->array_buffer_allocator()->Allocate(byte_length)); |
1813 } | 1813 } |
1814 Runtime::SetupArrayBuffer(isolate, buffer, is_external, data, byte_length); | 1814 Runtime::SetupArrayBuffer(isolate, buffer, is_external, data, byte_length); |
1815 | 1815 |
1816 Handle<JSTypedArray> typed_array = | 1816 Handle<JSTypedArray> typed_array = |
1817 isolate->factory()->NewJSTypedArray(type, buffer, 0, num_elements); | 1817 isolate->factory()->NewJSTypedArray(type, buffer, 0, num_elements); |
1818 Handle<String> name_string = isolate->factory()->InternalizeUtf8String(name); | 1818 Handle<String> name_string = isolate->factory()->InternalizeUtf8String(name); |
1819 // Reset property cell type before (re)initializing. | 1819 // Reset property cell type before (re)initializing. |
1820 JSBuiltinsObject::InvalidatePropertyCell(builtins, name_string); | 1820 JSBuiltinsObject::InvalidatePropertyCell(builtins, name_string); |
1821 JSObject::SetOwnPropertyIgnoreAttributes(builtins, name_string, typed_array, | 1821 JSObject::SetOwnPropertyIgnoreAttributes(builtins, name_string, typed_array, |
1822 DONT_DELETE).Assert(); | 1822 FROZEN) |
| 1823 .Assert(); |
1823 return data; | 1824 return data; |
1824 } | 1825 } |
1825 | 1826 |
1826 | 1827 |
1827 void Genesis::InitializeBuiltinTypedArrays() { | 1828 void Genesis::InitializeBuiltinTypedArrays() { |
1828 Handle<JSBuiltinsObject> builtins(native_context()->builtins()); | 1829 Handle<JSBuiltinsObject> builtins(native_context()->builtins()); |
1829 { // Initially seed the per-context random number generator using the | 1830 { // Initially seed the per-context random number generator using the |
1830 // per-isolate random number generator. | 1831 // per-isolate random number generator. |
1831 const size_t num_elements = 2; | 1832 const size_t num_elements = 2; |
1832 const size_t num_bytes = num_elements * sizeof(uint32_t); | 1833 const size_t num_bytes = num_elements * sizeof(uint32_t); |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3318 } | 3319 } |
3319 | 3320 |
3320 | 3321 |
3321 // Called when the top-level V8 mutex is destroyed. | 3322 // Called when the top-level V8 mutex is destroyed. |
3322 void Bootstrapper::FreeThreadResources() { | 3323 void Bootstrapper::FreeThreadResources() { |
3323 DCHECK(!IsActive()); | 3324 DCHECK(!IsActive()); |
3324 } | 3325 } |
3325 | 3326 |
3326 } // namespace internal | 3327 } // namespace internal |
3327 } // namespace v8 | 3328 } // namespace v8 |
OLD | NEW |