| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 v8::ImplementationUtilities::HandleScopeData* previous) { | 120 v8::ImplementationUtilities::HandleScopeData* previous) { |
| 121 v8::ImplementationUtilities::HandleScopeData* current = | 121 v8::ImplementationUtilities::HandleScopeData* current = |
| 122 Isolate::Current()->handle_scope_data(); | 122 Isolate::Current()->handle_scope_data(); |
| 123 *previous = *current; | 123 *previous = *current; |
| 124 current->extensions = 0; | 124 current->extensions = 0; |
| 125 } | 125 } |
| 126 | 126 |
| 127 | 127 |
| 128 void HandleScope::Leave( | 128 void HandleScope::Leave( |
| 129 const v8::ImplementationUtilities::HandleScopeData* previous) { | 129 const v8::ImplementationUtilities::HandleScopeData* previous) { |
| 130 Isolate* isolate = Isolate::Current(); | 130 Isolate* isolate = previous->isolate; |
| 131 ASSERT(isolate == Isolate::Current()); |
| 131 v8::ImplementationUtilities::HandleScopeData* current = | 132 v8::ImplementationUtilities::HandleScopeData* current = |
| 132 isolate->handle_scope_data(); | 133 isolate->handle_scope_data(); |
| 133 if (current->extensions > 0) { | 134 if (current->extensions > 0) { |
| 134 DeleteExtensions(isolate); | 135 DeleteExtensions(isolate); |
| 135 } | 136 } |
| 136 *current = *previous; | 137 *current = *previous; |
| 137 #ifdef DEBUG | 138 #ifdef DEBUG |
| 138 ZapRange(current->next, current->limit); | 139 ZapRange(current->next, current->limit); |
| 139 #endif | 140 #endif |
| 140 } | 141 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 156 // Restore state in current handle scope to re-enable handle | 157 // Restore state in current handle scope to re-enable handle |
| 157 // allocations. | 158 // allocations. |
| 158 Isolate::Current()->handle_scope_data()->extensions = extensions_; | 159 Isolate::Current()->handle_scope_data()->extensions = extensions_; |
| 159 } | 160 } |
| 160 #endif | 161 #endif |
| 161 | 162 |
| 162 | 163 |
| 163 } } // namespace v8::internal | 164 } } // namespace v8::internal |
| 164 | 165 |
| 165 #endif // V8_HANDLES_INL_H_ | 166 #endif // V8_HANDLES_INL_H_ |
| OLD | NEW |