Răsfoiți Sursa

Address CR feedback

Michael Holman 8 ani în urmă
părinte
comite
75f5e8f298

+ 1 - 2
lib/Backend/BackendOpCodeAttrAsmJs.cpp

@@ -13,8 +13,7 @@ namespace OpCodeAttrAsmJs
         OpNoFallThrough = 1 << 0, // Opcode doesn't fallthrough in flow  and its always jump to the return from this opcode.
         OpHasMultiSizeLayout = 1 << 1,
         OpHasProfiled = 1 << 2,
-        OpProfiled = 1 << 3,
-        OpByteCodeOnly = 1 << 4
+        OpProfiled = 1 << 3
     };
 
     static const int OpcodeAttributesAsmJs[] =

+ 0 - 1
lib/Backend/Sym.h

@@ -176,7 +176,6 @@ public:
     bool            IsFromByteCodeConstantTable() const { return m_isFromByteCodeConstantTable; }
     void            SetIsFromByteCodeConstantTable() { this->m_isFromByteCodeConstantTable = true; }
     Js::ArgSlot     GetArgSlotNum() const { Assert(HasArgSlotNum()); return m_slotNum; }
-    void            SetArgSlotNum(Js::ArgSlot newNum) { m_slotNum = newNum; }
     bool            HasArgSlotNum() const { return !!(m_isArgSlotSym | m_isArgSlotRegSym); }
     void            IncrementArgSlotNum();
     void            DecrementArgSlotNum();

+ 2 - 2
lib/Runtime/Base/FunctionBody.cpp

@@ -4948,15 +4948,15 @@ namespace Js
             DynamicProfileInfoList * profileInfoList = GetScriptContext()->GetProfileInfoList();
             if (profileInfoList)
             {
-                for (auto iter = profileInfoList->GetEditingIterator(); iter.IsValid(); iter.Next())
+                FOREACH_SLISTBASE_ENTRY_EDITING(Field(DynamicProfileInfo*), info, profileInfoList, iter)
                 {
-                    DynamicProfileInfo * info = iter.Data();
                     if (info->HasFunctionBody() && info->GetFunctionBody() == this)
                     {
                         iter.UnlinkCurrent();
                         break;
                     }
                 }
+                NEXT_SLISTBASE_ENTRY_EDITING;
             }
 #endif
             this->dynamicProfileInfo = nullptr;

+ 1 - 1
lib/Runtime/ByteCode/OpCodesAsmJs.h

@@ -21,7 +21,7 @@
 
 #define MACRO_WMS_PROFILED( opcode, layout, attr) \
     MACRO_WMS(opcode, layout, OpHasProfiled|attr) \
-    MACRO_WMS(Profiled##opcode, Profiled##layout, OpByteCodeOnly|OpProfiled|attr) \
+    MACRO_WMS(Profiled##opcode, Profiled##layout, OpProfiled|attr) \
 
 
 //              (   OpCodeAsmJs              , LayoutAsmJs     , OpCodeAttrAsmJs )

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

@@ -217,7 +217,11 @@ namespace Js
     bool DynamicProfileInfo::IsEnabled(const FunctionBody *const functionBody)
     {
         Assert(functionBody);
-        return IsEnabled_OptionalFunctionBody(functionBody, functionBody->GetScriptContext());
+        return (IsEnabled_OptionalFunctionBody(functionBody, functionBody->GetScriptContext())
+#ifdef ENABLE_WASM
+            && !(PHASE_TRACE1(Js::WasmInOutPhase) && functionBody->IsWasmFunction())
+#endif
+            );
     }
 
     bool DynamicProfileInfo::IsEnabled_OptionalFunctionBody(const FunctionBody *const functionBody, const ScriptContext *const scriptContext)
@@ -248,7 +252,11 @@ namespace Js
     bool DynamicProfileInfo::IsEnabled(const Js::Phase phase, const FunctionBody *const functionBody)
     {
         Assert(functionBody);
-        return IsEnabled_OptionalFunctionBody(phase, functionBody, functionBody->GetScriptContext());
+        return (IsEnabled_OptionalFunctionBody(phase, functionBody, functionBody->GetScriptContext())
+#ifdef ENABLE_WASM
+            && !(PHASE_TRACE1(Js::WasmInOutPhase) && functionBody->IsWasmFunction())
+#endif
+            );
     }
 
     bool DynamicProfileInfo::IsEnabled_OptionalFunctionBody(
@@ -414,7 +422,7 @@ namespace Js
     {
         if (!callerBody || !callerBody->GetIsAsmjsMode() || !calleeBody || !calleeBody->GetIsAsmjsMode())
         {
-            AssertMsg(UNREACHED, "Call to RecordAsmJsCallSiteInfo without 2 wasm function body");
+            AssertMsg(UNREACHED, "Call to RecordAsmJsCallSiteInfo without two asm.js/wasm FunctionBody");
             return;
         }
         

+ 2 - 5
lib/WasmReader/WasmByteCodeGenerator.cpp

@@ -965,7 +965,7 @@ EmitInfo WasmBytecodeGenerator::EmitCall()
         calleeSignature = calleeInfo->GetSignature();
         // currently only handle inlining internal function calls
         // in future we can expand to all calls by adding checks in inliner and falling back to call in case ScriptFunction doesn't match
-        if (GetReader()->m_currentNode.call.funcType == FunctionIndexTypes::Function)
+        if (GetReader()->m_currentNode.call.funcType == FunctionIndexTypes::Function && !PHASE_TRACE1(Js::WasmInOutPhase))
         {
             profileId = GetNextProfileId();
         }
@@ -1135,10 +1135,7 @@ EmitInfo WasmBytecodeGenerator::EmitCall()
             default:
                 throw WasmCompilationException(_u("Unknown call return type %u"), retInfo.type);
             }
-            if (retInfo.type != WasmTypes::Void)
-            {
-                retInfo.location = GetRegisterSpace(retInfo.type)->AcquireTmpRegister();
-            }
+            retInfo.location = GetRegisterSpace(retInfo.type)->AcquireTmpRegister();
             m_writer->AsmReg2(convertOp, retInfo.location, varRetReg);
         }
     }

+ 2 - 0
test/wasm/inlining.baseline

@@ -0,0 +1,2 @@
+-1970372561
+-1970372561

+ 7 - 0
test/wasm/rlexe.xml

@@ -158,6 +158,13 @@
     <tags>exclude_jshost,exclude_win7</tags>
   </default>
 </test>
+<test>
+  <default>
+    <files>inlining.js</files>
+    <baseline>inlining.baseline</baseline>
+    <tags>exclude_jshost,exclude_win7,exclude_xplat</tags>
+  </default>
+</test>
 <test>
   <default>
     <files>params.js</files>