| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_API_H_ | 5 #ifndef V8_API_H_ |
| 6 #define V8_API_H_ | 6 #define V8_API_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "include/v8-testing.h" | 10 #include "include/v8-testing.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 V(Uint8Array, JSTypedArray) \ | 152 V(Uint8Array, JSTypedArray) \ |
| 153 V(Uint8ClampedArray, JSTypedArray) \ | 153 V(Uint8ClampedArray, JSTypedArray) \ |
| 154 V(Int8Array, JSTypedArray) \ | 154 V(Int8Array, JSTypedArray) \ |
| 155 V(Uint16Array, JSTypedArray) \ | 155 V(Uint16Array, JSTypedArray) \ |
| 156 V(Int16Array, JSTypedArray) \ | 156 V(Int16Array, JSTypedArray) \ |
| 157 V(Uint32Array, JSTypedArray) \ | 157 V(Uint32Array, JSTypedArray) \ |
| 158 V(Int32Array, JSTypedArray) \ | 158 V(Int32Array, JSTypedArray) \ |
| 159 V(Float32Array, JSTypedArray) \ | 159 V(Float32Array, JSTypedArray) \ |
| 160 V(Float64Array, JSTypedArray) \ | 160 V(Float64Array, JSTypedArray) \ |
| 161 V(DataView, JSDataView) \ | 161 V(DataView, JSDataView) \ |
| 162 V(SharedArrayBuffer, JSArrayBuffer) \ |
| 163 V(SharedTypedArray, JSTypedArray) \ |
| 164 V(SharedUint8Array, JSTypedArray) \ |
| 165 V(SharedUint8ClampedArray, JSTypedArray) \ |
| 166 V(SharedInt8Array, JSTypedArray) \ |
| 167 V(SharedUint16Array, JSTypedArray) \ |
| 168 V(SharedInt16Array, JSTypedArray) \ |
| 169 V(SharedUint32Array, JSTypedArray) \ |
| 170 V(SharedInt32Array, JSTypedArray) \ |
| 171 V(SharedFloat32Array, JSTypedArray) \ |
| 172 V(SharedFloat64Array, JSTypedArray) \ |
| 162 V(Name, Name) \ | 173 V(Name, Name) \ |
| 163 V(String, String) \ | 174 V(String, String) \ |
| 164 V(Symbol, Symbol) \ | 175 V(Symbol, Symbol) \ |
| 165 V(Script, JSFunction) \ | 176 V(Script, JSFunction) \ |
| 166 V(UnboundScript, SharedFunctionInfo) \ | 177 V(UnboundScript, SharedFunctionInfo) \ |
| 167 V(Function, JSFunction) \ | 178 V(Function, JSFunction) \ |
| 168 V(Message, JSMessageObject) \ | 179 V(Message, JSMessageObject) \ |
| 169 V(Context, Context) \ | 180 V(Context, Context) \ |
| 170 V(External, Object) \ | 181 V(External, Object) \ |
| 171 V(StackTrace, JSArray) \ | 182 V(StackTrace, JSArray) \ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 v8::internal::Handle<v8::internal::JSTypedArray> obj); | 234 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 224 static inline Local<Uint32Array> ToLocalUint32Array( | 235 static inline Local<Uint32Array> ToLocalUint32Array( |
| 225 v8::internal::Handle<v8::internal::JSTypedArray> obj); | 236 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 226 static inline Local<Int32Array> ToLocalInt32Array( | 237 static inline Local<Int32Array> ToLocalInt32Array( |
| 227 v8::internal::Handle<v8::internal::JSTypedArray> obj); | 238 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 228 static inline Local<Float32Array> ToLocalFloat32Array( | 239 static inline Local<Float32Array> ToLocalFloat32Array( |
| 229 v8::internal::Handle<v8::internal::JSTypedArray> obj); | 240 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 230 static inline Local<Float64Array> ToLocalFloat64Array( | 241 static inline Local<Float64Array> ToLocalFloat64Array( |
| 231 v8::internal::Handle<v8::internal::JSTypedArray> obj); | 242 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 232 | 243 |
| 244 static inline Local<SharedArrayBuffer> ToLocalShared( |
| 245 v8::internal::Handle<v8::internal::JSArrayBuffer> obj); |
| 246 static inline Local<SharedTypedArray> ToLocalShared( |
| 247 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 248 static inline Local<SharedUint8Array> ToLocalSharedUint8Array( |
| 249 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 250 static inline Local<SharedUint8ClampedArray> ToLocalSharedUint8ClampedArray( |
| 251 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 252 static inline Local<SharedInt8Array> ToLocalSharedInt8Array( |
| 253 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 254 static inline Local<SharedUint16Array> ToLocalSharedUint16Array( |
| 255 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 256 static inline Local<SharedInt16Array> ToLocalSharedInt16Array( |
| 257 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 258 static inline Local<SharedUint32Array> ToLocalSharedUint32Array( |
| 259 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 260 static inline Local<SharedInt32Array> ToLocalSharedInt32Array( |
| 261 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 262 static inline Local<SharedFloat32Array> ToLocalSharedFloat32Array( |
| 263 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 264 static inline Local<SharedFloat64Array> ToLocalSharedFloat64Array( |
| 265 v8::internal::Handle<v8::internal::JSTypedArray> obj); |
| 266 |
| 233 static inline Local<Message> MessageToLocal( | 267 static inline Local<Message> MessageToLocal( |
| 234 v8::internal::Handle<v8::internal::Object> obj); | 268 v8::internal::Handle<v8::internal::Object> obj); |
| 235 static inline Local<Promise> PromiseToLocal( | 269 static inline Local<Promise> PromiseToLocal( |
| 236 v8::internal::Handle<v8::internal::JSObject> obj); | 270 v8::internal::Handle<v8::internal::JSObject> obj); |
| 237 static inline Local<StackTrace> StackTraceToLocal( | 271 static inline Local<StackTrace> StackTraceToLocal( |
| 238 v8::internal::Handle<v8::internal::JSArray> obj); | 272 v8::internal::Handle<v8::internal::JSArray> obj); |
| 239 static inline Local<StackFrame> StackFrameToLocal( | 273 static inline Local<StackFrame> StackFrameToLocal( |
| 240 v8::internal::Handle<v8::internal::JSObject> obj); | 274 v8::internal::Handle<v8::internal::JSObject> obj); |
| 241 static inline Local<Number> NumberToLocal( | 275 static inline Local<Number> NumberToLocal( |
| 242 v8::internal::Handle<v8::internal::Object> obj); | 276 v8::internal::Handle<v8::internal::Object> obj); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 374 |
| 341 | 375 |
| 342 #define MAKE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype, size) \ | 376 #define MAKE_TO_LOCAL_TYPED_ARRAY(Type, typeName, TYPE, ctype, size) \ |
| 343 Local<v8::Type##Array> Utils::ToLocal##Type##Array( \ | 377 Local<v8::Type##Array> Utils::ToLocal##Type##Array( \ |
| 344 v8::internal::Handle<v8::internal::JSTypedArray> obj) { \ | 378 v8::internal::Handle<v8::internal::JSTypedArray> obj) { \ |
| 345 DCHECK(obj->type() == v8::internal::kExternal##Type##Array); \ | 379 DCHECK(obj->type() == v8::internal::kExternal##Type##Array); \ |
| 346 return Convert<v8::internal::JSTypedArray, v8::Type##Array>(obj); \ | 380 return Convert<v8::internal::JSTypedArray, v8::Type##Array>(obj); \ |
| 347 } | 381 } |
| 348 | 382 |
| 349 | 383 |
| 384 #define MAKE_TO_LOCAL_SHARED_TYPED_ARRAY(Type, typeName, TYPE, ctype, size) \ |
| 385 Local<v8::Shared##Type##Array> Utils::ToLocalShared##Type##Array( \ |
| 386 v8::internal::Handle<v8::internal::JSTypedArray> obj) { \ |
| 387 DCHECK(obj->type() == v8::internal::kExternal##Type##Array); \ |
| 388 return Convert<v8::internal::JSTypedArray, v8::Shared##Type##Array>(obj); \ |
| 389 } |
| 390 |
| 391 |
| 350 MAKE_TO_LOCAL(ToLocal, Context, Context) | 392 MAKE_TO_LOCAL(ToLocal, Context, Context) |
| 351 MAKE_TO_LOCAL(ToLocal, Object, Value) | 393 MAKE_TO_LOCAL(ToLocal, Object, Value) |
| 352 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) | 394 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) |
| 353 MAKE_TO_LOCAL(ToLocal, Name, Name) | 395 MAKE_TO_LOCAL(ToLocal, Name, Name) |
| 354 MAKE_TO_LOCAL(ToLocal, String, String) | 396 MAKE_TO_LOCAL(ToLocal, String, String) |
| 355 MAKE_TO_LOCAL(ToLocal, Symbol, Symbol) | 397 MAKE_TO_LOCAL(ToLocal, Symbol, Symbol) |
| 356 MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp) | 398 MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp) |
| 357 MAKE_TO_LOCAL(ToLocal, JSObject, Object) | 399 MAKE_TO_LOCAL(ToLocal, JSObject, Object) |
| 358 MAKE_TO_LOCAL(ToLocal, JSArray, Array) | 400 MAKE_TO_LOCAL(ToLocal, JSArray, Array) |
| 359 MAKE_TO_LOCAL(ToLocal, JSArrayBuffer, ArrayBuffer) | 401 MAKE_TO_LOCAL(ToLocal, JSArrayBuffer, ArrayBuffer) |
| 360 MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView) | 402 MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView) |
| 361 MAKE_TO_LOCAL(ToLocal, JSDataView, DataView) | 403 MAKE_TO_LOCAL(ToLocal, JSDataView, DataView) |
| 362 MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray) | 404 MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray) |
| 363 | 405 |
| 406 MAKE_TO_LOCAL(ToLocalShared, JSArrayBuffer, SharedArrayBuffer) |
| 407 MAKE_TO_LOCAL(ToLocalShared, JSTypedArray, SharedTypedArray) |
| 408 |
| 364 TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY) | 409 TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY) |
| 410 TYPED_ARRAYS(MAKE_TO_LOCAL_SHARED_TYPED_ARRAY) |
| 365 | 411 |
| 366 MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate) | 412 MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate) |
| 367 MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate) | 413 MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate) |
| 368 MAKE_TO_LOCAL(SignatureToLocal, FunctionTemplateInfo, Signature) | 414 MAKE_TO_LOCAL(SignatureToLocal, FunctionTemplateInfo, Signature) |
| 369 MAKE_TO_LOCAL(AccessorSignatureToLocal, FunctionTemplateInfo, AccessorSignature) | 415 MAKE_TO_LOCAL(AccessorSignatureToLocal, FunctionTemplateInfo, AccessorSignature) |
| 370 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) | 416 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) |
| 371 MAKE_TO_LOCAL(MessageToLocal, Object, Message) | 417 MAKE_TO_LOCAL(MessageToLocal, Object, Message) |
| 372 MAKE_TO_LOCAL(PromiseToLocal, JSObject, Promise) | 418 MAKE_TO_LOCAL(PromiseToLocal, JSObject, Promise) |
| 373 MAKE_TO_LOCAL(StackTraceToLocal, JSArray, StackTrace) | 419 MAKE_TO_LOCAL(StackTraceToLocal, JSArray, StackTrace) |
| 374 MAKE_TO_LOCAL(StackFrameToLocal, JSObject, StackFrame) | 420 MAKE_TO_LOCAL(StackFrameToLocal, JSObject, StackFrame) |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 stress_type_ = stress_type; | 747 stress_type_ = stress_type; |
| 702 } | 748 } |
| 703 | 749 |
| 704 private: | 750 private: |
| 705 static v8::Testing::StressType stress_type_; | 751 static v8::Testing::StressType stress_type_; |
| 706 }; | 752 }; |
| 707 | 753 |
| 708 } } // namespace v8::internal | 754 } } // namespace v8::internal |
| 709 | 755 |
| 710 #endif // V8_API_H_ | 756 #endif // V8_API_H_ |
| OLD | NEW |