Просмотр исходного кода

Allow getter functions to be inlined across source files.

Seth Brenith 8 лет назад
Родитель
Сommit
33eaa49a67
2 измененных файлов с 4 добавлено и 12 удалено
  1. 1 9
      lib/Runtime/Base/FunctionBody.cpp
  2. 3 3
      lib/Runtime/Language/DynamicProfileInfo.cpp

+ 1 - 9
lib/Runtime/Base/FunctionBody.cpp

@@ -7514,15 +7514,7 @@ namespace Js
 
     bool FunctionBody::CheckCalleeContextForInlining(FunctionProxy* calleeFunctionProxy)
     {
-        if (this->GetScriptContext() == calleeFunctionProxy->GetScriptContext())
-        {
-            if (this->GetHostSourceContext() == calleeFunctionProxy->GetHostSourceContext() &&
-                this->GetSecondaryHostSourceContext() == calleeFunctionProxy->GetSecondaryHostSourceContext())
-            {
-                return true;
-            }
-        }
-        return false;
+        return this->GetScriptContext() == calleeFunctionProxy->GetScriptContext();
     }
 
 #if ENABLE_NATIVE_CODEGEN

+ 3 - 3
lib/Runtime/Language/DynamicProfileInfo.cpp

@@ -773,7 +773,7 @@ namespace Js
         Assert(functionBody);
         const auto callSiteCount = functionBody->GetProfiledCallSiteCount();
         Assert(callSiteId < callSiteCount);
-        Assert(functionBody->IsJsBuiltInCode() || HasCallSiteInfo(functionBody));
+        Assert(functionBody->IsJsBuiltInCode() || functionBody->IsPublicLibraryCode() || HasCallSiteInfo(functionBody));
         Assert(functionBodyArray);
         Assert(functionBodyArrayLength == DynamicProfileInfo::maxPolymorphicInliningSize);
 
@@ -864,7 +864,7 @@ namespace Js
         Assert(functionBody);
         const auto callSiteCount = functionBody->GetProfiledCallSiteCount();
         Assert(callSiteId < callSiteCount);
-        Assert(functionBody->IsJsBuiltInCode() || HasCallSiteInfo(functionBody));
+        Assert(functionBody->IsJsBuiltInCode() || functionBody->IsPublicLibraryCode() || HasCallSiteInfo(functionBody));
 
         *isConstructorCall = callSiteInfo[callSiteId].isConstructorCall;
         if (callSiteInfo[callSiteId].dontInline)
@@ -941,7 +941,7 @@ namespace Js
         Assert(functionBody);
         const auto callSiteCount = functionBody->GetProfiledCallSiteCount();
         Assert(callSiteId < callSiteCount);
-        Assert(functionBody->IsJsBuiltInCode() || HasCallSiteInfo(functionBody));
+        Assert(functionBody->IsJsBuiltInCode() || functionBody->IsPublicLibraryCode() || HasCallSiteInfo(functionBody));
 
         return callSiteInfo[callSiteId].ldFldInlineCacheId;
     }