OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 V(Int8Array, JSTypedArray) \ | 177 V(Int8Array, JSTypedArray) \ |
178 V(Uint16Array, JSTypedArray) \ | 178 V(Uint16Array, JSTypedArray) \ |
179 V(Int16Array, JSTypedArray) \ | 179 V(Int16Array, JSTypedArray) \ |
180 V(Uint32Array, JSTypedArray) \ | 180 V(Uint32Array, JSTypedArray) \ |
181 V(Int32Array, JSTypedArray) \ | 181 V(Int32Array, JSTypedArray) \ |
182 V(Float32Array, JSTypedArray) \ | 182 V(Float32Array, JSTypedArray) \ |
183 V(Float64Array, JSTypedArray) \ | 183 V(Float64Array, JSTypedArray) \ |
184 V(DataView, JSDataView) \ | 184 V(DataView, JSDataView) \ |
185 V(String, String) \ | 185 V(String, String) \ |
186 V(Symbol, Symbol) \ | 186 V(Symbol, Symbol) \ |
| 187 V(Private, Private) \ |
187 V(Script, Object) \ | 188 V(Script, Object) \ |
188 V(Function, JSFunction) \ | 189 V(Function, JSFunction) \ |
189 V(Message, JSObject) \ | 190 V(Message, JSObject) \ |
190 V(Context, Context) \ | 191 V(Context, Context) \ |
191 V(External, Foreign) \ | 192 V(External, Foreign) \ |
192 V(StackTrace, JSArray) \ | 193 V(StackTrace, JSArray) \ |
193 V(StackFrame, JSObject) \ | 194 V(StackFrame, JSObject) \ |
194 V(DeclaredAccessorDescriptor, DeclaredAccessorDescriptor) | 195 V(DeclaredAccessorDescriptor, DeclaredAccessorDescriptor) |
195 | 196 |
196 | 197 |
197 class Utils { | 198 class Utils { |
198 public: | 199 public: |
199 static bool ReportApiFailure(const char* location, const char* message); | 200 static bool ReportApiFailure(const char* location, const char* message); |
200 | 201 |
201 static Local<FunctionTemplate> ToFunctionTemplate(NeanderObject obj); | 202 static Local<FunctionTemplate> ToFunctionTemplate(NeanderObject obj); |
202 static Local<ObjectTemplate> ToObjectTemplate(NeanderObject obj); | 203 static Local<ObjectTemplate> ToObjectTemplate(NeanderObject obj); |
203 | 204 |
204 static inline Local<Context> ToLocal( | 205 static inline Local<Context> ToLocal( |
205 v8::internal::Handle<v8::internal::Context> obj); | 206 v8::internal::Handle<v8::internal::Context> obj); |
206 static inline Local<Value> ToLocal( | 207 static inline Local<Value> ToLocal( |
207 v8::internal::Handle<v8::internal::Object> obj); | 208 v8::internal::Handle<v8::internal::Object> obj); |
208 static inline Local<Function> ToLocal( | 209 static inline Local<Function> ToLocal( |
209 v8::internal::Handle<v8::internal::JSFunction> obj); | 210 v8::internal::Handle<v8::internal::JSFunction> obj); |
210 static inline Local<String> ToLocal( | 211 static inline Local<String> ToLocal( |
211 v8::internal::Handle<v8::internal::String> obj); | 212 v8::internal::Handle<v8::internal::String> obj); |
212 static inline Local<Symbol> ToLocal( | 213 static inline Local<Symbol> ToLocal( |
213 v8::internal::Handle<v8::internal::Symbol> obj); | 214 v8::internal::Handle<v8::internal::Symbol> obj); |
| 215 static inline Local<Private> ToLocal( |
| 216 v8::internal::Handle<v8::internal::Private> obj); |
214 static inline Local<RegExp> ToLocal( | 217 static inline Local<RegExp> ToLocal( |
215 v8::internal::Handle<v8::internal::JSRegExp> obj); | 218 v8::internal::Handle<v8::internal::JSRegExp> obj); |
216 static inline Local<Object> ToLocal( | 219 static inline Local<Object> ToLocal( |
217 v8::internal::Handle<v8::internal::JSObject> obj); | 220 v8::internal::Handle<v8::internal::JSObject> obj); |
218 static inline Local<Array> ToLocal( | 221 static inline Local<Array> ToLocal( |
219 v8::internal::Handle<v8::internal::JSArray> obj); | 222 v8::internal::Handle<v8::internal::JSArray> obj); |
220 static inline Local<ArrayBuffer> ToLocal( | 223 static inline Local<ArrayBuffer> ToLocal( |
221 v8::internal::Handle<v8::internal::JSArrayBuffer> obj); | 224 v8::internal::Handle<v8::internal::JSArrayBuffer> obj); |
222 static inline Local<ArrayBufferView> ToLocal( | 225 static inline Local<ArrayBufferView> ToLocal( |
223 v8::internal::Handle<v8::internal::JSArrayBufferView> obj); | 226 v8::internal::Handle<v8::internal::JSArrayBufferView> obj); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 ASSERT(obj->type() == typeConst); \ | 346 ASSERT(obj->type() == typeConst); \ |
344 return Convert<v8::internal::JSTypedArray, v8::TypedArray>(obj); \ | 347 return Convert<v8::internal::JSTypedArray, v8::TypedArray>(obj); \ |
345 } | 348 } |
346 | 349 |
347 | 350 |
348 MAKE_TO_LOCAL(ToLocal, Context, Context) | 351 MAKE_TO_LOCAL(ToLocal, Context, Context) |
349 MAKE_TO_LOCAL(ToLocal, Object, Value) | 352 MAKE_TO_LOCAL(ToLocal, Object, Value) |
350 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) | 353 MAKE_TO_LOCAL(ToLocal, JSFunction, Function) |
351 MAKE_TO_LOCAL(ToLocal, String, String) | 354 MAKE_TO_LOCAL(ToLocal, String, String) |
352 MAKE_TO_LOCAL(ToLocal, Symbol, Symbol) | 355 MAKE_TO_LOCAL(ToLocal, Symbol, Symbol) |
| 356 MAKE_TO_LOCAL(ToLocal, Private, Private) |
353 MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp) | 357 MAKE_TO_LOCAL(ToLocal, JSRegExp, RegExp) |
354 MAKE_TO_LOCAL(ToLocal, JSObject, Object) | 358 MAKE_TO_LOCAL(ToLocal, JSObject, Object) |
355 MAKE_TO_LOCAL(ToLocal, JSArray, Array) | 359 MAKE_TO_LOCAL(ToLocal, JSArray, Array) |
356 MAKE_TO_LOCAL(ToLocal, JSArrayBuffer, ArrayBuffer) | 360 MAKE_TO_LOCAL(ToLocal, JSArrayBuffer, ArrayBuffer) |
357 MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView) | 361 MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView) |
358 MAKE_TO_LOCAL(ToLocal, JSDataView, DataView) | 362 MAKE_TO_LOCAL(ToLocal, JSDataView, DataView) |
359 MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray) | 363 MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray) |
360 | 364 |
361 MAKE_TO_LOCAL_TYPED_ARRAY(Uint8Array, kExternalUnsignedByteArray) | 365 MAKE_TO_LOCAL_TYPED_ARRAY(Uint8Array, kExternalUnsignedByteArray) |
362 MAKE_TO_LOCAL_TYPED_ARRAY(Uint8ClampedArray, kExternalPixelArray) | 366 MAKE_TO_LOCAL_TYPED_ARRAY(Uint8ClampedArray, kExternalPixelArray) |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 stress_type_ = stress_type; | 711 stress_type_ = stress_type; |
708 } | 712 } |
709 | 713 |
710 private: | 714 private: |
711 static v8::Testing::StressType stress_type_; | 715 static v8::Testing::StressType stress_type_; |
712 }; | 716 }; |
713 | 717 |
714 } } // namespace v8::internal | 718 } } // namespace v8::internal |
715 | 719 |
716 #endif // V8_API_H_ | 720 #endif // V8_API_H_ |
OLD | NEW |