OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); | 954 VirtualProtect(address, size, PAGE_READONLY | PAGE_GUARD, &oldprotect); |
955 } | 955 } |
956 | 956 |
957 | 957 |
958 void OS::Sleep(int milliseconds) { | 958 void OS::Sleep(int milliseconds) { |
959 ::Sleep(milliseconds); | 959 ::Sleep(milliseconds); |
960 } | 960 } |
961 | 961 |
962 | 962 |
963 void OS::Abort() { | 963 void OS::Abort() { |
964 if (!IsDebuggerPresent()) { | 964 if (IsDebuggerPresent() || FLAG_break_on_abort) { |
| 965 DebugBreak(); |
| 966 } else { |
965 // Make the MSVCRT do a silent abort. | 967 // Make the MSVCRT do a silent abort. |
966 raise(SIGABRT); | 968 raise(SIGABRT); |
967 } else { | |
968 DebugBreak(); | |
969 } | 969 } |
970 } | 970 } |
971 | 971 |
972 | 972 |
973 void OS::DebugBreak() { | 973 void OS::DebugBreak() { |
974 #ifdef _MSC_VER | 974 #ifdef _MSC_VER |
975 __debugbreak(); | 975 __debugbreak(); |
976 #else | 976 #else |
977 ::DebugBreak(); | 977 ::DebugBreak(); |
978 #endif | 978 #endif |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 | 2089 |
2090 | 2090 |
2091 void Sampler::Stop() { | 2091 void Sampler::Stop() { |
2092 ASSERT(IsActive()); | 2092 ASSERT(IsActive()); |
2093 SamplerThread::RemoveActiveSampler(this); | 2093 SamplerThread::RemoveActiveSampler(this); |
2094 SetActive(false); | 2094 SetActive(false); |
2095 } | 2095 } |
2096 | 2096 |
2097 | 2097 |
2098 } } // namespace v8::internal | 2098 } } // namespace v8::internal |
OLD | NEW |