OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/json.h" | 9 #include "platform/json.h" |
10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 837 |
838 void Isolate::InitializeStackLimit() { | 838 void Isolate::InitializeStackLimit() { |
839 SetStackLimitFromStackBase(Isolate::GetCurrentStackPointer()); | 839 SetStackLimitFromStackBase(Isolate::GetCurrentStackPointer()); |
840 } | 840 } |
841 | 841 |
842 | 842 |
843 /* static */ | 843 /* static */ |
844 uword Isolate::GetCurrentStackPointer() { | 844 uword Isolate::GetCurrentStackPointer() { |
845 // Since AddressSanitizer's detect_stack_use_after_return instruments the | 845 // Since AddressSanitizer's detect_stack_use_after_return instruments the |
846 // C++ code to give out fake stack addresses, we call a stub in that case. | 846 // C++ code to give out fake stack addresses, we call a stub in that case. |
847 uword (*func)() = | 847 uword (*func)() = reinterpret_cast<uword (*)()>( |
848 reinterpret_cast<uword (*)()>(StubCode::GetStackPointerEntryPoint()); | 848 StubCode::GetStackPointer_entry()->EntryPoint()); |
849 // But for performance (and to support simulators), we normally use a local. | 849 // But for performance (and to support simulators), we normally use a local. |
850 #if defined(__has_feature) | 850 #if defined(__has_feature) |
851 #if __has_feature(address_sanitizer) | 851 #if __has_feature(address_sanitizer) |
852 uword current_sp = func(); | 852 uword current_sp = func(); |
853 return current_sp; | 853 return current_sp; |
854 #else | 854 #else |
855 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); | 855 uword stack_allocated_local_address = reinterpret_cast<uword>(&func); |
856 return stack_allocated_local_address; | 856 return stack_allocated_local_address; |
857 #endif | 857 #endif |
858 #else | 858 #else |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 serialized_message_, serialized_message_len_); | 2169 serialized_message_, serialized_message_len_); |
2170 } | 2170 } |
2171 | 2171 |
2172 | 2172 |
2173 void IsolateSpawnState::Cleanup() { | 2173 void IsolateSpawnState::Cleanup() { |
2174 SwitchIsolateScope switch_scope(I); | 2174 SwitchIsolateScope switch_scope(I); |
2175 Dart::ShutdownIsolate(); | 2175 Dart::ShutdownIsolate(); |
2176 } | 2176 } |
2177 | 2177 |
2178 } // namespace dart | 2178 } // namespace dart |
OLD | NEW |