Skip to content

Instantly share code, notes, and snippets.

@fijal
Created June 13, 2012 16:30
Show Gist options
  • Save fijal/2925109 to your computer and use it in GitHub Desktop.
Save fijal/2925109 to your computer and use it in GitHub Desktop.
diff --git a/src/runtime/vm/translator/translator-x64.cpp b/src/runtime/vm/translator/translator-x64.cpp
index 5c2f977..6ad6307 100644
--- a/src/runtime/vm/translator/translator-x64.cpp
+++ b/src/runtime/vm/translator/translator-x64.cpp
@@ -5046,14 +5046,14 @@ TranslatorX64::translateDefCns(const Tracelet& t,
const NormalizedInstruction& i) {
StringData* name = curUnit()->lookupLitstrId(i.imm[0].u_SA);
- if (false) {
+ /*if (false) {
TargetCache::CacheHandle ch;
size_t bit = 0;
Variant *inout = 0;
StringData *name = 0;
defCnsHelper<true>(ch, inout, name, bit);
defCnsHelper<false>(ch, inout, name, bit);
- }
+ } nonsense */
using namespace TargetCache;
CacheHandle ch = allocConstant(name);
@@ -5061,10 +5061,10 @@ TranslatorX64::translateDefCns(const Tracelet& t,
m_regMap.cleanLoc(i.inputs[0]->location);
if (RuntimeOption::RepoAuthoritative) {
- EMIT_CALL3(a, defCnsHelper<false>, IMM(ch), A(i.inputs[0]->location),
+ EMIT_CALL3(a, (void(*)(TargetCache::CacheHandle,Variant*,StringData*,size_t))defCnsHelper<false>, IMM(ch), A(i.inputs[0]->location),
IMM((uint64)name));
} else {
- EMIT_CALL4(a, defCnsHelper<true>, IMM(ch), A(i.inputs[0]->location),
+ EMIT_CALL4(a, (void(*)(TargetCache::CacheHandle,Variant*,StringData*,size_t))defCnsHelper<true>, IMM(ch), A(i.inputs[0]->location),
IMM((uint64)name), IMM(allocCnsBit(name)));
}
recordInstrCall(i);
@@ -5838,14 +5838,14 @@ TranslatorX64::emitStringToKnownClass(const NormalizedInstruction& i,
UnlikelyIfBlock<CC_Z> ifNull(a, astubs);
ScratchReg clsPtr(m_regMap);
astubs. lea_reg64_disp_reg64(rVmTl, ch, *clsPtr);
- if (false) { // typecheck
+ /*if (false) { // typecheck
Class** cache = NULL;
UNUSED Class* ret =
TargetCache::lookupKnownClass<false>(cache, clsName, true);
- }
+ } nonsense */
// We're only passing two arguments to lookupKnownClass because
// the third is ignored in the checkOnly == false case
- EMIT_CALL2(astubs, TargetCache::lookupKnownClass<false>,
+ EMIT_CALL2(astubs, (Class*(*)(Class**,const StringData*,bool))TargetCache::lookupKnownClass<false>,
R(*clsPtr), IMM((uintptr_t)clsName));
recordInstrStubCall(i);
// UnlikelyIfBlock will restore cls's SCRATCH state but not its
@@ -6577,16 +6577,16 @@ void TranslatorX64::translateClassExistsImpl(const Tracelet& t,
a. test_reg64_reg64(*scratch, *scratch);
if (autoload) {
UnlikelyIfBlock<CC_Z> ifNull(a, astubs, &astubsRet);
- if (false) {
+ /*if (false) {
Class** c = NULL;
UNUSED Class* ret = lookupKnownClass<true>(c, name, false);
- }
+ } nonsense */
Stats::emitInc(astubs, Stats::TgtCache_ClassExistsMiss);
// If the class exists after autoloading, the helper will
// return the Class's flags. Otherwise, it will return a set
// of flags such that our flag check at the join point below
// will fail.
- EMIT_CALL3(astubs, lookupKnownClass<true>,
+ EMIT_CALL3(astubs, (Class*(*)(Class**,const StringData*,bool))lookupKnownClass<true>,
RPLUS(rVmTl, ch),
IMM((uintptr_t)name),
IMM(isClass));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment