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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 template <class S> static Handle<T> cast(Handle<S> that) { | 76 template <class S> static Handle<T> cast(Handle<S> that) { |
77 T::cast(*reinterpret_cast<T**>(that.location_)); | 77 T::cast(*reinterpret_cast<T**>(that.location_)); |
78 return Handle<T>(reinterpret_cast<T**>(that.location_)); | 78 return Handle<T>(reinterpret_cast<T**>(that.location_)); |
79 } | 79 } |
80 | 80 |
81 static Handle<T> null() { return Handle<T>(); } | 81 static Handle<T> null() { return Handle<T>(); } |
82 bool is_null() const { return location_ == NULL; } | 82 bool is_null() const { return location_ == NULL; } |
83 | 83 |
84 // Closes the given scope, but lets this handle escape. See | 84 // Closes the given scope, but lets this handle escape. See |
85 // implementation in api.h. | 85 // implementation in api.h. |
86 inline Handle<T> EscapeFrom(v8::HandleScope* scope); | 86 inline Handle<T> EscapeFrom(v8::EscapableHandleScope* scope); |
87 | 87 |
88 #ifdef DEBUG | 88 #ifdef DEBUG |
89 enum DereferenceCheckMode { INCLUDE_DEFERRED_CHECK, NO_DEFERRED_CHECK }; | 89 enum DereferenceCheckMode { INCLUDE_DEFERRED_CHECK, NO_DEFERRED_CHECK }; |
90 | 90 |
91 bool IsDereferenceAllowed(DereferenceCheckMode mode) const; | 91 bool IsDereferenceAllowed(DereferenceCheckMode mode) const; |
92 #endif // DEBUG | 92 #endif // DEBUG |
93 | 93 |
94 private: | 94 private: |
95 T** location_; | 95 T** location_; |
96 | 96 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 private: | 313 private: |
314 Isolate* isolate_; | 314 Isolate* isolate_; |
315 Object** limit_; | 315 Object** limit_; |
316 int level_; | 316 int level_; |
317 #endif | 317 #endif |
318 }; | 318 }; |
319 | 319 |
320 } } // namespace v8::internal | 320 } } // namespace v8::internal |
321 | 321 |
322 #endif // V8_HANDLES_H_ | 322 #endif // V8_HANDLES_H_ |
OLD | NEW |