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 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 }; | 1484 }; |
1485 | 1485 |
1486 | 1486 |
1487 // Support for temporarily postponing interrupts. When the outermost | 1487 // Support for temporarily postponing interrupts. When the outermost |
1488 // postpone scope is left the interrupts will be re-enabled and any | 1488 // postpone scope is left the interrupts will be re-enabled and any |
1489 // interrupts that occurred while in the scope will be taken into | 1489 // interrupts that occurred while in the scope will be taken into |
1490 // account. | 1490 // account. |
1491 class PostponeInterruptsScope BASE_EMBEDDED { | 1491 class PostponeInterruptsScope BASE_EMBEDDED { |
1492 public: | 1492 public: |
1493 explicit PostponeInterruptsScope(Isolate* isolate) | 1493 explicit PostponeInterruptsScope(Isolate* isolate) |
1494 : stack_guard_(isolate->stack_guard()) { | 1494 : stack_guard_(isolate->stack_guard()), isolate_(isolate) { |
| 1495 ExecutionAccess access(isolate_); |
1495 stack_guard_->thread_local_.postpone_interrupts_nesting_++; | 1496 stack_guard_->thread_local_.postpone_interrupts_nesting_++; |
1496 stack_guard_->DisableInterrupts(); | 1497 stack_guard_->DisableInterrupts(); |
1497 } | 1498 } |
1498 | 1499 |
1499 ~PostponeInterruptsScope() { | 1500 ~PostponeInterruptsScope() { |
| 1501 ExecutionAccess access(isolate_); |
1500 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { | 1502 if (--stack_guard_->thread_local_.postpone_interrupts_nesting_ == 0) { |
1501 stack_guard_->EnableInterrupts(); | 1503 stack_guard_->EnableInterrupts(); |
1502 } | 1504 } |
1503 } | 1505 } |
1504 private: | 1506 private: |
1505 StackGuard* stack_guard_; | 1507 StackGuard* stack_guard_; |
| 1508 Isolate* isolate_; |
1506 }; | 1509 }; |
1507 | 1510 |
1508 | 1511 |
1509 // Tells whether the native context is marked with out of memory. | 1512 // Tells whether the native context is marked with out of memory. |
1510 inline bool Context::has_out_of_memory() { | 1513 inline bool Context::has_out_of_memory() { |
1511 return native_context()->out_of_memory()->IsTrue(); | 1514 return native_context()->out_of_memory()->IsTrue(); |
1512 } | 1515 } |
1513 | 1516 |
1514 | 1517 |
1515 // Mark the native context with out of memory. | 1518 // Mark the native context with out of memory. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 } | 1584 } |
1582 | 1585 |
1583 EmbeddedVector<char, 128> filename_; | 1586 EmbeddedVector<char, 128> filename_; |
1584 FILE* file_; | 1587 FILE* file_; |
1585 int scope_depth_; | 1588 int scope_depth_; |
1586 }; | 1589 }; |
1587 | 1590 |
1588 } } // namespace v8::internal | 1591 } } // namespace v8::internal |
1589 | 1592 |
1590 #endif // V8_ISOLATE_H_ | 1593 #endif // V8_ISOLATE_H_ |
OLD | NEW |