| 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 2633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 Utils::OpenHandle(*buffer)->set_should_be_freed(true); | 2644 Utils::OpenHandle(*buffer)->set_should_be_freed(true); |
| 2645 v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems); | 2645 v8::Local<v8::Uint32Array> ta = v8::Uint32Array::New(buffer, 0, num_elems); |
| 2646 Handle<JSBuiltinsObject> builtins(native_context()->builtins()); | 2646 Handle<JSBuiltinsObject> builtins(native_context()->builtins()); |
| 2647 Runtime::DefineObjectProperty(builtins, | 2647 Runtime::DefineObjectProperty(builtins, |
| 2648 factory()->InternalizeOneByteString( | 2648 factory()->InternalizeOneByteString( |
| 2649 STATIC_ASCII_VECTOR("rngstate")), | 2649 STATIC_ASCII_VECTOR("rngstate")), |
| 2650 Utils::OpenHandle(*ta), | 2650 Utils::OpenHandle(*ta), |
| 2651 NONE).Assert(); | 2651 NONE).Assert(); |
| 2652 | 2652 |
| 2653 // Initialize trigonometric lookup tables and constants. | 2653 // Initialize trigonometric lookup tables and constants. |
| 2654 const int constants_size = ARRAY_SIZE(TrigonometricConstants::constants); | 2654 const int constants_size = |
| 2655 ARRAY_SIZE(fdlibm::TrigonometricConstants::constants); |
| 2655 const int table_num_bytes = constants_size * kDoubleSize; | 2656 const int table_num_bytes = constants_size * kDoubleSize; |
| 2656 v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New( | 2657 v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New( |
| 2657 reinterpret_cast<v8::Isolate*>(isolate), | 2658 reinterpret_cast<v8::Isolate*>(isolate), |
| 2658 const_cast<double*>(TrigonometricConstants::constants), | 2659 const_cast<double*>(fdlibm::TrigonometricConstants::constants), |
| 2659 table_num_bytes); | 2660 table_num_bytes); |
| 2660 v8::Local<v8::Float64Array> trig_table = | 2661 v8::Local<v8::Float64Array> trig_table = |
| 2661 v8::Float64Array::New(trig_buffer, 0, constants_size); | 2662 v8::Float64Array::New(trig_buffer, 0, constants_size); |
| 2662 | 2663 |
| 2663 Runtime::DefineObjectProperty( | 2664 Runtime::DefineObjectProperty( |
| 2664 builtins, | 2665 builtins, |
| 2665 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kTrig")), | 2666 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kTrig")), |
| 2666 Utils::OpenHandle(*trig_table), NONE).Assert(); | 2667 Utils::OpenHandle(*trig_table), NONE).Assert(); |
| 2667 } | 2668 } |
| 2668 | 2669 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2692 return from + sizeof(NestingCounterType); | 2693 return from + sizeof(NestingCounterType); |
| 2693 } | 2694 } |
| 2694 | 2695 |
| 2695 | 2696 |
| 2696 // Called when the top-level V8 mutex is destroyed. | 2697 // Called when the top-level V8 mutex is destroyed. |
| 2697 void Bootstrapper::FreeThreadResources() { | 2698 void Bootstrapper::FreeThreadResources() { |
| 2698 DCHECK(!IsActive()); | 2699 DCHECK(!IsActive()); |
| 2699 } | 2700 } |
| 2700 | 2701 |
| 2701 } } // namespace v8::internal | 2702 } } // namespace v8::internal |
| OLD | NEW |