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