OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 static inline Local<Function> ToLocal( | 183 static inline Local<Function> ToLocal( |
184 v8::internal::Handle<v8::internal::JSFunction> obj); | 184 v8::internal::Handle<v8::internal::JSFunction> obj); |
185 static inline Local<String> ToLocal( | 185 static inline Local<String> ToLocal( |
186 v8::internal::Handle<v8::internal::String> obj); | 186 v8::internal::Handle<v8::internal::String> obj); |
187 static inline Local<Object> ToLocal( | 187 static inline Local<Object> ToLocal( |
188 v8::internal::Handle<v8::internal::JSObject> obj); | 188 v8::internal::Handle<v8::internal::JSObject> obj); |
189 static inline Local<Array> ToLocal( | 189 static inline Local<Array> ToLocal( |
190 v8::internal::Handle<v8::internal::JSArray> obj); | 190 v8::internal::Handle<v8::internal::JSArray> obj); |
191 static inline Local<External> ToLocal( | 191 static inline Local<External> ToLocal( |
192 v8::internal::Handle<v8::internal::Proxy> obj); | 192 v8::internal::Handle<v8::internal::Proxy> obj); |
| 193 static inline Local<Blob> ToLocal( |
| 194 v8::internal::Handle<v8::internal::ByteArray> obj); |
193 static inline Local<Message> MessageToLocal( | 195 static inline Local<Message> MessageToLocal( |
194 v8::internal::Handle<v8::internal::Object> obj); | 196 v8::internal::Handle<v8::internal::Object> obj); |
195 static inline Local<Number> NumberToLocal( | 197 static inline Local<Number> NumberToLocal( |
196 v8::internal::Handle<v8::internal::Object> obj); | 198 v8::internal::Handle<v8::internal::Object> obj); |
197 static inline Local<Integer> IntegerToLocal( | 199 static inline Local<Integer> IntegerToLocal( |
198 v8::internal::Handle<v8::internal::Object> obj); | 200 v8::internal::Handle<v8::internal::Object> obj); |
199 static inline Local<Uint32> Uint32ToLocal( | 201 static inline Local<Uint32> Uint32ToLocal( |
200 v8::internal::Handle<v8::internal::Object> obj); | 202 v8::internal::Handle<v8::internal::Object> obj); |
201 static inline Local<FunctionTemplate> ToLocal( | 203 static inline Local<FunctionTemplate> ToLocal( |
202 v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj); | 204 v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj); |
(...skipping 25 matching lines...) Expand all Loading... |
228 static inline v8::internal::Handle<v8::internal::JSObject> | 230 static inline v8::internal::Handle<v8::internal::JSObject> |
229 OpenHandle(const Message* message); | 231 OpenHandle(const Message* message); |
230 static inline v8::internal::Handle<v8::internal::Context> | 232 static inline v8::internal::Handle<v8::internal::Context> |
231 OpenHandle(const v8::Context* context); | 233 OpenHandle(const v8::Context* context); |
232 static inline v8::internal::Handle<v8::internal::SignatureInfo> | 234 static inline v8::internal::Handle<v8::internal::SignatureInfo> |
233 OpenHandle(const v8::Signature* sig); | 235 OpenHandle(const v8::Signature* sig); |
234 static inline v8::internal::Handle<v8::internal::TypeSwitchInfo> | 236 static inline v8::internal::Handle<v8::internal::TypeSwitchInfo> |
235 OpenHandle(const v8::TypeSwitch* that); | 237 OpenHandle(const v8::TypeSwitch* that); |
236 static inline v8::internal::Handle<v8::internal::Proxy> | 238 static inline v8::internal::Handle<v8::internal::Proxy> |
237 OpenHandle(const v8::External* that); | 239 OpenHandle(const v8::External* that); |
| 240 static inline v8::internal::Handle<v8::internal::ByteArray> |
| 241 OpenHandle(const v8::Blob* that); |
238 }; | 242 }; |
239 | 243 |
240 | 244 |
241 template <class T> | 245 template <class T> |
242 static inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { | 246 static inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { |
243 return reinterpret_cast<T*>(obj.location()); | 247 return reinterpret_cast<T*>(obj.location()); |
244 } | 248 } |
245 | 249 |
246 | 250 |
247 template <class T> | 251 template <class T> |
(...skipping 11 matching lines...) Expand all Loading... |
259 return Local<To>(reinterpret_cast<To*>(obj.location())); \ | 263 return Local<To>(reinterpret_cast<To*>(obj.location())); \ |
260 } | 264 } |
261 | 265 |
262 MAKE_TO_LOCAL(ToLocal, Context, Context) | 266 MAKE_TO_LOCAL(ToLocal, Context, Context) |
263 MAKE_TO_LOCAL(ToLocal, Object, Value) | 267 MAKE_TO_LOCAL(ToLocal, Object, Value) |
264 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) | 268 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) |
265 MAKE_TO_LOCAL(ToLocal, String, String) | 269 MAKE_TO_LOCAL(ToLocal, String, String) |
266 MAKE_TO_LOCAL(ToLocal, JSObject, Object) | 270 MAKE_TO_LOCAL(ToLocal, JSObject, Object) |
267 MAKE_TO_LOCAL(ToLocal, JSArray, Array) | 271 MAKE_TO_LOCAL(ToLocal, JSArray, Array) |
268 MAKE_TO_LOCAL(ToLocal, Proxy, External) | 272 MAKE_TO_LOCAL(ToLocal, Proxy, External) |
| 273 MAKE_TO_LOCAL(ToLocal, ByteArray, Blob) |
269 MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate) | 274 MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate) |
270 MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate) | 275 MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate) |
271 MAKE_TO_LOCAL(ToLocal, SignatureInfo, Signature) | 276 MAKE_TO_LOCAL(ToLocal, SignatureInfo, Signature) |
272 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) | 277 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) |
273 MAKE_TO_LOCAL(MessageToLocal, Object, Message) | 278 MAKE_TO_LOCAL(MessageToLocal, Object, Message) |
274 MAKE_TO_LOCAL(NumberToLocal, Object, Number) | 279 MAKE_TO_LOCAL(NumberToLocal, Object, Number) |
275 MAKE_TO_LOCAL(IntegerToLocal, Object, Integer) | 280 MAKE_TO_LOCAL(IntegerToLocal, Object, Integer) |
276 MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) | 281 MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) |
277 | 282 |
278 #undef MAKE_TO_LOCAL | 283 #undef MAKE_TO_LOCAL |
(...skipping 15 matching lines...) Expand all Loading... |
294 MAKE_OPEN_HANDLE(TypeSwitch, TypeSwitchInfo) | 299 MAKE_OPEN_HANDLE(TypeSwitch, TypeSwitchInfo) |
295 MAKE_OPEN_HANDLE(Data, Object) | 300 MAKE_OPEN_HANDLE(Data, Object) |
296 MAKE_OPEN_HANDLE(Object, JSObject) | 301 MAKE_OPEN_HANDLE(Object, JSObject) |
297 MAKE_OPEN_HANDLE(Array, JSArray) | 302 MAKE_OPEN_HANDLE(Array, JSArray) |
298 MAKE_OPEN_HANDLE(String, String) | 303 MAKE_OPEN_HANDLE(String, String) |
299 MAKE_OPEN_HANDLE(Script, JSFunction) | 304 MAKE_OPEN_HANDLE(Script, JSFunction) |
300 MAKE_OPEN_HANDLE(Function, JSFunction) | 305 MAKE_OPEN_HANDLE(Function, JSFunction) |
301 MAKE_OPEN_HANDLE(Message, JSObject) | 306 MAKE_OPEN_HANDLE(Message, JSObject) |
302 MAKE_OPEN_HANDLE(Context, Context) | 307 MAKE_OPEN_HANDLE(Context, Context) |
303 MAKE_OPEN_HANDLE(External, Proxy) | 308 MAKE_OPEN_HANDLE(External, Proxy) |
| 309 MAKE_OPEN_HANDLE(Blob, ByteArray) |
304 | 310 |
305 #undef MAKE_OPEN_HANDLE | 311 #undef MAKE_OPEN_HANDLE |
306 | 312 |
307 | 313 |
308 namespace internal { | 314 namespace internal { |
309 | 315 |
310 // This class is here in order to be able to declare it a friend of | 316 // This class is here in order to be able to declare it a friend of |
311 // HandleScope. Moving these methods to be members of HandleScope would be | 317 // HandleScope. Moving these methods to be members of HandleScope would be |
312 // neat in some ways, but it would expose external implementation details in | 318 // neat in some ways, but it would expose external implementation details in |
313 // our public header file, which is undesirable. | 319 // our public header file, which is undesirable. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 #ifdef DEBUG | 476 #ifdef DEBUG |
471 v8::ImplementationUtilities::ZapHandleRange( | 477 v8::ImplementationUtilities::ZapHandleRange( |
472 spare_, | 478 spare_, |
473 &spare_[kHandleBlockSize]); | 479 &spare_[kHandleBlockSize]); |
474 #endif | 480 #endif |
475 } | 481 } |
476 | 482 |
477 } } // namespace v8::internal | 483 } } // namespace v8::internal |
478 | 484 |
479 #endif // V8_API_H_ | 485 #endif // V8_API_H_ |
OLD | NEW |