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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 | 1383 |
1384 static bool TryLock(Isolate* isolate) { | 1384 static bool TryLock(Isolate* isolate) { |
1385 return isolate->break_access()->TryLock(); | 1385 return isolate->break_access()->TryLock(); |
1386 } | 1386 } |
1387 | 1387 |
1388 private: | 1388 private: |
1389 Isolate* isolate_; | 1389 Isolate* isolate_; |
1390 }; | 1390 }; |
1391 | 1391 |
1392 | 1392 |
1393 // Support for checking for stack-overflows in C++ code. | 1393 // Support for checking for stack-overflows. |
1394 class StackLimitCheck BASE_EMBEDDED { | 1394 class StackLimitCheck BASE_EMBEDDED { |
1395 public: | 1395 public: |
1396 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { } | 1396 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { } |
1397 | 1397 |
1398 bool HasOverflowed() const { | 1398 // Use this to check for stack-overflows in C++ code. |
| 1399 inline bool HasOverflowed() const { |
1399 StackGuard* stack_guard = isolate_->stack_guard(); | 1400 StackGuard* stack_guard = isolate_->stack_guard(); |
1400 return (reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit()); | 1401 return reinterpret_cast<uintptr_t>(this) < stack_guard->real_climit(); |
1401 } | 1402 } |
| 1403 |
| 1404 // Use this to check for stack-overflow when entering runtime from JS code. |
| 1405 bool JsHasOverflowed() const; |
| 1406 |
1402 private: | 1407 private: |
1403 Isolate* isolate_; | 1408 Isolate* isolate_; |
1404 }; | 1409 }; |
1405 | 1410 |
1406 | 1411 |
1407 // Support for temporarily postponing interrupts. When the outermost | 1412 // Support for temporarily postponing interrupts. When the outermost |
1408 // postpone scope is left the interrupts will be re-enabled and any | 1413 // postpone scope is left the interrupts will be re-enabled and any |
1409 // interrupts that occurred while in the scope will be taken into | 1414 // interrupts that occurred while in the scope will be taken into |
1410 // account. | 1415 // account. |
1411 class PostponeInterruptsScope BASE_EMBEDDED { | 1416 class PostponeInterruptsScope BASE_EMBEDDED { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 } | 1498 } |
1494 | 1499 |
1495 EmbeddedVector<char, 128> filename_; | 1500 EmbeddedVector<char, 128> filename_; |
1496 FILE* file_; | 1501 FILE* file_; |
1497 int scope_depth_; | 1502 int scope_depth_; |
1498 }; | 1503 }; |
1499 | 1504 |
1500 } } // namespace v8::internal | 1505 } } // namespace v8::internal |
1501 | 1506 |
1502 #endif // V8_ISOLATE_H_ | 1507 #endif // V8_ISOLATE_H_ |
OLD | NEW |