Chromium Code Reviews| 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 // 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_HANDLES_INL_H_ | 5 #ifndef V8_HANDLES_INL_H_ |
| 6 #define V8_HANDLES_INL_H_ | 6 #define V8_HANDLES_INL_H_ |
| 7 | 7 |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 DCHECK(current->level > current->sealed_level); | 87 DCHECK(current->level > current->sealed_level); |
| 88 Handle<T> result(value, isolate_); | 88 Handle<T> result(value, isolate_); |
| 89 // Reinitialize the current scope (so that it's ready | 89 // Reinitialize the current scope (so that it's ready |
| 90 // to be used or closed again). | 90 // to be used or closed again). |
| 91 prev_next_ = current->next; | 91 prev_next_ = current->next; |
| 92 prev_limit_ = current->limit; | 92 prev_limit_ = current->limit; |
| 93 current->level++; | 93 current->level++; |
| 94 return result; | 94 return result; |
| 95 } | 95 } |
| 96 | 96 |
| 97 | |
|
Benedikt Meurer
2017/02/02 12:47:03
Nit: Can you undo the change to this file?
| |
| 98 Object** HandleScope::CreateHandle(Isolate* isolate, Object* value) { | 97 Object** HandleScope::CreateHandle(Isolate* isolate, Object* value) { |
| 99 DCHECK(AllowHandleAllocation::IsAllowed()); | 98 DCHECK(AllowHandleAllocation::IsAllowed()); |
| 100 HandleScopeData* data = isolate->handle_scope_data(); | 99 HandleScopeData* data = isolate->handle_scope_data(); |
| 101 | 100 |
| 102 Object** result = data->next; | 101 Object** result = data->next; |
| 103 if (result == data->limit) result = Extend(isolate); | 102 if (result == data->limit) result = Extend(isolate); |
| 104 // Update the current next field, set the value in the created | 103 // Update the current next field, set the value in the created |
| 105 // handle, and return the result. | 104 // handle, and return the result. |
| 106 DCHECK(result < data->limit); | 105 DCHECK(result < data->limit); |
| 107 data->next = result + 1; | 106 data->next = result + 1; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 DCHECK_EQ(current->level, current->sealed_level); | 141 DCHECK_EQ(current->level, current->sealed_level); |
| 143 current->sealed_level = prev_sealed_level_; | 142 current->sealed_level = prev_sealed_level_; |
| 144 } | 143 } |
| 145 | 144 |
| 146 #endif | 145 #endif |
| 147 | 146 |
| 148 } // namespace internal | 147 } // namespace internal |
| 149 } // namespace v8 | 148 } // namespace v8 |
| 150 | 149 |
| 151 #endif // V8_HANDLES_INL_H_ | 150 #endif // V8_HANDLES_INL_H_ |
| OLD | NEW |