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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 template <class S> static Handle<T> cast(Handle<S> that) { | 78 template <class S> static Handle<T> cast(Handle<S> that) { |
79 T::cast(*that); | 79 T::cast(*that); |
80 return Handle<T>(reinterpret_cast<T**>(that.location())); | 80 return Handle<T>(reinterpret_cast<T**>(that.location())); |
81 } | 81 } |
82 | 82 |
83 static Handle<T> null() { return Handle<T>(); } | 83 static Handle<T> null() { return Handle<T>(); } |
84 bool is_null() {return location_ == NULL; } | 84 bool is_null() {return location_ == NULL; } |
85 | 85 |
86 // Closes the given scope, but lets this handle escape. See | 86 // Closes the given scope, but lets this handle escape. See |
87 // implementation in api.h. | 87 // implementation in api.h. |
88 inline Handle<T> EscapeFrom(HandleScope* scope); | 88 inline Handle<T> EscapeFrom(v8::HandleScope* scope); |
89 | 89 |
90 private: | 90 private: |
91 T** location_; | 91 T** location_; |
92 }; | 92 }; |
93 | 93 |
94 | 94 |
95 // A stack-allocated class that governs a number of local handles. | 95 // A stack-allocated class that governs a number of local handles. |
96 // After a handle scope has been created, all local handles will be | 96 // After a handle scope has been created, all local handles will be |
97 // allocated within that handle scope until either the handle scope is | 97 // allocated within that handle scope until either the handle scope is |
98 // deleted or another handle scope is created. If there is already a | 98 // deleted or another handle scope is created. If there is already a |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 private: | 308 private: |
309 bool has_been_transformed_; // Tells whether the object has been transformed. | 309 bool has_been_transformed_; // Tells whether the object has been transformed. |
310 int unused_property_fields_; // Captures the unused number of field. | 310 int unused_property_fields_; // Captures the unused number of field. |
311 Handle<JSObject> object_; // The object being optimized. | 311 Handle<JSObject> object_; // The object being optimized. |
312 }; | 312 }; |
313 | 313 |
314 | 314 |
315 } } // namespace v8::internal | 315 } } // namespace v8::internal |
316 | 316 |
317 #endif // V8_HANDLES_H_ | 317 #endif // V8_HANDLES_H_ |
OLD | NEW |