1 /* Cycript - Optimizing JavaScript Compiler/Runtime
2 * Copyright (C) 2009-2010 Jay Freeman (saurik)
5 /* GNU Lesser General Public License, Version 3 {{{ */
7 * Cycript is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU Lesser General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
12 * Cycript is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with Cycript. If not, see <http://www.gnu.org/licenses/>.
23 #include "Replace.hpp"
27 CYExpression
*CYAdd::Replace(CYContext
&context
) {
28 CYInfix::Replace(context
);
30 CYExpression
*lhp(lhs_
->Primitive(context
));
31 CYExpression
*rhp(rhs_
->Primitive(context
));
33 CYString
*lhs(dynamic_cast<CYString
*>(lhp
));
34 CYString
*rhs(dynamic_cast<CYString
*>(rhp
));
36 if (lhs
!= NULL
|| rhs
!= NULL
) {
38 lhs
= lhp
->String(context
);
41 } else if (rhs
== NULL
) {
42 rhs
= rhp
->String(context
);
47 return lhs
->Concat(context
, rhs
);
50 if (CYNumber
*lhn
= lhp
->Number(context
))
51 if (CYNumber
*rhn
= rhp
->Number(context
))
52 return $
D(lhn
->Value() + rhn
->Value());
57 CYExpression
*CYAddressOf::Replace(CYContext
&context
) {
58 CYPrefix::Replace(context
);
59 return $
C0($
M(rhs_
, $
S("$cya")));
62 void CYArgument::Replace(CYContext
&context
) { $
T()
63 context
.Replace(value_
);
64 next_
->Replace(context
);
67 CYExpression
*CYArray::Replace(CYContext
&context
) {
68 elements_
->Replace(context
);
72 CYExpression
*CYArrayComprehension::Replace(CYContext
&context
) {
73 CYVariable
*cyv($
V("$cyv"));
75 return $
C0($
F(NULL
, $
P1("$cyv", comprehensions_
->Parameters(context
)), $$
->*
76 $
E($
CYAssign(cyv
, $
CYArray()))->*
77 comprehensions_
->Replace(context
, $
E($
C1($
M(cyv
, $
S("push")), expression_
)))->*
82 CYExpression
*CYAssignment::Replace(CYContext
&context
) {
83 context
.Replace(lhs_
);
84 context
.Replace(rhs_
);
88 CYStatement
*CYBlock::Replace(CYContext
&context
) {
89 context
.ReplaceAll(statements_
);
90 if (statements_
== NULL
)
95 CYStatement
*CYBreak::Replace(CYContext
&context
) {
99 CYExpression
*CYCall::AddArgument(CYContext
&context
, CYExpression
*value
) {
100 CYArgument
**argument(&arguments_
);
101 while (*argument
!= NULL
)
102 argument
= &(*argument
)->next_
;
103 *argument
= $
CYArgument(value
);
107 CYExpression
*CYCall::Replace(CYContext
&context
) {
108 context
.Replace(function_
);
109 arguments_
->Replace(context
);
116 void Catch::Replace(CYContext
&context
) { $
T()
117 CYScope
scope(CYScopeCatch
, context
, code_
.statements_
);
119 context
.Replace(name_
);
120 context
.scope_
->Declare(context
, name_
, CYIdentifierCatch
);
122 code_
.Replace(context
);
128 void CYClause::Replace(CYContext
&context
) { $
T()
129 context
.Replace(case_
);
130 context
.ReplaceAll(statements_
);
131 next_
->Replace(context
);
134 CYStatement
*CYComment::Replace(CYContext
&context
) {
138 CYExpression
*CYCompound::Replace(CYContext
&context
) {
139 context
.ReplaceAll(expressions_
);
140 if (expressions_
== NULL
)
145 CYFunctionParameter
*CYComprehension::Parameters(CYContext
&context
) const { $
T(NULL
)
146 CYFunctionParameter
*next(next_
->Parameters(context
));
147 if (CYFunctionParameter
*parameter
= Parameter(context
)) {
148 parameter
->SetNext(next
);
154 CYStatement
*CYComprehension::Replace(CYContext
&context
, CYStatement
*statement
) const {
155 return next_
== NULL
? statement
: next_
->Replace(context
, statement
);
158 CYExpression
*CYCondition::Replace(CYContext
&context
) {
159 context
.Replace(test_
);
160 context
.Replace(true_
);
161 context
.Replace(false_
);
165 void CYContext::NonLocal(CYStatement
*&statements
) {
166 CYContext
&context(*this);
168 if (nextlocal_
!= NULL
&& nextlocal_
->identifier_
!= NULL
) {
169 CYIdentifier
*cye($
I("$cye")->Replace(context
));
170 CYIdentifier
*unique(nextlocal_
->identifier_
->Replace(context
));
172 CYStatement
*declare(
173 $
CYVar($
L1($
L(unique
, $
CYObject()))));
175 cy::Syntax::Catch
*rescue(
176 $
cy::Syntax::Catch(cye
, $$
->*
177 $
CYIf($
CYIdentical($
M($
V(cye
), $
S("$cyk")), $
V(unique
)), $$
->*
178 $
CYReturn($
M($
V(cye
), $
S("$cyv"))))->*
179 $
cy::Syntax::Throw($
V(cye
))));
181 context
.Replace(declare
);
182 rescue
->Replace(context
);
186 $
cy::Syntax::Try(statements
, rescue
, NULL
);
190 CYIdentifier
*CYContext::Unique() {
191 return $
CYIdentifier(apr_psprintf($pool
, "$cy%u", unique_
++));
194 CYStatement
*CYContinue::Replace(CYContext
&context
) {
198 CYAssignment
*CYDeclaration::Assignment(CYContext
&context
) {
199 CYExpression
*variable(Replace(context
));
200 return initialiser_
== NULL
? NULL
: $
CYAssign(variable
, initialiser_
);
203 CYStatement
*CYDeclaration::ForEachIn(CYContext
&context
, CYExpression
*value
) {
204 return $
CYVar($
L1($
L(identifier_
, value
)));
207 CYExpression
*CYDeclaration::Replace(CYContext
&context
) {
208 context
.Replace(identifier_
);
209 context
.scope_
->Declare(context
, identifier_
, CYIdentifierVariable
);
210 return $
V(identifier_
);
213 CYProperty
*CYDeclarations::Property(CYContext
&context
) { $
T(NULL
)
214 return $
CYProperty(declaration_
->identifier_
, declaration_
->initialiser_
?: $U
, next_
->Property(context
));
217 CYCompound
*CYDeclarations::Replace(CYContext
&context
) {
218 CYCompound
*compound(next_
== NULL
? $
CYCompound() : next_
->Replace(context
));
219 if (CYAssignment
*assignment
= declaration_
->Assignment(context
))
220 compound
->AddPrev(assignment
);
224 CYExpression
*CYDirectMember::Replace(CYContext
&context
) {
229 CYStatement
*CYDoWhile::Replace(CYContext
&context
) {
230 context
.Replace(test_
);
231 context
.Replace(code_
);
235 void CYElement::Replace(CYContext
&context
) { $
T()
236 context
.Replace(value_
);
237 next_
->Replace(context
);
240 CYStatement
*CYEmpty::Replace(CYContext
&context
) {
244 CYStatement
*CYExpress::Replace(CYContext
&context
) {
245 while (CYExpress
*express
= dynamic_cast<CYExpress
*>(next_
)) {
246 CYCompound
*compound(dynamic_cast<CYCompound
*>(express
->expression_
));
247 if (compound
== NULL
)
248 compound
= $
CYCompound(express
->expression_
);
249 compound
->AddPrev(expression_
);
250 expression_
= compound
;
251 SetNext(express
->next_
);
254 context
.Replace(expression_
);
255 if (expression_
== NULL
)
261 CYExpression
*CYExpression::AddArgument(CYContext
&context
, CYExpression
*value
) {
262 return $
C1(this, value
);
265 CYExpression
*CYExpression::ClassName(CYContext
&context
, bool object
) {
269 CYStatement
*CYExpression::ForEachIn(CYContext
&context
, CYExpression
*value
) {
270 return $
E($
CYAssign(this, value
));
273 CYNumber
*CYFalse::Number(CYContext
&context
) {
277 CYString
*CYFalse::String(CYContext
&context
) {
281 void CYFinally::Replace(CYContext
&context
) { $
T()
282 code_
.Replace(context
);
285 CYStatement
*CYFor::Replace(CYContext
&context
) {
286 context
.Replace(initialiser_
);
287 context
.Replace(test_
);
288 context
.Replace(increment_
);
289 context
.Replace(code_
);
293 CYStatement
*CYForIn::Replace(CYContext
&context
) {
294 // XXX: this actually might need a prefix statement
295 context
.Replace(initialiser_
);
296 context
.Replace(set_
);
297 context
.Replace(code_
);
301 CYFunctionParameter
*CYForInComprehension::Parameter(CYContext
&context
) const {
302 return $
CYFunctionParameter(name_
);
305 CYStatement
*CYForInComprehension::Replace(CYContext
&context
, CYStatement
*statement
) const {
306 return $
CYForIn($
V(name_
), set_
, CYComprehension::Replace(context
, statement
));
309 CYStatement
*CYForEachIn::Replace(CYContext
&context
) {
310 CYIdentifier
*cys($
I("$cys")), *cyt($
I("$cyt"));
312 return $
CYLet($
L2($
L(cys
, set_
), $
L(cyt
)), $$
->*
313 $
CYForIn($
V(cyt
), $
V(cys
), $
CYBlock($$
->*
314 initialiser_
->ForEachIn(context
, $
M($
V(cys
), $
V(cyt
)))->*
320 CYFunctionParameter
*CYForEachInComprehension::Parameter(CYContext
&context
) const {
321 return $
CYFunctionParameter(name_
);
324 CYStatement
*CYForEachInComprehension::Replace(CYContext
&context
, CYStatement
*statement
) const {
325 CYIdentifier
*cys($
I("cys"));
327 return $
E($
C0($
F(NULL
, $
P1("$cys"), $$
->*
328 $
E($
CYAssign($
V(cys
), set_
))->*
329 $
CYForIn($
V(name_
), $
V(cys
), $
CYBlock($$
->*
330 $
E($
CYAssign($
V(name_
), $
M($
V(cys
), $
V(name_
))))->*
331 CYComprehension::Replace(context
, statement
)
336 void CYFunction::Inject(CYContext
&context
) {
337 context
.Replace(name_
);
338 context
.scope_
->Declare(context
, name_
, CYIdentifierOther
);
341 void CYFunction::Replace_(CYContext
&context
, bool outer
) {
345 CYScope
scope(CYScopeFunction
, context
, code_
.statements_
);
347 CYNonLocal
*nonlocal(context
.nonlocal_
);
348 CYNonLocal
*nextlocal(context
.nextlocal_
);
351 if (nonlocal_
!= NULL
) {
353 context
.nonlocal_
= nonlocal_
;
356 nonlocal_
= $
CYNonLocal();
357 context
.nextlocal_
= nonlocal_
;
360 if (!outer
&& name_
!= NULL
)
363 if (parameters_
!= NULL
)
364 parameters_
= parameters_
->Replace(context
, code_
);
366 code_
.Replace(context
);
369 context
.NonLocal(code_
.statements_
);
371 context
.nextlocal_
= nextlocal
;
372 context
.nonlocal_
= nonlocal
;
377 CYExpression
*CYFunctionExpression::Replace(CYContext
&context
) {
378 Replace_(context
, false);
382 CYFunctionParameter
*CYFunctionParameter::Replace(CYContext
&context
, CYBlock
&code
) {
383 context
.Replace(name_
);
384 context
.scope_
->Declare(context
, name_
, CYIdentifierArgument
);
386 next_
= next_
->Replace(context
, code
);
390 CYStatement
*CYFunctionStatement::Replace(CYContext
&context
) {
391 Replace_(context
, true);
395 CYIdentifier
*CYIdentifier::Replace(CYContext
&context
) {
396 if (replace_
!= NULL
&& replace_
!= this)
397 return replace_
->Replace(context
);
398 replace_
= context
.scope_
->Lookup(context
, this);
402 CYStatement
*CYIf::Replace(CYContext
&context
) {
403 context
.Replace(test_
);
404 context
.Replace(true_
);
405 context
.Replace(false_
);
409 CYFunctionParameter
*CYIfComprehension::Parameter(CYContext
&context
) const {
413 CYStatement
*CYIfComprehension::Replace(CYContext
&context
, CYStatement
*statement
) const {
414 return $
CYIf(test_
, CYComprehension::Replace(context
, statement
));
417 CYExpression
*CYIndirect::Replace(CYContext
&context
) {
418 CYPrefix::Replace(context
);
419 return $
M(rhs_
, $
S("$cyi"));
422 CYExpression
*CYIndirectMember::Replace(CYContext
&context
) {
424 return $
M($
CYIndirect(object_
), property_
);
427 CYExpression
*CYInfix::Replace(CYContext
&context
) {
428 context
.Replace(lhs_
);
429 context
.Replace(rhs_
);
433 CYStatement
*CYLabel::Replace(CYContext
&context
) {
434 context
.Replace(statement_
);
438 CYStatement
*CYLet::Replace(CYContext
&context
) {
439 return $
CYWith($
CYObject(declarations_
->Property(context
)), &code_
);
442 void CYMember::Replace_(CYContext
&context
) {
443 context
.Replace(object_
);
444 context
.Replace(property_
);
450 CYExpression
*New::AddArgument(CYContext
&context
, CYExpression
*value
) {
451 CYSetLast(arguments_
, $
CYArgument(value
));
455 CYExpression
*New::Replace(CYContext
&context
) {
456 context
.Replace(constructor_
);
457 arguments_
->Replace(context
);
463 CYNumber
*CYNull::Number(CYContext
&context
) {
467 CYString
*CYNull::String(CYContext
&context
) {
471 CYNumber
*CYNumber::Number(CYContext
&context
) {
475 CYString
*CYNumber::String(CYContext
&context
) {
476 // XXX: there is a precise algorithm for this
477 return $
S(apr_psprintf($pool
, "%.17g", Value()));
480 CYExpression
*CYObject::Replace(CYContext
&context
) {
481 properties_
->Replace(context
);
485 CYFunctionParameter
*CYOptionalFunctionParameter::Replace(CYContext
&context
, CYBlock
&code
) {
486 CYFunctionParameter
*parameter($
CYFunctionParameter(name_
, next_
));
487 parameter
= parameter
->Replace(context
, code
);
488 context
.Replace(initializer_
);
490 CYVariable
*name($
V(name_
));
491 code
.AddPrev($
CYIf($
CYIdentical($
CYTypeOf(name
), $
S("undefined")), $$
->*
492 $
E($
CYAssign(name
, initializer_
))
498 CYExpression
*CYPostfix::Replace(CYContext
&context
) {
499 context
.Replace(lhs_
);
503 CYExpression
*CYPrefix::Replace(CYContext
&context
) {
504 context
.Replace(rhs_
);
508 // XXX: this is evil evil black magic. don't ask, don't tell... don't believe!
509 #define MappingSet "0etnirsoalfucdphmgyvbxTwSNECAFjDLkMOIBPqzRH$_WXUVGYKQJZ"
510 //#define MappingSet "0abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"
513 struct IdentifierUsageLess
:
514 std::binary_function
<CYIdentifier
*, CYIdentifier
*, bool>
516 _finline
bool operator ()(CYIdentifier
*lhs
, CYIdentifier
*rhs
) const {
517 if (lhs
->usage_
!= rhs
->usage_
)
518 return lhs
->usage_
> rhs
->usage_
;
523 typedef std::set
<CYIdentifier
*, IdentifierUsageLess
> IdentifierUsages
;
526 void CYProgram::Replace(CYContext
&context
) {
527 CYScope
scope(CYScopeProgram
, context
, statements_
);
529 context
.nextlocal_
= $
CYNonLocal();
530 context
.ReplaceAll(statements_
);
531 context
.NonLocal(statements_
);
537 CYCStringSet external
;
538 for (CYIdentifierValueSet::const_iterator
i(scope
.identifiers_
.begin()); i
!= scope
.identifiers_
.end(); ++i
)
539 external
.insert((*i
)->Word());
541 IdentifierUsages usages
;
543 if (offset
< context
.rename_
.size())
544 CYForEach (i
, context
.rename_
[offset
].identifier_
)
547 // XXX: totalling the probable occurrences and sorting by them would improve the result
548 for (CYIdentifierUsageVector::const_iterator
i(context
.rename_
.begin()); i
!= context
.rename_
.end(); ++i
, ++offset
) {
549 //std::cout << *i << ":" << (*i)->offset_ << std::endl;
553 if (context
.options_
.verbose_
)
554 name
= apr_psprintf($pool
, "$%"APR_SIZE_T_FMT
"", offset
);
560 unsigned position(7), local(offset
+ 1);
563 unsigned index(local
% (sizeof(MappingSet
) - 1));
564 local
/= sizeof(MappingSet
) - 1;
565 id
[--position
] = MappingSet
[index
];
566 } while (local
!= 0);
568 if (external
.find(id
+ position
) != external
.end()) {
573 name
= apr_pstrmemdup($pool
, id
+ position
, 7 - position
);
574 // XXX: at some point, this could become a keyword
577 CYForEach (identifier
, i
->identifier_
)
578 identifier
->Set(name
);
582 void CYProperty::Replace(CYContext
&context
) { $
T()
583 context
.Replace(value_
);
584 next_
->Replace(context
);
587 CYStatement
*CYReturn::Replace(CYContext
&context
) {
588 if (context
.nonlocal_
!= NULL
) {
589 CYProperty
*value(value_
== NULL
? NULL
: $
CYProperty($
S("$cyv"), value_
));
590 return $
cy::Syntax::Throw($
CYObject(
591 $
CYProperty($
S("$cyk"), $
V(context
.nonlocal_
->Target(context
)), value
)
595 context
.Replace(value_
);
599 CYExpression
*CYRubyBlock::Replace(CYContext
&context
) {
600 // XXX: this needs to do something much more epic to handle return
601 return call_
->AddArgument(context
, proc_
->Replace(context
));
604 CYExpression
*CYRubyProc::Replace(CYContext
&context
) {
605 CYFunctionExpression
*function($
CYFunctionExpression(NULL
, parameters_
, code_
));
606 function
->nonlocal_
= context
.nextlocal_
;
610 CYScope::CYScope(CYScopeType type
, CYContext
&context
, CYStatement
*&statements
) :
613 statements_(statements
),
614 parent_(context
.scope_
)
616 context_
.scope_
= this;
619 CYScope::~CYScope() {
622 void CYScope::Close() {
623 context_
.scope_
= parent_
;
624 Scope(context_
, statements_
);
627 void CYScope::Declare(CYContext
&context
, CYIdentifier
*identifier
, CYIdentifierFlags flags
) {
628 if (type_
== CYScopeCatch
&& flags
!= CYIdentifierCatch
)
629 parent_
->Declare(context
, identifier
, flags
);
631 internal_
.insert(CYIdentifierAddressFlagsMap::value_type(identifier
, flags
));
634 CYIdentifier
*CYScope::Lookup(CYContext
&context
, CYIdentifier
*identifier
) {
635 std::pair
<CYIdentifierValueSet::iterator
, bool> insert(identifiers_
.insert(identifier
));
636 return *insert
.first
;
639 void CYScope::Merge(CYContext
&context
, CYIdentifier
*identifier
) {
640 std::pair
<CYIdentifierValueSet::iterator
, bool> insert(identifiers_
.insert(identifier
));
641 if (!insert
.second
) {
642 if ((*insert
.first
)->offset_
< identifier
->offset_
)
643 (*insert
.first
)->offset_
= identifier
->offset_
;
644 identifier
->replace_
= *insert
.first
;
645 (*insert
.first
)->usage_
+= identifier
->usage_
+ 1;
650 struct IdentifierOffset
{
652 CYIdentifierFlags flags_
;
654 CYIdentifier
*identifier_
;
656 IdentifierOffset(CYIdentifier
*identifier
, CYIdentifierFlags flags
) :
657 offset_(identifier
->offset_
),
659 usage_(identifier
->usage_
),
660 identifier_(identifier
)
665 struct IdentifierOffsetLess
:
666 std::binary_function
<const IdentifierOffset
&, const IdentifierOffset
&, bool>
668 _finline
bool operator ()(const IdentifierOffset
&lhs
, const IdentifierOffset
&rhs
) const {
669 if (lhs
.offset_
!= rhs
.offset_
)
670 return lhs
.offset_
< rhs
.offset_
;
671 if (lhs
.flags_
!= rhs
.flags_
)
672 return lhs
.flags_
< rhs
.flags_
;
673 /*if (lhs.usage_ != rhs.usage_)
674 return lhs.usage_ < rhs.usage_;*/
675 return lhs
.identifier_
< rhs
.identifier_
;
679 typedef std::set
<IdentifierOffset
, IdentifierOffsetLess
> IdentifierOffsets
;
682 void CYScope::Scope(CYContext
&context
, CYStatement
*&statements
) {
686 CYDeclarations
*last(NULL
), *curr(NULL
);
688 IdentifierOffsets offsets
;
690 for (CYIdentifierAddressFlagsMap::const_iterator
i(internal_
.begin()); i
!= internal_
.end(); ++i
)
691 if (i
->second
!= CYIdentifierMagic
)
692 offsets
.insert(IdentifierOffset(i
->first
, i
->second
));
696 for (IdentifierOffsets::const_iterator
i(offsets
.begin()); i
!= offsets
.end(); ++i
) {
697 if (i
->flags_
== CYIdentifierVariable
) {
698 CYDeclarations
*next($
CYDeclarations($
CYDeclaration(i
->identifier_
)));
706 if (offset
< i
->offset_
)
708 if (context
.rename_
.size() <= offset
)
709 context
.rename_
.resize(offset
+ 1);
711 CYIdentifierUsage
&rename(context
.rename_
[offset
++]);
712 i
->identifier_
->SetNext(rename
.identifier_
);
713 rename
.identifier_
= i
->identifier_
;
714 rename
.usage_
+= i
->identifier_
->usage_
+ 1;
718 CYVar
*var($
CYVar(last
));
719 var
->SetNext(statements
);
723 for (CYIdentifierValueSet::const_iterator
i(identifiers_
.begin()); i
!= identifiers_
.end(); ++i
)
724 if (internal_
.find(*i
) == internal_
.end()) {
725 //std::cout << *i << '=' << offset << std::endl;
726 if ((*i
)->offset_
< offset
)
727 (*i
)->offset_
= offset
;
728 parent_
->Merge(context
, *i
);
732 CYString
*CYString::Concat(CYContext
&context
, CYString
*rhs
) const {
733 size_t size(size_
+ rhs
->size_
);
734 char *value($
char[size
+ 1]);
735 memcpy(value
, value_
, size_
);
736 memcpy(value
+ size_
, rhs
->value_
, rhs
->size_
);
738 return $
S(value
, size
);
741 CYNumber
*CYString::Number(CYContext
&context
) {
742 // XXX: there is a precise algorithm for this
746 CYString
*CYString::String(CYContext
&context
) {
750 CYStatement
*CYSwitch::Replace(CYContext
&context
) {
751 context
.Replace(value_
);
752 clauses_
->Replace(context
);
756 CYExpression
*CYThis::Replace(CYContext
&context
) {
763 CYStatement
*Throw::Replace(CYContext
&context
) {
764 context
.Replace(value_
);
770 CYExpression
*CYTrivial::Replace(CYContext
&context
) {
774 CYNumber
*CYTrue::Number(CYContext
&context
) {
778 CYString
*CYTrue::String(CYContext
&context
) {
785 CYStatement
*Try::Replace(CYContext
&context
) {
786 code_
.Replace(context
);
787 catch_
->Replace(context
);
788 finally_
->Replace(context
);
794 CYStatement
*CYVar::Replace(CYContext
&context
) {
795 return $
E(declarations_
->Replace(context
));
798 CYExpression
*CYVariable::Replace(CYContext
&context
) {
799 context
.Replace(name_
);
803 CYStatement
*CYWhile::Replace(CYContext
&context
) {
804 context
.Replace(test_
);
805 context
.Replace(code_
);
809 CYStatement
*CYWith::Replace(CYContext
&context
) {
810 context
.Replace(scope_
);
811 context
.Replace(code_
);
815 CYExpression
*CYWord::ClassName(CYContext
&context
, bool object
) {
816 CYString
*name($
S(this));
818 return $
C1($
V("objc_getClass"), name
);