Selaa lähdekoodia

checkpoint: unittests no crash in in-proc JIT, OOP jit has couple crashes on perfhint and module lowerer code

Lei Shi 9 vuotta sitten
vanhempi
sitoutus
b05899900b

+ 1 - 1
lib/Backend/Func.cpp

@@ -1765,7 +1765,7 @@ Func::AllocateNumber(double value)
 {
     Js::Var number = nullptr;
 #if FLOATVAR
-    number = Js::JavascriptNumber::NewCodeGenInstance(GetNumberAllocator(), (double)value, GetScriptContext());
+    number = Js::JavascriptNumber::NewCodeGenInstance(GetNumberAllocator(), (double)value, nullptr);
 #else
     if (!IsOOPJIT()) // in-proc jit
     {

+ 4 - 1
lib/Backend/Func.h

@@ -347,7 +347,10 @@ static const unsigned __int64 c_debugFillPattern8 = 0xcececececececece;
 
     intptr_t GetWeakFuncRef() const;
     // TODO: OOP JIT, remove this
-    Js::FunctionBody * GetJnFunction() const { Assert(UNREACHED);  return m_jnFunction; }
+    Js::FunctionBody * GetJnFunction() const 
+    {
+        return GetInProcJITEntryPointInfo()->GetFunctionBody(); 
+    }
 
     const FunctionJITRuntimeInfo * GetRuntimeInfo() const { return m_runtimeInfo; }
 

+ 1 - 1
lib/Backend/GlobOpt.cpp

@@ -21356,7 +21356,7 @@ GlobOpt::EmitMemop(Loop * loop, LoopCount *loopCount, const MemOpEmitData* emitD
         }
         else
         {
-            src1 = IR::AddrOpnd::New(candidate->constant.ToVar(localFunc, func->GetScriptContext()), IR::AddrOpndKindConstant, localFunc);
+            src1 = IR::AddrOpnd::New(candidate->constant.ToVar(localFunc), IR::AddrOpndKindConstant, localFunc);
         }
     }
     else

+ 3 - 3
lib/Backend/InlineeFrameInfo.cpp

@@ -32,7 +32,7 @@ void BailoutConstantValue::InitVarConstValue(Js::Var value)
     this->u.varConst.value = value;
 }
 
-Js::Var BailoutConstantValue::ToVar(Func* func, Js::ScriptContext* scriptContext) const
+Js::Var BailoutConstantValue::ToVar(Func* func) const
 {
     Assert(this->type == TyVar || this->type == TyFloat64 || IRType_IsSignedInt(this->type));
     Js::Var varValue;
@@ -131,7 +131,7 @@ void InlineeFrameInfo::AllocateRecord(Func* func, intptr_t functionBodyAddr)
         {
             // Constants
             Assert(constantIndex < constantCount);
-            this->record->constants[constantIndex] = value.constValue.ToVar(func, func->GetScriptContext());
+            this->record->constants[constantIndex] = value.constValue.ToVar(func);
             this->record->argOffsets[i] = constantIndex;
             constantIndex++;
         }
@@ -153,7 +153,7 @@ void InlineeFrameInfo::AllocateRecord(Func* func, intptr_t functionBodyAddr)
     else
     {
         Assert(constantIndex < constantCount);
-        this->record->constants[constantIndex] = function.constValue.ToVar(func, func->GetScriptContext());
+        this->record->constants[constantIndex] = function.constValue.ToVar(func);
         this->record->functionOffset = constantIndex;
     }
 }

+ 1 - 1
lib/Backend/InlineeFrameInfo.h

@@ -32,7 +32,7 @@ public:
             FloatConstType value;
         } floatConst;
     } u;
-    Js::Var ToVar(Func* func, Js::ScriptContext* scriptContext) const;
+    Js::Var ToVar(Func* func) const;
 };
 
 enum InlineeFrameInfoValueType

+ 2 - 2
lib/Backend/LinearScan.cpp

@@ -1420,7 +1420,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
         Assert(!byteCodeUpwardExposedUsed->Test(stackSym->m_id));
 
         BailoutConstantValue constValue = value.Value();
-        Js::Var varValue = constValue.ToVar(this->func, stackSymFunc->GetScriptContext());
+        Js::Var varValue = constValue.ToVar(this->func);
 
         state.constantList.Prepend(varValue);
         AssertMsg(funcBailOutData[index].localOffsets[i] == 0, "Can't have two active lifetime for the same byte code register");
@@ -1818,7 +1818,7 @@ LinearScan::FillBailOutRecord(IR::Instr * instr)
                     {
                         if (constantValue.Key()->m_id == sym->m_id)
                         {
-                            Js::Var varValue = constantValue.Value().ToVar(func, currentStartCallFunc->GetScriptContext());
+                            Js::Var varValue = constantValue.Value().ToVar(func);
                             state.constantList.Prepend(varValue);
                             outParamOffsets[outParamOffsetIndex] = state.constantList.Count() + GetBailOutRegisterSaveSlotCount() + GetBailOutReserveSlotCount();
 

+ 1 - 1
lib/Backend/Opnd.cpp

@@ -3445,7 +3445,7 @@ Opnd::GetAddrDescription(__out_ecount(count) char16 *const description, const si
                 WriteToBuffer(&buffer, &n, _u(" (&StackLimit)"));
             }
             else if (func->CanAllocInPreReservedHeapPageSegment() &&
-                func->GetScriptContext()->GetThreadContext()->GetPreReservedVirtualAllocator()->IsPreReservedEndAddress(address))
+                func->GetThreadContextInfo()->GetPreReservedVirtualAllocator()->IsPreReservedEndAddress(address))
             {
                 WriteToBuffer(&buffer, &n, _u(" (PreReservedCodeSegmentEnd)"));
             }

+ 3 - 3
lib/Runtime/Base/ScriptContextOptimizationOverrideInfo.cpp

@@ -208,19 +208,19 @@ ScriptContextOptimizationOverrideInfo::DisableArraySetElementFastPath()
 INT_PTR
 ScriptContextOptimizationOverrideInfo::GetArraySetElementFastPathVtable() const
 {
-    return arraySetElementFastPathVtable;
+    return (INT_PTR)&arraySetElementFastPathVtable;
 }
 
 INT_PTR
 ScriptContextOptimizationOverrideInfo::GetIntArraySetElementFastPathVtable() const
 {
-    return intArraySetElementFastPathVtable;
+    return (INT_PTR)&intArraySetElementFastPathVtable;
 }
 
 INT_PTR
 ScriptContextOptimizationOverrideInfo::GetFloatArraySetElementFastPathVtable() const
 {
-    return floatArraySetElementFastPathVtable;
+    return (INT_PTR)&floatArraySetElementFastPathVtable;
 }
 
 void *