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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 V(RegExp, JSRegExp) \ | 170 V(RegExp, JSRegExp) \ |
171 V(Object, JSObject) \ | 171 V(Object, JSObject) \ |
172 V(Array, JSArray) \ | 172 V(Array, JSArray) \ |
173 V(String, String) \ | 173 V(String, String) \ |
174 V(Script, Object) \ | 174 V(Script, Object) \ |
175 V(Function, JSFunction) \ | 175 V(Function, JSFunction) \ |
176 V(Message, JSObject) \ | 176 V(Message, JSObject) \ |
177 V(Context, Context) \ | 177 V(Context, Context) \ |
178 V(External, Foreign) \ | 178 V(External, Foreign) \ |
179 V(StackTrace, JSArray) \ | 179 V(StackTrace, JSArray) \ |
180 V(StackFrame, JSObject) | 180 V(StackFrame, JSObject) \ |
| 181 V(DeclaredAccessorDescriptor, DeclaredAccessorDescriptor) |
181 | 182 |
182 | 183 |
183 class Utils { | 184 class Utils { |
184 public: | 185 public: |
185 static bool ReportApiFailure(const char* location, const char* message); | 186 static bool ReportApiFailure(const char* location, const char* message); |
186 | 187 |
187 static Local<FunctionTemplate> ToFunctionTemplate(NeanderObject obj); | 188 static Local<FunctionTemplate> ToFunctionTemplate(NeanderObject obj); |
188 static Local<ObjectTemplate> ToObjectTemplate(NeanderObject obj); | 189 static Local<ObjectTemplate> ToObjectTemplate(NeanderObject obj); |
189 | 190 |
190 static inline Local<Context> ToLocal( | 191 static inline Local<Context> ToLocal( |
(...skipping 27 matching lines...) Expand all Loading... |
218 static inline Local<ObjectTemplate> ToLocal( | 219 static inline Local<ObjectTemplate> ToLocal( |
219 v8::internal::Handle<v8::internal::ObjectTemplateInfo> obj); | 220 v8::internal::Handle<v8::internal::ObjectTemplateInfo> obj); |
220 static inline Local<Signature> ToLocal( | 221 static inline Local<Signature> ToLocal( |
221 v8::internal::Handle<v8::internal::SignatureInfo> obj); | 222 v8::internal::Handle<v8::internal::SignatureInfo> obj); |
222 static inline Local<AccessorSignature> AccessorSignatureToLocal( | 223 static inline Local<AccessorSignature> AccessorSignatureToLocal( |
223 v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj); | 224 v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj); |
224 static inline Local<TypeSwitch> ToLocal( | 225 static inline Local<TypeSwitch> ToLocal( |
225 v8::internal::Handle<v8::internal::TypeSwitchInfo> obj); | 226 v8::internal::Handle<v8::internal::TypeSwitchInfo> obj); |
226 static inline Local<External> ExternalToLocal( | 227 static inline Local<External> ExternalToLocal( |
227 v8::internal::Handle<v8::internal::JSObject> obj); | 228 v8::internal::Handle<v8::internal::JSObject> obj); |
| 229 static inline Local<DeclaredAccessorDescriptor> ToLocal( |
| 230 v8::internal::Handle<v8::internal::DeclaredAccessorDescriptor> obj); |
228 | 231 |
229 #define DECLARE_OPEN_HANDLE(From, To) \ | 232 #define DECLARE_OPEN_HANDLE(From, To) \ |
230 static inline v8::internal::Handle<v8::internal::To> \ | 233 static inline v8::internal::Handle<v8::internal::To> \ |
231 OpenHandle(const From* that, bool allow_empty_handle = false); | 234 OpenHandle(const From* that, bool allow_empty_handle = false); |
232 | 235 |
233 OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE) | 236 OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE) |
234 | 237 |
235 #undef DECLARE_OPEN_HANDLE | 238 #undef DECLARE_OPEN_HANDLE |
236 }; | 239 }; |
237 | 240 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 MAKE_TO_LOCAL(ToLocal, SignatureInfo, Signature) | 276 MAKE_TO_LOCAL(ToLocal, SignatureInfo, Signature) |
274 MAKE_TO_LOCAL(AccessorSignatureToLocal, FunctionTemplateInfo, AccessorSignature) | 277 MAKE_TO_LOCAL(AccessorSignatureToLocal, FunctionTemplateInfo, AccessorSignature) |
275 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) | 278 MAKE_TO_LOCAL(ToLocal, TypeSwitchInfo, TypeSwitch) |
276 MAKE_TO_LOCAL(MessageToLocal, Object, Message) | 279 MAKE_TO_LOCAL(MessageToLocal, Object, Message) |
277 MAKE_TO_LOCAL(StackTraceToLocal, JSArray, StackTrace) | 280 MAKE_TO_LOCAL(StackTraceToLocal, JSArray, StackTrace) |
278 MAKE_TO_LOCAL(StackFrameToLocal, JSObject, StackFrame) | 281 MAKE_TO_LOCAL(StackFrameToLocal, JSObject, StackFrame) |
279 MAKE_TO_LOCAL(NumberToLocal, Object, Number) | 282 MAKE_TO_LOCAL(NumberToLocal, Object, Number) |
280 MAKE_TO_LOCAL(IntegerToLocal, Object, Integer) | 283 MAKE_TO_LOCAL(IntegerToLocal, Object, Integer) |
281 MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) | 284 MAKE_TO_LOCAL(Uint32ToLocal, Object, Uint32) |
282 MAKE_TO_LOCAL(ExternalToLocal, JSObject, External) | 285 MAKE_TO_LOCAL(ExternalToLocal, JSObject, External) |
| 286 MAKE_TO_LOCAL(ToLocal, DeclaredAccessorDescriptor, DeclaredAccessorDescriptor) |
283 | 287 |
284 #undef MAKE_TO_LOCAL | 288 #undef MAKE_TO_LOCAL |
285 | 289 |
286 | 290 |
287 // Implementations of OpenHandle | 291 // Implementations of OpenHandle |
288 | 292 |
289 #define MAKE_OPEN_HANDLE(From, To) \ | 293 #define MAKE_OPEN_HANDLE(From, To) \ |
290 v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \ | 294 v8::internal::Handle<v8::internal::To> Utils::OpenHandle( \ |
291 const v8::From* that, bool allow_empty_handle) { \ | 295 const v8::From* that, bool allow_empty_handle) { \ |
292 EXTRA_CHECK(allow_empty_handle || that != NULL); \ | 296 EXTRA_CHECK(allow_empty_handle || that != NULL); \ |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 stress_type_ = stress_type; | 589 stress_type_ = stress_type; |
586 } | 590 } |
587 | 591 |
588 private: | 592 private: |
589 static v8::Testing::StressType stress_type_; | 593 static v8::Testing::StressType stress_type_; |
590 }; | 594 }; |
591 | 595 |
592 } } // namespace v8::internal | 596 } } // namespace v8::internal |
593 | 597 |
594 #endif // V8_API_H_ | 598 #endif // V8_API_H_ |
OLD | NEW |