| 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 = | 2654 const int constants_size = ARRAY_SIZE(fdlibm::MathConstants::constants); |
| 2655 ARRAY_SIZE(fdlibm::TrigonometricConstants::constants); | |
| 2656 const int table_num_bytes = constants_size * kDoubleSize; | 2655 const int table_num_bytes = constants_size * kDoubleSize; |
| 2657 v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New( | 2656 v8::Local<v8::ArrayBuffer> trig_buffer = v8::ArrayBuffer::New( |
| 2658 reinterpret_cast<v8::Isolate*>(isolate), | 2657 reinterpret_cast<v8::Isolate*>(isolate), |
| 2659 const_cast<double*>(fdlibm::TrigonometricConstants::constants), | 2658 const_cast<double*>(fdlibm::MathConstants::constants), table_num_bytes); |
| 2660 table_num_bytes); | |
| 2661 v8::Local<v8::Float64Array> trig_table = | 2659 v8::Local<v8::Float64Array> trig_table = |
| 2662 v8::Float64Array::New(trig_buffer, 0, constants_size); | 2660 v8::Float64Array::New(trig_buffer, 0, constants_size); |
| 2663 | 2661 |
| 2664 Runtime::DefineObjectProperty( | 2662 Runtime::DefineObjectProperty( |
| 2665 builtins, | 2663 builtins, |
| 2666 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kTrig")), | 2664 factory()->InternalizeOneByteString(STATIC_ASCII_VECTOR("kMath")), |
| 2667 Utils::OpenHandle(*trig_table), NONE).Assert(); | 2665 Utils::OpenHandle(*trig_table), NONE).Assert(); |
| 2668 } | 2666 } |
| 2669 | 2667 |
| 2670 result_ = native_context(); | 2668 result_ = native_context(); |
| 2671 } | 2669 } |
| 2672 | 2670 |
| 2673 | 2671 |
| 2674 // Support for thread preemption. | 2672 // Support for thread preemption. |
| 2675 | 2673 |
| 2676 // Reserve space for statics needing saving and restoring. | 2674 // Reserve space for statics needing saving and restoring. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 2693 return from + sizeof(NestingCounterType); | 2691 return from + sizeof(NestingCounterType); |
| 2694 } | 2692 } |
| 2695 | 2693 |
| 2696 | 2694 |
| 2697 // Called when the top-level V8 mutex is destroyed. | 2695 // Called when the top-level V8 mutex is destroyed. |
| 2698 void Bootstrapper::FreeThreadResources() { | 2696 void Bootstrapper::FreeThreadResources() { |
| 2699 DCHECK(!IsActive()); | 2697 DCHECK(!IsActive()); |
| 2700 } | 2698 } |
| 2701 | 2699 |
| 2702 } } // namespace v8::internal | 2700 } } // namespace v8::internal |
| OLD | NEW |