Etienne BAUDOUX 8 年 前
コミット
8fc5330ef2

+ 5 - 0
lib/Backend/FunctionJITTimeInfo.cpp

@@ -176,6 +176,11 @@ FunctionJITTimeInfo::HasSharedPropertyGuard(Js::PropertyId id) const
     return false;
 }
 
+bool FunctionJITTimeInfo::IsJsBuiltInForceInline() const
+{
+    return this->GetBody()->GetSourceContextId() == Js::Constants::JsBuiltInSourceContextId;
+}
+
 intptr_t
 FunctionJITTimeInfo::GetFunctionInfoAddr() const
 {

+ 1 - 0
lib/Backend/FunctionJITTimeInfo.h

@@ -44,6 +44,7 @@ public:
     bool ForceJITLoopBody() const;
     bool HasSharedPropertyGuards() const;
     bool HasSharedPropertyGuard(Js::PropertyId id) const;
+    bool IsJsBuiltInForceInline() const;
 
     char16* GetDisplayName() const;
     char16* GetDebugNumberSet(wchar(&bufferToWriteTo)[MAX_FUNCTION_BODY_DEBUG_STRING_SIZE]) const;

+ 1 - 1
lib/Backend/InliningDecider.cpp

@@ -879,7 +879,7 @@ bool InliningDecider::ContinueInliningUserDefinedFunctions(uint32 bytecodeInline
 #if ENABLE_DEBUG_CONFIG_OPTIONS
     char16 debugStringBuffer[MAX_FUNCTION_BODY_DEBUG_STRING_SIZE];
 #endif
-    if (PHASE_FORCE(Js::InlinePhase, this->topFunc) || this->topFunc->IsJsBuiltInCode() || bytecodeInlinedCount <= (uint)this->threshold.inlineCountMax)
+    if (PHASE_FORCE(Js::InlinePhase, this->topFunc) || bytecodeInlinedCount <= (uint)this->threshold.inlineCountMax)
     {
         return true;
     }

+ 1 - 1
lib/Backend/InliningHeuristics.cpp

@@ -114,7 +114,7 @@ bool InliningHeuristics::BackendInlineIntoInliner(const FunctionJITTimeInfo * in
         return false;
     }
 
-    if(inlinee->GetBody()->GetSourceContextId() == Js::Constants::JsBuiltInSourceContextId ||
+    if(inlinee->IsJsBuiltInForceInline() ||
         PHASE_FORCE(Js::InlinePhase, this->topFunc) ||
         PHASE_FORCE(Js::InlinePhase, inliner) ||
         PHASE_FORCE(Js::InlinePhase, inlinee))

+ 1 - 6
lib/Runtime/Library/JsBuiltInEngineInterfaceExtensionObject.cpp

@@ -243,17 +243,12 @@ namespace Js
         Assert(JavascriptString::Is(classNameProperty));
         Assert(JavascriptString::Is(methodNameProperty));
         Assert(TaggedInt::Is(argumentsCountProperty));
-        Assert(JavascriptOperators::IsUndefinedOrNull(forceInlineProperty) || JavascriptBoolean::Is(forceInlineProperty));
 
         JavascriptString* className = JavascriptString::FromVar(classNameProperty);
         JavascriptString* methodName = JavascriptString::FromVar(methodNameProperty);
         int argumentsCount = TaggedInt::ToInt32(argumentsCountProperty);
 
-        BOOL forceInline = false;
-        if (!JavascriptOperators::IsUndefinedOrNull(forceInlineProperty))
-        {
-            forceInline = JavascriptBoolean::FromVar(forceInlineProperty)->GetValue();
-        }
+        BOOL forceInline = JavascriptConversion::ToBoolean(forceInlineProperty, scriptContext);
 
         JavascriptFunction* func = JavascriptFunction::FromVar(args.Values[2]);