Add UConverter to intl extension to match Zend
[hiphop-php.git] / src / runtime / ext / ext_icu_ucnv.ext_hhvm.cpp
blobd7f1181f7be51d79a390e3d35bb35ad92cc48ff1
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
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>
23 #include <exception>
25 namespace HPHP {
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));
33 return inst;
37 void HPHP::c_UConverter::t___construct(HPHP::String const&, HPHP::String const&)
38 _ZN4HPHP12c_UConverter13t___constructERKNS_6StringES3_
40 this_ => rdi
41 toEncoding => rsi
42 fromEncoding => rdx
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;
50 rv->m_data.num = 0LL;
51 rv->_count = 0;
52 rv->m_type = KindOfNull;
53 switch (count) {
54 default: // count >= 2
55 if (!IS_STRING_TYPE((args-1)->m_type)) {
56 tvCastToStringInPlace(args-1);
58 case 1:
59 if (!IS_STRING_TYPE((args-0)->m_type)) {
60 tvCastToStringInPlace(args-0);
62 case 0:
63 break;
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));
68 return rv;
71 TypedValue* tg_10UConverter___construct(HPHP::VM::ActRec *ar) {
72 TypedValue rv;
73 long long count = ar->numArgs();
74 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
75 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
76 if (this_) {
77 if (count <= 2LL) {
78 if ((count <= 1 || IS_STRING_TYPE((args-1)->m_type)) && (count <= 0 || IS_STRING_TYPE((args-0)->m_type))) {
79 rv.m_data.num = 0LL;
80 rv._count = 0;
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));
87 return &ar->m_r;
88 } else {
89 tg1_10UConverter___construct(&rv, ar, count , this_);
90 frame_free_locals_inl(ar, 2);
91 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
92 return &ar->m_r;
94 } else {
95 throw_toomany_arguments_nr("UConverter::__construct", 2, 1);
97 } else {
98 throw_instance_method_fatal("UConverter::__construct");
100 rv.m_data.num = 0LL;
101 rv._count = 0;
102 rv.m_type = KindOfNull;
103 frame_free_locals_inl(ar, 2);
104 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
105 return &ar->m_r;
106 return &ar->m_r;
110 HPHP::Variant HPHP::c_UConverter::t___destruct()
111 _ZN4HPHP12c_UConverter12t___destructEv
113 (return value) => rax
114 _rv => rdi
115 this_ => rsi
118 TypedValue* th_10UConverter___destruct(TypedValue* _rv, ObjectData* this_) asm("_ZN4HPHP12c_UConverter12t___destructEv");
120 TypedValue* tg_10UConverter___destruct(HPHP::VM::ActRec *ar) {
121 TypedValue rv;
122 long long count = ar->numArgs();
123 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
124 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
125 if (this_) {
126 if (count == 0LL) {
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));
131 return &ar->m_r;
132 } else {
133 throw_toomany_arguments_nr("UConverter::__destruct", 0, 1);
135 } else {
136 throw_instance_method_fatal("UConverter::__destruct");
138 rv.m_data.num = 0LL;
139 rv._count = 0;
140 rv.m_type = KindOfNull;
141 frame_free_locals_inl(ar, 0);
142 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
143 return &ar->m_r;
144 return &ar->m_r;
148 HPHP::String HPHP::c_UConverter::t_getsourceencoding()
149 _ZN4HPHP12c_UConverter19t_getsourceencodingEv
151 (return value) => rax
152 _rv => rdi
153 this_ => rsi
156 Value* th_10UConverter_getSourceEncoding(Value* _rv, ObjectData* this_) asm("_ZN4HPHP12c_UConverter19t_getsourceencodingEv");
158 TypedValue* tg_10UConverter_getSourceEncoding(HPHP::VM::ActRec *ar) {
159 TypedValue rv;
160 long long count = ar->numArgs();
161 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
162 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
163 if (this_) {
164 if (count == 0LL) {
165 rv._count = 0;
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));
171 return &ar->m_r;
172 } else {
173 throw_toomany_arguments_nr("UConverter::getSourceEncoding", 0, 1);
175 } else {
176 throw_instance_method_fatal("UConverter::getSourceEncoding");
178 rv.m_data.num = 0LL;
179 rv._count = 0;
180 rv.m_type = KindOfNull;
181 frame_free_locals_inl(ar, 0);
182 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
183 return &ar->m_r;
184 return &ar->m_r;
188 void HPHP::c_UConverter::t_setsourceencoding(HPHP::String const&)
189 _ZN4HPHP12c_UConverter19t_setsourceencodingERKNS_6StringE
191 this_ => rdi
192 encoding => rsi
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;
201 rv->_count = 0;
202 rv->m_type = KindOfNull;
203 tvCastToStringInPlace(args-0);
204 th_10UConverter_setSourceEncoding((this_), (Value*)(args-0));
205 return rv;
208 TypedValue* tg_10UConverter_setSourceEncoding(HPHP::VM::ActRec *ar) {
209 TypedValue rv;
210 long long count = ar->numArgs();
211 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
212 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
213 if (this_) {
214 if (count == 1LL) {
215 if (IS_STRING_TYPE((args-0)->m_type)) {
216 rv.m_data.num = 0LL;
217 rv._count = 0;
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));
222 return &ar->m_r;
223 } else {
224 tg1_10UConverter_setSourceEncoding(&rv, ar, count , this_);
225 frame_free_locals_inl(ar, 1);
226 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
227 return &ar->m_r;
229 } else {
230 throw_wrong_arguments_nr("UConverter::setSourceEncoding", count, 1, 1, 1);
232 } else {
233 throw_instance_method_fatal("UConverter::setSourceEncoding");
235 rv.m_data.num = 0LL;
236 rv._count = 0;
237 rv.m_type = KindOfNull;
238 frame_free_locals_inl(ar, 1);
239 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
240 return &ar->m_r;
241 return &ar->m_r;
245 HPHP::String HPHP::c_UConverter::t_getdestinationencoding()
246 _ZN4HPHP12c_UConverter24t_getdestinationencodingEv
248 (return value) => rax
249 _rv => rdi
250 this_ => rsi
253 Value* th_10UConverter_getDestinationEncoding(Value* _rv, ObjectData* this_) asm("_ZN4HPHP12c_UConverter24t_getdestinationencodingEv");
255 TypedValue* tg_10UConverter_getDestinationEncoding(HPHP::VM::ActRec *ar) {
256 TypedValue rv;
257 long long count = ar->numArgs();
258 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
259 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
260 if (this_) {
261 if (count == 0LL) {
262 rv._count = 0;
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));
268 return &ar->m_r;
269 } else {
270 throw_toomany_arguments_nr("UConverter::getDestinationEncoding", 0, 1);
272 } else {
273 throw_instance_method_fatal("UConverter::getDestinationEncoding");
275 rv.m_data.num = 0LL;
276 rv._count = 0;
277 rv.m_type = KindOfNull;
278 frame_free_locals_inl(ar, 0);
279 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
280 return &ar->m_r;
281 return &ar->m_r;
285 void HPHP::c_UConverter::t_setdestinationencoding(HPHP::String const&)
286 _ZN4HPHP12c_UConverter24t_setdestinationencodingERKNS_6StringE
288 this_ => rdi
289 encoding => rsi
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;
298 rv->_count = 0;
299 rv->m_type = KindOfNull;
300 tvCastToStringInPlace(args-0);
301 th_10UConverter_setDestinationEncoding((this_), (Value*)(args-0));
302 return rv;
305 TypedValue* tg_10UConverter_setDestinationEncoding(HPHP::VM::ActRec *ar) {
306 TypedValue rv;
307 long long count = ar->numArgs();
308 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
309 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
310 if (this_) {
311 if (count == 1LL) {
312 if (IS_STRING_TYPE((args-0)->m_type)) {
313 rv.m_data.num = 0LL;
314 rv._count = 0;
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));
319 return &ar->m_r;
320 } else {
321 tg1_10UConverter_setDestinationEncoding(&rv, ar, count , this_);
322 frame_free_locals_inl(ar, 1);
323 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
324 return &ar->m_r;
326 } else {
327 throw_wrong_arguments_nr("UConverter::setDestinationEncoding", count, 1, 1, 1);
329 } else {
330 throw_instance_method_fatal("UConverter::setDestinationEncoding");
332 rv.m_data.num = 0LL;
333 rv._count = 0;
334 rv.m_type = KindOfNull;
335 frame_free_locals_inl(ar, 1);
336 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
337 return &ar->m_r;
338 return &ar->m_r;
342 long long HPHP::c_UConverter::t_getsourcetype()
343 _ZN4HPHP12c_UConverter15t_getsourcetypeEv
345 (return value) => rax
346 this_ => rdi
349 long long th_10UConverter_getSourceType(ObjectData* this_) asm("_ZN4HPHP12c_UConverter15t_getsourcetypeEv");
351 TypedValue* tg_10UConverter_getSourceType(HPHP::VM::ActRec *ar) {
352 TypedValue rv;
353 long long count = ar->numArgs();
354 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
355 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
356 if (this_) {
357 if (count == 0LL) {
358 rv._count = 0;
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));
363 return &ar->m_r;
364 } else {
365 throw_toomany_arguments_nr("UConverter::getSourceType", 0, 1);
367 } else {
368 throw_instance_method_fatal("UConverter::getSourceType");
370 rv.m_data.num = 0LL;
371 rv._count = 0;
372 rv.m_type = KindOfNull;
373 frame_free_locals_inl(ar, 0);
374 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
375 return &ar->m_r;
376 return &ar->m_r;
380 long long HPHP::c_UConverter::t_getdestinationtype()
381 _ZN4HPHP12c_UConverter20t_getdestinationtypeEv
383 (return value) => rax
384 this_ => rdi
387 long long th_10UConverter_getDestinationType(ObjectData* this_) asm("_ZN4HPHP12c_UConverter20t_getdestinationtypeEv");
389 TypedValue* tg_10UConverter_getDestinationType(HPHP::VM::ActRec *ar) {
390 TypedValue rv;
391 long long count = ar->numArgs();
392 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
393 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
394 if (this_) {
395 if (count == 0LL) {
396 rv._count = 0;
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));
401 return &ar->m_r;
402 } else {
403 throw_toomany_arguments_nr("UConverter::getDestinationType", 0, 1);
405 } else {
406 throw_instance_method_fatal("UConverter::getDestinationType");
408 rv.m_data.num = 0LL;
409 rv._count = 0;
410 rv.m_type = KindOfNull;
411 frame_free_locals_inl(ar, 0);
412 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
413 return &ar->m_r;
414 return &ar->m_r;
418 HPHP::String HPHP::c_UConverter::t_getsubstchars()
419 _ZN4HPHP12c_UConverter15t_getsubstcharsEv
421 (return value) => rax
422 _rv => rdi
423 this_ => rsi
426 Value* th_10UConverter_getSubstChars(Value* _rv, ObjectData* this_) asm("_ZN4HPHP12c_UConverter15t_getsubstcharsEv");
428 TypedValue* tg_10UConverter_getSubstChars(HPHP::VM::ActRec *ar) {
429 TypedValue rv;
430 long long count = ar->numArgs();
431 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
432 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
433 if (this_) {
434 if (count == 0LL) {
435 rv._count = 0;
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));
441 return &ar->m_r;
442 } else {
443 throw_toomany_arguments_nr("UConverter::getSubstChars", 0, 1);
445 } else {
446 throw_instance_method_fatal("UConverter::getSubstChars");
448 rv.m_data.num = 0LL;
449 rv._count = 0;
450 rv.m_type = KindOfNull;
451 frame_free_locals_inl(ar, 0);
452 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
453 return &ar->m_r;
454 return &ar->m_r;
458 bool HPHP::c_UConverter::t_setsubstchars(HPHP::String const&)
459 _ZN4HPHP12c_UConverter15t_setsubstcharsERKNS_6StringE
461 (return value) => rax
462 this_ => rdi
463 chars => rsi
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;
471 rv->_count = 0;
472 rv->m_type = KindOfBoolean;
473 tvCastToStringInPlace(args-0);
474 rv->m_data.num = (th_10UConverter_setSubstChars((this_), (Value*)(args-0))) ? 1LL : 0LL;
475 return rv;
478 TypedValue* tg_10UConverter_setSubstChars(HPHP::VM::ActRec *ar) {
479 TypedValue rv;
480 long long count = ar->numArgs();
481 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
482 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
483 if (this_) {
484 if (count == 1LL) {
485 if (IS_STRING_TYPE((args-0)->m_type)) {
486 rv._count = 0;
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));
491 return &ar->m_r;
492 } else {
493 tg1_10UConverter_setSubstChars(&rv, ar, count , this_);
494 frame_free_locals_inl(ar, 1);
495 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
496 return &ar->m_r;
498 } else {
499 throw_wrong_arguments_nr("UConverter::setSubstChars", count, 1, 1, 1);
501 } else {
502 throw_instance_method_fatal("UConverter::setSubstChars");
504 rv.m_data.num = 0LL;
505 rv._count = 0;
506 rv.m_type = KindOfNull;
507 frame_free_locals_inl(ar, 1);
508 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
509 return &ar->m_r;
510 return &ar->m_r;
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
518 _rv => rdi
519 this_ => rsi
520 reason => rdx
521 source => rcx
522 codepoint => r8
523 error => r9
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;
542 return rv;
545 TypedValue* tg_10UConverter_fromUCallback(HPHP::VM::ActRec *ar) {
546 TypedValue rv;
547 long long count = ar->numArgs();
548 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
549 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
550 if (this_) {
551 if (count == 4LL) {
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));
557 return &ar->m_r;
558 } else {
559 tg1_10UConverter_fromUCallback(&rv, ar, count , this_);
560 frame_free_locals_inl(ar, 4);
561 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
562 return &ar->m_r;
564 } else {
565 throw_wrong_arguments_nr("UConverter::fromUCallback", count, 4, 4, 1);
567 } else {
568 throw_instance_method_fatal("UConverter::fromUCallback");
570 rv.m_data.num = 0LL;
571 rv._count = 0;
572 rv.m_type = KindOfNull;
573 frame_free_locals_inl(ar, 4);
574 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
575 return &ar->m_r;
576 return &ar->m_r;
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
584 _rv => rdi
585 this_ => rsi
586 reason => rdx
587 source => rcx
588 codeunits => r8
589 error => r9
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;
608 return rv;
611 TypedValue* tg_10UConverter_toUCallback(HPHP::VM::ActRec *ar) {
612 TypedValue rv;
613 long long count = ar->numArgs();
614 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
615 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
616 if (this_) {
617 if (count == 4LL) {
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));
623 return &ar->m_r;
624 } else {
625 tg1_10UConverter_toUCallback(&rv, ar, count , this_);
626 frame_free_locals_inl(ar, 4);
627 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
628 return &ar->m_r;
630 } else {
631 throw_wrong_arguments_nr("UConverter::toUCallback", count, 4, 4, 1);
633 } else {
634 throw_instance_method_fatal("UConverter::toUCallback");
636 rv.m_data.num = 0LL;
637 rv._count = 0;
638 rv.m_type = KindOfNull;
639 frame_free_locals_inl(ar, 4);
640 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
641 return &ar->m_r;
642 return &ar->m_r;
646 HPHP::Variant HPHP::c_UConverter::t_convert(HPHP::String const&, bool)
647 _ZN4HPHP12c_UConverter9t_convertERKNS_6StringEb
649 (return value) => rax
650 _rv => rdi
651 this_ => rsi
652 str => rdx
653 reverse => rcx
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;
661 switch (count) {
662 default: // count >= 2
663 if ((args-1)->m_type != KindOfBoolean) {
664 tvCastToBooleanInPlace(args-1);
666 case 1:
667 break;
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;
674 return rv;
677 TypedValue* tg_10UConverter_convert(HPHP::VM::ActRec *ar) {
678 TypedValue rv;
679 long long count = ar->numArgs();
680 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
681 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
682 if (this_) {
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));
689 return &ar->m_r;
690 } else {
691 tg1_10UConverter_convert(&rv, ar, count , this_);
692 frame_free_locals_inl(ar, 2);
693 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
694 return &ar->m_r;
696 } else {
697 throw_wrong_arguments_nr("UConverter::convert", count, 1, 2, 1);
699 } else {
700 throw_instance_method_fatal("UConverter::convert");
702 rv.m_data.num = 0LL;
703 rv._count = 0;
704 rv.m_type = KindOfNull;
705 frame_free_locals_inl(ar, 2);
706 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
707 return &ar->m_r;
708 return &ar->m_r;
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
716 _rv => rdi
717 cls_ => rsi
718 str => rdx
719 toEncoding => rcx
720 fromEncoding => r8
721 options => r9
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;
729 switch (count) {
730 default: // count >= 4
731 if ((args-3)->m_type != KindOfArray) {
732 tvCastToArrayInPlace(args-3);
734 case 3:
735 break;
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;
749 return rv;
752 TypedValue* tg_10UConverter_transcode(HPHP::VM::ActRec *ar) {
753 TypedValue rv;
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));
763 return &ar->m_r;
764 } else {
765 tg1_10UConverter_transcode(&rv, ar, count );
766 frame_free_locals_no_this_inl(ar, 4);
767 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
768 return &ar->m_r;
770 } else {
771 throw_wrong_arguments_nr("UConverter::transcode", count, 3, 4, 1);
773 rv.m_data.num = 0LL;
774 rv._count = 0;
775 rv.m_type = KindOfNull;
776 frame_free_locals_no_this_inl(ar, 4);
777 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
778 return &ar->m_r;
779 return &ar->m_r;
783 long long HPHP::c_UConverter::t_geterrorcode()
784 _ZN4HPHP12c_UConverter14t_geterrorcodeEv
786 (return value) => rax
787 this_ => rdi
790 long long th_10UConverter_getErrorCode(ObjectData* this_) asm("_ZN4HPHP12c_UConverter14t_geterrorcodeEv");
792 TypedValue* tg_10UConverter_getErrorCode(HPHP::VM::ActRec *ar) {
793 TypedValue rv;
794 long long count = ar->numArgs();
795 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
796 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
797 if (this_) {
798 if (count == 0LL) {
799 rv._count = 0;
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));
804 return &ar->m_r;
805 } else {
806 throw_toomany_arguments_nr("UConverter::getErrorCode", 0, 1);
808 } else {
809 throw_instance_method_fatal("UConverter::getErrorCode");
811 rv.m_data.num = 0LL;
812 rv._count = 0;
813 rv.m_type = KindOfNull;
814 frame_free_locals_inl(ar, 0);
815 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
816 return &ar->m_r;
817 return &ar->m_r;
821 HPHP::String HPHP::c_UConverter::t_geterrormessage()
822 _ZN4HPHP12c_UConverter17t_geterrormessageEv
824 (return value) => rax
825 _rv => rdi
826 this_ => rsi
829 Value* th_10UConverter_getErrorMessage(Value* _rv, ObjectData* this_) asm("_ZN4HPHP12c_UConverter17t_geterrormessageEv");
831 TypedValue* tg_10UConverter_getErrorMessage(HPHP::VM::ActRec *ar) {
832 TypedValue rv;
833 long long count = ar->numArgs();
834 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
835 ObjectData* this_ = (ar->hasThis() ? ar->getThis() : NULL);
836 if (this_) {
837 if (count == 0LL) {
838 rv._count = 0;
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));
844 return &ar->m_r;
845 } else {
846 throw_toomany_arguments_nr("UConverter::getErrorMessage", 0, 1);
848 } else {
849 throw_instance_method_fatal("UConverter::getErrorMessage");
851 rv.m_data.num = 0LL;
852 rv._count = 0;
853 rv.m_type = KindOfNull;
854 frame_free_locals_inl(ar, 0);
855 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
856 return &ar->m_r;
857 return &ar->m_r;
861 HPHP::String HPHP::c_UConverter::ti_reasontext(char const*, long long)
862 _ZN4HPHP12c_UConverter13ti_reasontextEPKcx
864 (return value) => rax
865 _rv => rdi
866 cls_ => rsi
867 reason => rdx
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;
875 rv->_count = 0;
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;
880 return rv;
883 TypedValue* tg_10UConverter_reasonText(HPHP::VM::ActRec *ar) {
884 TypedValue rv;
885 long long count = ar->numArgs();
886 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
887 if (count == 1LL) {
888 if ((args-0)->m_type == KindOfInt64) {
889 rv._count = 0;
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));
895 return &ar->m_r;
896 } else {
897 tg1_10UConverter_reasonText(&rv, ar, count );
898 frame_free_locals_no_this_inl(ar, 1);
899 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
900 return &ar->m_r;
902 } else {
903 throw_wrong_arguments_nr("UConverter::reasonText", count, 1, 1, 1);
905 rv.m_data.num = 0LL;
906 rv._count = 0;
907 rv.m_type = KindOfNull;
908 frame_free_locals_no_this_inl(ar, 1);
909 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
910 return &ar->m_r;
911 return &ar->m_r;
915 HPHP::Array HPHP::c_UConverter::ti_getavailable(char const*)
916 _ZN4HPHP12c_UConverter15ti_getavailableEPKc
918 (return value) => rax
919 _rv => rdi
920 cls_ => rsi
923 Value* th_10UConverter_getAvailable(Value* _rv, char const* cls_) asm("_ZN4HPHP12c_UConverter15ti_getavailableEPKc");
925 TypedValue* tg_10UConverter_getAvailable(HPHP::VM::ActRec *ar) {
926 TypedValue rv;
927 long long count = ar->numArgs();
928 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
929 if (count == 0LL) {
930 rv._count = 0;
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));
936 return &ar->m_r;
937 } else {
938 throw_toomany_arguments_nr("UConverter::getAvailable", 0, 1);
940 rv.m_data.num = 0LL;
941 rv._count = 0;
942 rv.m_type = KindOfNull;
943 frame_free_locals_no_this_inl(ar, 0);
944 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
945 return &ar->m_r;
946 return &ar->m_r;
950 HPHP::Array HPHP::c_UConverter::ti_getaliases(char const*, HPHP::String const&)
951 _ZN4HPHP12c_UConverter13ti_getaliasesEPKcRKNS_6StringE
953 (return value) => rax
954 _rv => rdi
955 cls_ => rsi
956 encoding => rdx
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;
964 rv->_count = 0;
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;
969 return rv;
972 TypedValue* tg_10UConverter_getAliases(HPHP::VM::ActRec *ar) {
973 TypedValue rv;
974 long long count = ar->numArgs();
975 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
976 if (count == 1LL) {
977 if (IS_STRING_TYPE((args-0)->m_type)) {
978 rv._count = 0;
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));
984 return &ar->m_r;
985 } else {
986 tg1_10UConverter_getAliases(&rv, ar, count );
987 frame_free_locals_no_this_inl(ar, 1);
988 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
989 return &ar->m_r;
991 } else {
992 throw_wrong_arguments_nr("UConverter::getAliases", count, 1, 1, 1);
994 rv.m_data.num = 0LL;
995 rv._count = 0;
996 rv.m_type = KindOfNull;
997 frame_free_locals_no_this_inl(ar, 1);
998 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
999 return &ar->m_r;
1000 return &ar->m_r;
1004 HPHP::Array HPHP::c_UConverter::ti_getstandards(char const*)
1005 _ZN4HPHP12c_UConverter15ti_getstandardsEPKc
1007 (return value) => rax
1008 _rv => rdi
1009 cls_ => rsi
1012 Value* th_10UConverter_getStandards(Value* _rv, char const* cls_) asm("_ZN4HPHP12c_UConverter15ti_getstandardsEPKc");
1014 TypedValue* tg_10UConverter_getStandards(HPHP::VM::ActRec *ar) {
1015 TypedValue rv;
1016 long long count = ar->numArgs();
1017 TypedValue* args UNUSED = ((TypedValue*)ar) - 1;
1018 if (count == 0LL) {
1019 rv._count = 0;
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));
1025 return &ar->m_r;
1026 } else {
1027 throw_toomany_arguments_nr("UConverter::getStandards", 0, 1);
1029 rv.m_data.num = 0LL;
1030 rv._count = 0;
1031 rv.m_type = KindOfNull;
1032 frame_free_locals_no_this_inl(ar, 0);
1033 memcpy(&ar->m_r, &rv, sizeof(TypedValue));
1034 return &ar->m_r;
1035 return &ar->m_r;
1039 } // !HPHP