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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 return Genesis::ArchiveState(to); | 1579 return Genesis::ArchiveState(to); |
1580 } | 1580 } |
1581 | 1581 |
1582 | 1582 |
1583 // Restore statics that are thread local. | 1583 // Restore statics that are thread local. |
1584 char* Bootstrapper::RestoreState(char* from) { | 1584 char* Bootstrapper::RestoreState(char* from) { |
1585 return Genesis::RestoreState(from); | 1585 return Genesis::RestoreState(from); |
1586 } | 1586 } |
1587 | 1587 |
1588 | 1588 |
| 1589 // Called when the top-level V8 mutex is destroyed. |
| 1590 void Bootstrapper::FreeThreadResources() { |
| 1591 ASSERT(Genesis::current() == NULL); |
| 1592 } |
| 1593 |
| 1594 |
1589 // Reserve space for statics needing saving and restoring. | 1595 // Reserve space for statics needing saving and restoring. |
1590 int Genesis::ArchiveSpacePerThread() { | 1596 int Genesis::ArchiveSpacePerThread() { |
1591 return sizeof(current_); | 1597 return sizeof(current_); |
1592 } | 1598 } |
1593 | 1599 |
1594 | 1600 |
1595 // Archive statics that are thread local. | 1601 // Archive statics that are thread local. |
1596 char* Genesis::ArchiveState(char* to) { | 1602 char* Genesis::ArchiveState(char* to) { |
1597 *reinterpret_cast<Genesis**>(to) = current_; | 1603 *reinterpret_cast<Genesis**>(to) = current_; |
1598 current_ = NULL; | 1604 current_ = NULL; |
1599 return to + sizeof(current_); | 1605 return to + sizeof(current_); |
1600 } | 1606 } |
1601 | 1607 |
1602 | 1608 |
1603 // Restore statics that are thread local. | 1609 // Restore statics that are thread local. |
1604 char* Genesis::RestoreState(char* from) { | 1610 char* Genesis::RestoreState(char* from) { |
1605 current_ = *reinterpret_cast<Genesis**>(from); | 1611 current_ = *reinterpret_cast<Genesis**>(from); |
1606 return from + sizeof(current_); | 1612 return from + sizeof(current_); |
1607 } | 1613 } |
1608 | 1614 |
1609 } } // namespace v8::internal | 1615 } } // namespace v8::internal |
OLD | NEW |