2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
17 #include <runtime/ext_hhvm/ext_hhvm.h>
18 #include <runtime/base/builtin_functions.h>
19 #include <runtime/base/array/array_init.h>
20 #include <runtime/ext/ext.h>
21 #include <runtime/vm/class.h>
22 #include <runtime/vm/runtime.h>
27 HPHP::VM::Instance
* new_UConverter_Instance(HPHP::VM::Class
* cls
) {
28 size_t nProps
= cls
->numDeclProperties();
29 size_t builtinPropSize
= sizeof(c_UConverter
) - sizeof(ObjectData
);
30 size_t size
= HPHP::VM::Instance::sizeForNProps(nProps
) + builtinPropSize
;
31 HPHP::VM::Instance
*inst
= (HPHP::VM::Instance
*)ALLOCOBJSZ(size
);
32 new ((void *)inst
) c_UConverter(ObjectStaticCallbacks::encodeVMClass(cls
));
37 void HPHP::c_UConverter::t___construct(HPHP::String const&, HPHP::String const&)
38 _ZN4HPHP12c_UConverter13t___constructERKNS_6StringES3_
45 void th_10UConverter___construct(ObjectData
* this_
, Value
* toEncoding
, Value
* fromEncoding
) asm("_ZN4HPHP12c_UConverter13t___constructERKNS_6StringES3_");
47 TypedValue
* tg1_10UConverter___construct(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
48 TypedValue
* tg1_10UConverter___construct(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
49 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
52 rv
->m_type
= KindOfNull
;
54 default: // count >= 2
55 if (!IS_STRING_TYPE((args
-1)->m_type
)) {
56 tvCastToStringInPlace(args
-1);
59 if (!IS_STRING_TYPE((args
-0)->m_type
)) {
60 tvCastToStringInPlace(args
-0);
65 String defVal0
= "utf-8";
66 String defVal1
= "utf-8";
67 th_10UConverter___construct((this_
), (count
> 0) ? (Value
*)(args
-0) : (Value
*)(&defVal0
), (count
> 1) ? (Value
*)(args
-1) : (Value
*)(&defVal1
));
71 TypedValue
* tg_10UConverter___construct(HPHP::VM::ActRec
*ar
) {
73 long long count
= ar
->numArgs();
74 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
75 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
78 if ((count
<= 1 || IS_STRING_TYPE((args
-1)->m_type
)) && (count
<= 0 || IS_STRING_TYPE((args
-0)->m_type
))) {
81 rv
.m_type
= KindOfNull
;
82 String defVal0
= "utf-8";
83 String defVal1
= "utf-8";
84 th_10UConverter___construct((this_
), (count
> 0) ? (Value
*)(args
-0) : (Value
*)(&defVal0
), (count
> 1) ? (Value
*)(args
-1) : (Value
*)(&defVal1
));
85 frame_free_locals_inl(ar
, 2);
86 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
89 tg1_10UConverter___construct(&rv
, ar
, count
, this_
);
90 frame_free_locals_inl(ar
, 2);
91 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
95 throw_toomany_arguments_nr("UConverter::__construct", 2, 1);
98 throw_instance_method_fatal("UConverter::__construct");
102 rv
.m_type
= KindOfNull
;
103 frame_free_locals_inl(ar
, 2);
104 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
110 HPHP::Variant HPHP::c_UConverter::t___destruct()
111 _ZN4HPHP12c_UConverter12t___destructEv
113 (return value) => rax
118 TypedValue
* th_10UConverter___destruct(TypedValue
* _rv
, ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter12t___destructEv");
120 TypedValue
* tg_10UConverter___destruct(HPHP::VM::ActRec
*ar
) {
122 long long count
= ar
->numArgs();
123 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
124 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
127 th_10UConverter___destruct((&(rv
)), (this_
));
128 if (rv
.m_type
== KindOfUninit
) rv
.m_type
= KindOfNull
;
129 frame_free_locals_inl(ar
, 0);
130 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
133 throw_toomany_arguments_nr("UConverter::__destruct", 0, 1);
136 throw_instance_method_fatal("UConverter::__destruct");
140 rv
.m_type
= KindOfNull
;
141 frame_free_locals_inl(ar
, 0);
142 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
148 HPHP::String HPHP::c_UConverter::t_getsourceencoding()
149 _ZN4HPHP12c_UConverter19t_getsourceencodingEv
151 (return value) => rax
156 Value
* th_10UConverter_getSourceEncoding(Value
* _rv
, ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter19t_getsourceencodingEv");
158 TypedValue
* tg_10UConverter_getSourceEncoding(HPHP::VM::ActRec
*ar
) {
160 long long count
= ar
->numArgs();
161 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
162 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
166 rv
.m_type
= KindOfString
;
167 th_10UConverter_getSourceEncoding((Value
*)(&(rv
)), (this_
));
168 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
169 frame_free_locals_inl(ar
, 0);
170 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
173 throw_toomany_arguments_nr("UConverter::getSourceEncoding", 0, 1);
176 throw_instance_method_fatal("UConverter::getSourceEncoding");
180 rv
.m_type
= KindOfNull
;
181 frame_free_locals_inl(ar
, 0);
182 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
188 void HPHP::c_UConverter::t_setsourceencoding(HPHP::String const&)
189 _ZN4HPHP12c_UConverter19t_setsourceencodingERKNS_6StringE
195 void th_10UConverter_setSourceEncoding(ObjectData
* this_
, Value
* encoding
) asm("_ZN4HPHP12c_UConverter19t_setsourceencodingERKNS_6StringE");
197 TypedValue
* tg1_10UConverter_setSourceEncoding(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
198 TypedValue
* tg1_10UConverter_setSourceEncoding(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
199 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
200 rv
->m_data
.num
= 0LL;
202 rv
->m_type
= KindOfNull
;
203 tvCastToStringInPlace(args
-0);
204 th_10UConverter_setSourceEncoding((this_
), (Value
*)(args
-0));
208 TypedValue
* tg_10UConverter_setSourceEncoding(HPHP::VM::ActRec
*ar
) {
210 long long count
= ar
->numArgs();
211 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
212 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
215 if (IS_STRING_TYPE((args
-0)->m_type
)) {
218 rv
.m_type
= KindOfNull
;
219 th_10UConverter_setSourceEncoding((this_
), (Value
*)(args
-0));
220 frame_free_locals_inl(ar
, 1);
221 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
224 tg1_10UConverter_setSourceEncoding(&rv
, ar
, count
, this_
);
225 frame_free_locals_inl(ar
, 1);
226 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
230 throw_wrong_arguments_nr("UConverter::setSourceEncoding", count
, 1, 1, 1);
233 throw_instance_method_fatal("UConverter::setSourceEncoding");
237 rv
.m_type
= KindOfNull
;
238 frame_free_locals_inl(ar
, 1);
239 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
245 HPHP::String HPHP::c_UConverter::t_getdestinationencoding()
246 _ZN4HPHP12c_UConverter24t_getdestinationencodingEv
248 (return value) => rax
253 Value
* th_10UConverter_getDestinationEncoding(Value
* _rv
, ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter24t_getdestinationencodingEv");
255 TypedValue
* tg_10UConverter_getDestinationEncoding(HPHP::VM::ActRec
*ar
) {
257 long long count
= ar
->numArgs();
258 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
259 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
263 rv
.m_type
= KindOfString
;
264 th_10UConverter_getDestinationEncoding((Value
*)(&(rv
)), (this_
));
265 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
266 frame_free_locals_inl(ar
, 0);
267 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
270 throw_toomany_arguments_nr("UConverter::getDestinationEncoding", 0, 1);
273 throw_instance_method_fatal("UConverter::getDestinationEncoding");
277 rv
.m_type
= KindOfNull
;
278 frame_free_locals_inl(ar
, 0);
279 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
285 void HPHP::c_UConverter::t_setdestinationencoding(HPHP::String const&)
286 _ZN4HPHP12c_UConverter24t_setdestinationencodingERKNS_6StringE
292 void th_10UConverter_setDestinationEncoding(ObjectData
* this_
, Value
* encoding
) asm("_ZN4HPHP12c_UConverter24t_setdestinationencodingERKNS_6StringE");
294 TypedValue
* tg1_10UConverter_setDestinationEncoding(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
295 TypedValue
* tg1_10UConverter_setDestinationEncoding(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
296 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
297 rv
->m_data
.num
= 0LL;
299 rv
->m_type
= KindOfNull
;
300 tvCastToStringInPlace(args
-0);
301 th_10UConverter_setDestinationEncoding((this_
), (Value
*)(args
-0));
305 TypedValue
* tg_10UConverter_setDestinationEncoding(HPHP::VM::ActRec
*ar
) {
307 long long count
= ar
->numArgs();
308 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
309 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
312 if (IS_STRING_TYPE((args
-0)->m_type
)) {
315 rv
.m_type
= KindOfNull
;
316 th_10UConverter_setDestinationEncoding((this_
), (Value
*)(args
-0));
317 frame_free_locals_inl(ar
, 1);
318 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
321 tg1_10UConverter_setDestinationEncoding(&rv
, ar
, count
, this_
);
322 frame_free_locals_inl(ar
, 1);
323 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
327 throw_wrong_arguments_nr("UConverter::setDestinationEncoding", count
, 1, 1, 1);
330 throw_instance_method_fatal("UConverter::setDestinationEncoding");
334 rv
.m_type
= KindOfNull
;
335 frame_free_locals_inl(ar
, 1);
336 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
342 long long HPHP::c_UConverter::t_getsourcetype()
343 _ZN4HPHP12c_UConverter15t_getsourcetypeEv
345 (return value) => rax
349 long long th_10UConverter_getSourceType(ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter15t_getsourcetypeEv");
351 TypedValue
* tg_10UConverter_getSourceType(HPHP::VM::ActRec
*ar
) {
353 long long count
= ar
->numArgs();
354 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
355 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
359 rv
.m_type
= KindOfInt64
;
360 rv
.m_data
.num
= (long long)th_10UConverter_getSourceType((this_
));
361 frame_free_locals_inl(ar
, 0);
362 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
365 throw_toomany_arguments_nr("UConverter::getSourceType", 0, 1);
368 throw_instance_method_fatal("UConverter::getSourceType");
372 rv
.m_type
= KindOfNull
;
373 frame_free_locals_inl(ar
, 0);
374 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
380 long long HPHP::c_UConverter::t_getdestinationtype()
381 _ZN4HPHP12c_UConverter20t_getdestinationtypeEv
383 (return value) => rax
387 long long th_10UConverter_getDestinationType(ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter20t_getdestinationtypeEv");
389 TypedValue
* tg_10UConverter_getDestinationType(HPHP::VM::ActRec
*ar
) {
391 long long count
= ar
->numArgs();
392 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
393 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
397 rv
.m_type
= KindOfInt64
;
398 rv
.m_data
.num
= (long long)th_10UConverter_getDestinationType((this_
));
399 frame_free_locals_inl(ar
, 0);
400 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
403 throw_toomany_arguments_nr("UConverter::getDestinationType", 0, 1);
406 throw_instance_method_fatal("UConverter::getDestinationType");
410 rv
.m_type
= KindOfNull
;
411 frame_free_locals_inl(ar
, 0);
412 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
418 HPHP::String HPHP::c_UConverter::t_getsubstchars()
419 _ZN4HPHP12c_UConverter15t_getsubstcharsEv
421 (return value) => rax
426 Value
* th_10UConverter_getSubstChars(Value
* _rv
, ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter15t_getsubstcharsEv");
428 TypedValue
* tg_10UConverter_getSubstChars(HPHP::VM::ActRec
*ar
) {
430 long long count
= ar
->numArgs();
431 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
432 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
436 rv
.m_type
= KindOfString
;
437 th_10UConverter_getSubstChars((Value
*)(&(rv
)), (this_
));
438 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
439 frame_free_locals_inl(ar
, 0);
440 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
443 throw_toomany_arguments_nr("UConverter::getSubstChars", 0, 1);
446 throw_instance_method_fatal("UConverter::getSubstChars");
450 rv
.m_type
= KindOfNull
;
451 frame_free_locals_inl(ar
, 0);
452 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
458 bool HPHP::c_UConverter::t_setsubstchars(HPHP::String const&)
459 _ZN4HPHP12c_UConverter15t_setsubstcharsERKNS_6StringE
461 (return value) => rax
466 bool th_10UConverter_setSubstChars(ObjectData
* this_
, Value
* chars
) asm("_ZN4HPHP12c_UConverter15t_setsubstcharsERKNS_6StringE");
468 TypedValue
* tg1_10UConverter_setSubstChars(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
469 TypedValue
* tg1_10UConverter_setSubstChars(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
470 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
472 rv
->m_type
= KindOfBoolean
;
473 tvCastToStringInPlace(args
-0);
474 rv
->m_data
.num
= (th_10UConverter_setSubstChars((this_
), (Value
*)(args
-0))) ? 1LL : 0LL;
478 TypedValue
* tg_10UConverter_setSubstChars(HPHP::VM::ActRec
*ar
) {
480 long long count
= ar
->numArgs();
481 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
482 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
485 if (IS_STRING_TYPE((args
-0)->m_type
)) {
487 rv
.m_type
= KindOfBoolean
;
488 rv
.m_data
.num
= (th_10UConverter_setSubstChars((this_
), (Value
*)(args
-0))) ? 1LL : 0LL;
489 frame_free_locals_inl(ar
, 1);
490 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
493 tg1_10UConverter_setSubstChars(&rv
, ar
, count
, this_
);
494 frame_free_locals_inl(ar
, 1);
495 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
499 throw_wrong_arguments_nr("UConverter::setSubstChars", count
, 1, 1, 1);
502 throw_instance_method_fatal("UConverter::setSubstChars");
506 rv
.m_type
= KindOfNull
;
507 frame_free_locals_inl(ar
, 1);
508 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
514 HPHP::Variant HPHP::c_UConverter::t_fromucallback(long long, HPHP::Array const&, long long, HPHP::VRefParamValue const&)
515 _ZN4HPHP12c_UConverter15t_fromucallbackExRKNS_5ArrayExRKNS_14VRefParamValueE
517 (return value) => rax
526 TypedValue
* th_10UConverter_fromUCallback(TypedValue
* _rv
, ObjectData
* this_
, long long reason
, Value
* source
, long long codepoint
, TypedValue
* error
) asm("_ZN4HPHP12c_UConverter15t_fromucallbackExRKNS_5ArrayExRKNS_14VRefParamValueE");
528 TypedValue
* tg1_10UConverter_fromUCallback(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
529 TypedValue
* tg1_10UConverter_fromUCallback(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
530 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
531 if ((args
-2)->m_type
!= KindOfInt64
) {
532 tvCastToInt64InPlace(args
-2);
534 if ((args
-1)->m_type
!= KindOfArray
) {
535 tvCastToArrayInPlace(args
-1);
537 if ((args
-0)->m_type
!= KindOfInt64
) {
538 tvCastToInt64InPlace(args
-0);
540 th_10UConverter_fromUCallback((rv
), (this_
), (long long)(args
[-0].m_data
.num
), (Value
*)(args
-1), (long long)(args
[-2].m_data
.num
), (args
-3));
541 if (rv
->m_type
== KindOfUninit
) rv
->m_type
= KindOfNull
;
545 TypedValue
* tg_10UConverter_fromUCallback(HPHP::VM::ActRec
*ar
) {
547 long long count
= ar
->numArgs();
548 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
549 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
552 if ((args
-2)->m_type
== KindOfInt64
&& (args
-1)->m_type
== KindOfArray
&& (args
-0)->m_type
== KindOfInt64
) {
553 th_10UConverter_fromUCallback((&(rv
)), (this_
), (long long)(args
[-0].m_data
.num
), (Value
*)(args
-1), (long long)(args
[-2].m_data
.num
), (args
-3));
554 if (rv
.m_type
== KindOfUninit
) rv
.m_type
= KindOfNull
;
555 frame_free_locals_inl(ar
, 4);
556 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
559 tg1_10UConverter_fromUCallback(&rv
, ar
, count
, this_
);
560 frame_free_locals_inl(ar
, 4);
561 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
565 throw_wrong_arguments_nr("UConverter::fromUCallback", count
, 4, 4, 1);
568 throw_instance_method_fatal("UConverter::fromUCallback");
572 rv
.m_type
= KindOfNull
;
573 frame_free_locals_inl(ar
, 4);
574 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
580 HPHP::Variant HPHP::c_UConverter::t_toucallback(long long, HPHP::String const&, HPHP::String const&, HPHP::VRefParamValue const&)
581 _ZN4HPHP12c_UConverter13t_toucallbackExRKNS_6StringES3_RKNS_14VRefParamValueE
583 (return value) => rax
592 TypedValue
* th_10UConverter_toUCallback(TypedValue
* _rv
, ObjectData
* this_
, long long reason
, Value
* source
, Value
* codeunits
, TypedValue
* error
) asm("_ZN4HPHP12c_UConverter13t_toucallbackExRKNS_6StringES3_RKNS_14VRefParamValueE");
594 TypedValue
* tg1_10UConverter_toUCallback(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
595 TypedValue
* tg1_10UConverter_toUCallback(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
596 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
597 if (!IS_STRING_TYPE((args
-2)->m_type
)) {
598 tvCastToStringInPlace(args
-2);
600 if (!IS_STRING_TYPE((args
-1)->m_type
)) {
601 tvCastToStringInPlace(args
-1);
603 if ((args
-0)->m_type
!= KindOfInt64
) {
604 tvCastToInt64InPlace(args
-0);
606 th_10UConverter_toUCallback((rv
), (this_
), (long long)(args
[-0].m_data
.num
), (Value
*)(args
-1), (Value
*)(args
-2), (args
-3));
607 if (rv
->m_type
== KindOfUninit
) rv
->m_type
= KindOfNull
;
611 TypedValue
* tg_10UConverter_toUCallback(HPHP::VM::ActRec
*ar
) {
613 long long count
= ar
->numArgs();
614 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
615 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
618 if (IS_STRING_TYPE((args
-2)->m_type
) && IS_STRING_TYPE((args
-1)->m_type
) && (args
-0)->m_type
== KindOfInt64
) {
619 th_10UConverter_toUCallback((&(rv
)), (this_
), (long long)(args
[-0].m_data
.num
), (Value
*)(args
-1), (Value
*)(args
-2), (args
-3));
620 if (rv
.m_type
== KindOfUninit
) rv
.m_type
= KindOfNull
;
621 frame_free_locals_inl(ar
, 4);
622 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
625 tg1_10UConverter_toUCallback(&rv
, ar
, count
, this_
);
626 frame_free_locals_inl(ar
, 4);
627 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
631 throw_wrong_arguments_nr("UConverter::toUCallback", count
, 4, 4, 1);
634 throw_instance_method_fatal("UConverter::toUCallback");
638 rv
.m_type
= KindOfNull
;
639 frame_free_locals_inl(ar
, 4);
640 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
646 HPHP::Variant HPHP::c_UConverter::t_convert(HPHP::String const&, bool)
647 _ZN4HPHP12c_UConverter9t_convertERKNS_6StringEb
649 (return value) => rax
656 TypedValue
* th_10UConverter_convert(TypedValue
* _rv
, ObjectData
* this_
, Value
* str
, bool reverse
) asm("_ZN4HPHP12c_UConverter9t_convertERKNS_6StringEb");
658 TypedValue
* tg1_10UConverter_convert(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) __attribute__((noinline
,cold
));
659 TypedValue
* tg1_10UConverter_convert(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
, ObjectData
* this_
) {
660 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
662 default: // count >= 2
663 if ((args
-1)->m_type
!= KindOfBoolean
) {
664 tvCastToBooleanInPlace(args
-1);
669 if (!IS_STRING_TYPE((args
-0)->m_type
)) {
670 tvCastToStringInPlace(args
-0);
672 th_10UConverter_convert((rv
), (this_
), (Value
*)(args
-0), (count
> 1) ? (bool)(args
[-1].m_data
.num
) : (bool)(false));
673 if (rv
->m_type
== KindOfUninit
) rv
->m_type
= KindOfNull
;
677 TypedValue
* tg_10UConverter_convert(HPHP::VM::ActRec
*ar
) {
679 long long count
= ar
->numArgs();
680 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
681 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
683 if (count
>= 1LL && count
<= 2LL) {
684 if ((count
<= 1 || (args
-1)->m_type
== KindOfBoolean
) && IS_STRING_TYPE((args
-0)->m_type
)) {
685 th_10UConverter_convert((&(rv
)), (this_
), (Value
*)(args
-0), (count
> 1) ? (bool)(args
[-1].m_data
.num
) : (bool)(false));
686 if (rv
.m_type
== KindOfUninit
) rv
.m_type
= KindOfNull
;
687 frame_free_locals_inl(ar
, 2);
688 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
691 tg1_10UConverter_convert(&rv
, ar
, count
, this_
);
692 frame_free_locals_inl(ar
, 2);
693 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
697 throw_wrong_arguments_nr("UConverter::convert", count
, 1, 2, 1);
700 throw_instance_method_fatal("UConverter::convert");
704 rv
.m_type
= KindOfNull
;
705 frame_free_locals_inl(ar
, 2);
706 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
712 HPHP::Variant HPHP::c_UConverter::ti_transcode(char const*, HPHP::String const&, HPHP::String const&, HPHP::String const&, HPHP::Array const&)
713 _ZN4HPHP12c_UConverter12ti_transcodeEPKcRKNS_6StringES5_S5_RKNS_5ArrayE
715 (return value) => rax
724 TypedValue
* th_10UConverter_transcode(TypedValue
* _rv
, char const* cls_
, Value
* str
, Value
* toEncoding
, Value
* fromEncoding
, Value
* options
) asm("_ZN4HPHP12c_UConverter12ti_transcodeEPKcRKNS_6StringES5_S5_RKNS_5ArrayE");
726 TypedValue
* tg1_10UConverter_transcode(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) __attribute__((noinline
,cold
));
727 TypedValue
* tg1_10UConverter_transcode(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) {
728 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
730 default: // count >= 4
731 if ((args
-3)->m_type
!= KindOfArray
) {
732 tvCastToArrayInPlace(args
-3);
737 if (!IS_STRING_TYPE((args
-2)->m_type
)) {
738 tvCastToStringInPlace(args
-2);
740 if (!IS_STRING_TYPE((args
-1)->m_type
)) {
741 tvCastToStringInPlace(args
-1);
743 if (!IS_STRING_TYPE((args
-0)->m_type
)) {
744 tvCastToStringInPlace(args
-0);
746 Array defVal3
= null_variant
;
747 th_10UConverter_transcode((rv
), ("UConverter"), (Value
*)(args
-0), (Value
*)(args
-1), (Value
*)(args
-2), (count
> 3) ? (Value
*)(args
-3) : (Value
*)(&defVal3
));
748 if (rv
->m_type
== KindOfUninit
) rv
->m_type
= KindOfNull
;
752 TypedValue
* tg_10UConverter_transcode(HPHP::VM::ActRec
*ar
) {
754 long long count
= ar
->numArgs();
755 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
756 if (count
>= 3LL && count
<= 4LL) {
757 if ((count
<= 3 || (args
-3)->m_type
== KindOfArray
) && IS_STRING_TYPE((args
-2)->m_type
) && IS_STRING_TYPE((args
-1)->m_type
) && IS_STRING_TYPE((args
-0)->m_type
)) {
758 Array defVal3
= null_variant
;
759 th_10UConverter_transcode((&(rv
)), ("UConverter"), (Value
*)(args
-0), (Value
*)(args
-1), (Value
*)(args
-2), (count
> 3) ? (Value
*)(args
-3) : (Value
*)(&defVal3
));
760 if (rv
.m_type
== KindOfUninit
) rv
.m_type
= KindOfNull
;
761 frame_free_locals_no_this_inl(ar
, 4);
762 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
765 tg1_10UConverter_transcode(&rv
, ar
, count
);
766 frame_free_locals_no_this_inl(ar
, 4);
767 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
771 throw_wrong_arguments_nr("UConverter::transcode", count
, 3, 4, 1);
775 rv
.m_type
= KindOfNull
;
776 frame_free_locals_no_this_inl(ar
, 4);
777 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
783 long long HPHP::c_UConverter::t_geterrorcode()
784 _ZN4HPHP12c_UConverter14t_geterrorcodeEv
786 (return value) => rax
790 long long th_10UConverter_getErrorCode(ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter14t_geterrorcodeEv");
792 TypedValue
* tg_10UConverter_getErrorCode(HPHP::VM::ActRec
*ar
) {
794 long long count
= ar
->numArgs();
795 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
796 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
800 rv
.m_type
= KindOfInt64
;
801 rv
.m_data
.num
= (long long)th_10UConverter_getErrorCode((this_
));
802 frame_free_locals_inl(ar
, 0);
803 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
806 throw_toomany_arguments_nr("UConverter::getErrorCode", 0, 1);
809 throw_instance_method_fatal("UConverter::getErrorCode");
813 rv
.m_type
= KindOfNull
;
814 frame_free_locals_inl(ar
, 0);
815 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
821 HPHP::String HPHP::c_UConverter::t_geterrormessage()
822 _ZN4HPHP12c_UConverter17t_geterrormessageEv
824 (return value) => rax
829 Value
* th_10UConverter_getErrorMessage(Value
* _rv
, ObjectData
* this_
) asm("_ZN4HPHP12c_UConverter17t_geterrormessageEv");
831 TypedValue
* tg_10UConverter_getErrorMessage(HPHP::VM::ActRec
*ar
) {
833 long long count
= ar
->numArgs();
834 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
835 ObjectData
* this_
= (ar
->hasThis() ? ar
->getThis() : NULL
);
839 rv
.m_type
= KindOfString
;
840 th_10UConverter_getErrorMessage((Value
*)(&(rv
)), (this_
));
841 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
842 frame_free_locals_inl(ar
, 0);
843 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
846 throw_toomany_arguments_nr("UConverter::getErrorMessage", 0, 1);
849 throw_instance_method_fatal("UConverter::getErrorMessage");
853 rv
.m_type
= KindOfNull
;
854 frame_free_locals_inl(ar
, 0);
855 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
861 HPHP::String HPHP::c_UConverter::ti_reasontext(char const*, long long)
862 _ZN4HPHP12c_UConverter13ti_reasontextEPKcx
864 (return value) => rax
870 Value
* th_10UConverter_reasonText(Value
* _rv
, char const* cls_
, long long reason
) asm("_ZN4HPHP12c_UConverter13ti_reasontextEPKcx");
872 TypedValue
* tg1_10UConverter_reasonText(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) __attribute__((noinline
,cold
));
873 TypedValue
* tg1_10UConverter_reasonText(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) {
874 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
876 rv
->m_type
= KindOfString
;
877 tvCastToInt64InPlace(args
-0);
878 th_10UConverter_reasonText((Value
*)(rv
), ("UConverter"), (long long)(args
[-0].m_data
.num
));
879 if (rv
->m_data
.num
== 0LL) rv
->m_type
= KindOfNull
;
883 TypedValue
* tg_10UConverter_reasonText(HPHP::VM::ActRec
*ar
) {
885 long long count
= ar
->numArgs();
886 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
888 if ((args
-0)->m_type
== KindOfInt64
) {
890 rv
.m_type
= KindOfString
;
891 th_10UConverter_reasonText((Value
*)(&(rv
)), ("UConverter"), (long long)(args
[-0].m_data
.num
));
892 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
893 frame_free_locals_no_this_inl(ar
, 1);
894 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
897 tg1_10UConverter_reasonText(&rv
, ar
, count
);
898 frame_free_locals_no_this_inl(ar
, 1);
899 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
903 throw_wrong_arguments_nr("UConverter::reasonText", count
, 1, 1, 1);
907 rv
.m_type
= KindOfNull
;
908 frame_free_locals_no_this_inl(ar
, 1);
909 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
915 HPHP::Array HPHP::c_UConverter::ti_getavailable(char const*)
916 _ZN4HPHP12c_UConverter15ti_getavailableEPKc
918 (return value) => rax
923 Value
* th_10UConverter_getAvailable(Value
* _rv
, char const* cls_
) asm("_ZN4HPHP12c_UConverter15ti_getavailableEPKc");
925 TypedValue
* tg_10UConverter_getAvailable(HPHP::VM::ActRec
*ar
) {
927 long long count
= ar
->numArgs();
928 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
931 rv
.m_type
= KindOfArray
;
932 th_10UConverter_getAvailable((Value
*)(&(rv
)), ("UConverter"));
933 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
934 frame_free_locals_no_this_inl(ar
, 0);
935 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
938 throw_toomany_arguments_nr("UConverter::getAvailable", 0, 1);
942 rv
.m_type
= KindOfNull
;
943 frame_free_locals_no_this_inl(ar
, 0);
944 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
950 HPHP::Array HPHP::c_UConverter::ti_getaliases(char const*, HPHP::String const&)
951 _ZN4HPHP12c_UConverter13ti_getaliasesEPKcRKNS_6StringE
953 (return value) => rax
959 Value
* th_10UConverter_getAliases(Value
* _rv
, char const* cls_
, Value
* encoding
) asm("_ZN4HPHP12c_UConverter13ti_getaliasesEPKcRKNS_6StringE");
961 TypedValue
* tg1_10UConverter_getAliases(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) __attribute__((noinline
,cold
));
962 TypedValue
* tg1_10UConverter_getAliases(TypedValue
* rv
, HPHP::VM::ActRec
* ar
, long long count
) {
963 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
965 rv
->m_type
= KindOfArray
;
966 tvCastToStringInPlace(args
-0);
967 th_10UConverter_getAliases((Value
*)(rv
), ("UConverter"), (Value
*)(args
-0));
968 if (rv
->m_data
.num
== 0LL) rv
->m_type
= KindOfNull
;
972 TypedValue
* tg_10UConverter_getAliases(HPHP::VM::ActRec
*ar
) {
974 long long count
= ar
->numArgs();
975 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
977 if (IS_STRING_TYPE((args
-0)->m_type
)) {
979 rv
.m_type
= KindOfArray
;
980 th_10UConverter_getAliases((Value
*)(&(rv
)), ("UConverter"), (Value
*)(args
-0));
981 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
982 frame_free_locals_no_this_inl(ar
, 1);
983 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
986 tg1_10UConverter_getAliases(&rv
, ar
, count
);
987 frame_free_locals_no_this_inl(ar
, 1);
988 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
992 throw_wrong_arguments_nr("UConverter::getAliases", count
, 1, 1, 1);
996 rv
.m_type
= KindOfNull
;
997 frame_free_locals_no_this_inl(ar
, 1);
998 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
1004 HPHP::Array HPHP::c_UConverter::ti_getstandards(char const*)
1005 _ZN4HPHP12c_UConverter15ti_getstandardsEPKc
1007 (return value) => rax
1012 Value
* th_10UConverter_getStandards(Value
* _rv
, char const* cls_
) asm("_ZN4HPHP12c_UConverter15ti_getstandardsEPKc");
1014 TypedValue
* tg_10UConverter_getStandards(HPHP::VM::ActRec
*ar
) {
1016 long long count
= ar
->numArgs();
1017 TypedValue
* args UNUSED
= ((TypedValue
*)ar
) - 1;
1020 rv
.m_type
= KindOfArray
;
1021 th_10UConverter_getStandards((Value
*)(&(rv
)), ("UConverter"));
1022 if (rv
.m_data
.num
== 0LL) rv
.m_type
= KindOfNull
;
1023 frame_free_locals_no_this_inl(ar
, 0);
1024 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));
1027 throw_toomany_arguments_nr("UConverter::getStandards", 0, 1);
1029 rv
.m_data
.num
= 0LL;
1031 rv
.m_type
= KindOfNull
;
1032 frame_free_locals_no_this_inl(ar
, 0);
1033 memcpy(&ar
->m_r
, &rv
, sizeof(TypedValue
));