OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 friend class StackLimitCheck; | 222 friend class StackLimitCheck; |
223 friend class PostponeInterruptsScope; | 223 friend class PostponeInterruptsScope; |
224 }; | 224 }; |
225 | 225 |
226 | 226 |
227 // Support for checking for stack-overflows in C++ code. | 227 // Support for checking for stack-overflows in C++ code. |
228 class StackLimitCheck BASE_EMBEDDED { | 228 class StackLimitCheck BASE_EMBEDDED { |
229 public: | 229 public: |
230 bool HasOverflowed() const { | 230 bool HasOverflowed() const { |
231 return reinterpret_cast<uintptr_t>(this) < StackGuard::climit(); | 231 // Stack has overflowed in C++ code only if stack pointer exceeds the C++ |
| 232 // stack guard and the limits are not set to interrupt values. |
| 233 // TODO(214): Stack overflows are ignored if a interrupt is pending. This |
| 234 // code should probably always use the initial C++ limit. |
| 235 return (reinterpret_cast<uintptr_t>(this) < StackGuard::climit()) && |
| 236 StackGuard::IsStackOverflow(); |
232 } | 237 } |
233 }; | 238 }; |
234 | 239 |
235 | 240 |
236 // Support for temporarily postponing interrupts. When the outermost | 241 // Support for temporarily postponing interrupts. When the outermost |
237 // postpone scope is left the interrupts will be re-enabled and any | 242 // postpone scope is left the interrupts will be re-enabled and any |
238 // interrupts that occurred while in the scope will be taken into | 243 // interrupts that occurred while in the scope will be taken into |
239 // account. | 244 // account. |
240 class PostponeInterruptsScope BASE_EMBEDDED { | 245 class PostponeInterruptsScope BASE_EMBEDDED { |
241 public: | 246 public: |
(...skipping 17 matching lines...) Expand all Loading... |
259 v8::Handle<v8::String> name); | 264 v8::Handle<v8::String> name); |
260 static v8::Handle<v8::Value> GC(const v8::Arguments& args); | 265 static v8::Handle<v8::Value> GC(const v8::Arguments& args); |
261 private: | 266 private: |
262 static const char* kSource; | 267 static const char* kSource; |
263 }; | 268 }; |
264 | 269 |
265 | 270 |
266 } } // namespace v8::internal | 271 } } // namespace v8::internal |
267 | 272 |
268 #endif // V8_EXECUTION_H_ | 273 #endif // V8_EXECUTION_H_ |
OLD | NEW |