OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 global_handles_(NULL), | 1865 global_handles_(NULL), |
1866 eternal_handles_(NULL), | 1866 eternal_handles_(NULL), |
1867 thread_manager_(NULL), | 1867 thread_manager_(NULL), |
1868 has_installed_extensions_(false), | 1868 has_installed_extensions_(false), |
1869 regexp_stack_(NULL), | 1869 regexp_stack_(NULL), |
1870 date_cache_(NULL), | 1870 date_cache_(NULL), |
1871 call_descriptor_data_(NULL), | 1871 call_descriptor_data_(NULL), |
1872 // TODO(bmeurer) Initialized lazily because it depends on flags; can | 1872 // TODO(bmeurer) Initialized lazily because it depends on flags; can |
1873 // be fixed once the default isolate cleanup is done. | 1873 // be fixed once the default isolate cleanup is done. |
1874 random_number_generator_(NULL), | 1874 random_number_generator_(NULL), |
| 1875 rail_mode_(PERFORMANCE_DEFAULT), |
1875 serializer_enabled_(enable_serializer), | 1876 serializer_enabled_(enable_serializer), |
1876 has_fatal_error_(false), | 1877 has_fatal_error_(false), |
1877 initialized_from_snapshot_(false), | 1878 initialized_from_snapshot_(false), |
1878 is_tail_call_elimination_enabled_(true), | 1879 is_tail_call_elimination_enabled_(true), |
1879 cpu_profiler_(NULL), | 1880 cpu_profiler_(NULL), |
1880 heap_profiler_(NULL), | 1881 heap_profiler_(NULL), |
1881 function_entry_hook_(NULL), | 1882 function_entry_hook_(NULL), |
1882 deferred_handles_head_(NULL), | 1883 deferred_handles_head_(NULL), |
1883 optimizing_compile_dispatcher_(NULL), | 1884 optimizing_compile_dispatcher_(NULL), |
1884 stress_deopt_count_(0), | 1885 stress_deopt_count_(0), |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3008 } | 3009 } |
3009 } | 3010 } |
3010 if (new_length == 0) { | 3011 if (new_length == 0) { |
3011 heap()->set_detached_contexts(heap()->empty_fixed_array()); | 3012 heap()->set_detached_contexts(heap()->empty_fixed_array()); |
3012 } else if (new_length < length) { | 3013 } else if (new_length < length) { |
3013 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( | 3014 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( |
3014 *detached_contexts, length - new_length); | 3015 *detached_contexts, length - new_length); |
3015 } | 3016 } |
3016 } | 3017 } |
3017 | 3018 |
| 3019 void Isolate::SetRAILMode(RAILMode rail_mode) { |
| 3020 rail_mode_ = rail_mode; |
| 3021 if (FLAG_trace_rail) { |
| 3022 PrintIsolate(this, "RAIL mode: %s\n", RAILModeName(rail_mode_)); |
| 3023 } |
| 3024 } |
3018 | 3025 |
3019 bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const { | 3026 bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const { |
3020 StackGuard* stack_guard = isolate_->stack_guard(); | 3027 StackGuard* stack_guard = isolate_->stack_guard(); |
3021 #ifdef USE_SIMULATOR | 3028 #ifdef USE_SIMULATOR |
3022 // The simulator uses a separate JS stack. | 3029 // The simulator uses a separate JS stack. |
3023 Address jssp_address = Simulator::current(isolate_)->get_sp(); | 3030 Address jssp_address = Simulator::current(isolate_)->get_sp(); |
3024 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); | 3031 uintptr_t jssp = reinterpret_cast<uintptr_t>(jssp_address); |
3025 if (jssp - gap < stack_guard->real_jslimit()) return true; | 3032 if (jssp - gap < stack_guard->real_jslimit()) return true; |
3026 #endif // USE_SIMULATOR | 3033 #endif // USE_SIMULATOR |
3027 return GetCurrentStackPosition() - gap < stack_guard->real_climit(); | 3034 return GetCurrentStackPosition() - gap < stack_guard->real_climit(); |
(...skipping 29 matching lines...) Expand all Loading... |
3057 // Then check whether this scope intercepts. | 3064 // Then check whether this scope intercepts. |
3058 if ((flag & intercept_mask_)) { | 3065 if ((flag & intercept_mask_)) { |
3059 intercepted_flags_ |= flag; | 3066 intercepted_flags_ |= flag; |
3060 return true; | 3067 return true; |
3061 } | 3068 } |
3062 return false; | 3069 return false; |
3063 } | 3070 } |
3064 | 3071 |
3065 } // namespace internal | 3072 } // namespace internal |
3066 } // namespace v8 | 3073 } // namespace v8 |
OLD | NEW |