Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHolman committed Sep 13, 2017
1 parent 7be7690 commit 3ccd90c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
3 changes: 1 addition & 2 deletions lib/Backend/BackendOpCodeAttrAsmJs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down
1 change: 0 additions & 1 deletion lib/Backend/Sym.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class StackSym: public Sym
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();
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Base/FunctionBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/ByteCode/OpCodesAsmJs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
14 changes: 11 additions & 3 deletions lib/Runtime/Language/DynamicProfileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 2 additions & 5 deletions lib/WasmReader/WasmByteCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/wasm/inlining.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-1970372561
-1970372561
7 changes: 7 additions & 0 deletions test/wasm/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 3ccd90c

Please sign in to comment.