OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 }; | 98 }; |
99 | 99 |
100 | 100 |
101 // Convenience wrapper. | 101 // Convenience wrapper. |
102 template<class T> | 102 template<class T> |
103 inline Handle<T> handle(T* t, Isolate* isolate) { | 103 inline Handle<T> handle(T* t, Isolate* isolate) { |
104 return Handle<T>(t, isolate); | 104 return Handle<T>(t, isolate); |
105 } | 105 } |
106 | 106 |
107 | 107 |
| 108 // Convenience wrapper. |
| 109 template<class T> |
| 110 inline Handle<T> handle(T* t) { |
| 111 return Handle<T>(t, t->GetIsolate()); |
| 112 } |
| 113 |
| 114 |
108 class DeferredHandles; | 115 class DeferredHandles; |
109 class HandleScopeImplementer; | 116 class HandleScopeImplementer; |
110 | 117 |
111 | 118 |
112 // A stack-allocated class that governs a number of local handles. | 119 // A stack-allocated class that governs a number of local handles. |
113 // After a handle scope has been created, all local handles will be | 120 // After a handle scope has been created, all local handles will be |
114 // allocated within that handle scope until either the handle scope is | 121 // allocated within that handle scope until either the handle scope is |
115 // deleted or another handle scope is created. If there is already a | 122 // deleted or another handle scope is created. If there is already a |
116 // handle scope and a new one is created, all allocations will take | 123 // handle scope and a new one is created, all allocations will take |
117 // place in the new handle scope until it is deleted. After that, | 124 // place in the new handle scope until it is deleted. After that, |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 private: | 351 private: |
345 Isolate* isolate_; | 352 Isolate* isolate_; |
346 Object** limit_; | 353 Object** limit_; |
347 int level_; | 354 int level_; |
348 #endif | 355 #endif |
349 }; | 356 }; |
350 | 357 |
351 } } // namespace v8::internal | 358 } } // namespace v8::internal |
352 | 359 |
353 #endif // V8_HANDLES_H_ | 360 #endif // V8_HANDLES_H_ |
OLD | NEW |