Skip to content

Commit 6c42b34

Browse files
committed
Updated bytecode and other suggested changes
1 parent cc64068 commit 6c42b34

16 files changed

+4772
-4639
lines changed

lib/Runtime/Base/JnDirectFields.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@ ENTRY(builtInJavascriptArrayEntryIndexOf)
670670
ENTRY(builtInJavascriptArrayEntrySome)
671671
ENTRY(builtInJavascriptArrayEntryEvery)
672672
ENTRY(builtInJavascriptArrayEntryIncludes)
673+
ENTRY(builtInMathMin)
674+
ENTRY(builtInMathMax)
673675
ENTRY(EngineInterface)
674676
ENTRY(builtInCallInstanceFunction)
675677

lib/Runtime/ByteCode/ByteCodeCacheReleaseFileVersion.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
44
//-------------------------------------------------------------------------------------------------------
55
// NOTE: If there is a merge conflict the correct fix is to make a new GUID.
6-
// This file was generated with tools\update_bytecode_version.ps1
76

8-
// {9FAAF688-ACBA-4092-BA5B-77D97D3CD53A}
7+
// {D8913E7E-E430-4B28-81DD-EDD3EE5F263B}
98
const GUID byteCodeCacheReleaseFileVersion =
10-
{ 0x9FAAF688, 0xACBA, 0x4092, { 0xBA, 0x5B, 0x77, 0xD9, 0x7D, 0x3C, 0xD5, 0x3A } };
9+
{ 0xD8913E7E, 0xE430, 0x4B28, { 0x81, 0xDD, 0xED, 0xD3, 0xEE, 0x5F, 0x26, 0x3B } };

lib/Runtime/Language/AsmJsBuiltInNames.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
//-------------------------------------------------------------------------------------------------------
55

66
// Default all macros to nothing
7+
8+
#ifndef ASMJS_JSBUILTIN_MATH_FUNC_NAMES
9+
#define ASMJS_JSBUILTIN_MATH_FUNC_NAMES(propertyId, funcName)
10+
#endif
11+
712
#ifndef ASMJS_MATH_FUNC_NAMES
813
#define ASMJS_MATH_FUNC_NAMES(name, propertyName, funcInfo)
914
#endif
@@ -24,6 +29,11 @@
2429
#define ASMJS_TYPED_ARRAY_NAMES(name, propertyName) ASMJS_ARRAY_NAMES(name, propertyName)
2530
#endif
2631

32+
#ifdef ENABLE_JS_BUILTINS
33+
ASMJS_JSBUILTIN_MATH_FUNC_NAMES(Js::PropertyIds::min, Min )
34+
ASMJS_JSBUILTIN_MATH_FUNC_NAMES(Js::PropertyIds::max, Max )
35+
#endif
36+
2737
ASMJS_MATH_FUNC_NAMES(sin, sin, Math::EntryInfo::Sin )
2838
ASMJS_MATH_FUNC_NAMES(cos, cos, Math::EntryInfo::Cos )
2939
ASMJS_MATH_FUNC_NAMES(tan, tan, Math::EntryInfo::Tan )
@@ -66,6 +76,7 @@ ASMJS_TYPED_ARRAY_NAMES(Float64Array, Float64Array)
6676
ASMJS_ARRAY_NAMES(byteLength, byteLength)
6777

6878
// help the caller to undefine all the macros
79+
#undef ASMJS_JSBUILTIN_MATH_FUNC_NAMES
6980
#undef ASMJS_MATH_FUNC_NAMES
7081
#undef ASMJS_MATH_CONST_NAMES
7182
#undef ASMJS_MATH_DOUBLE_CONST_NAMES

lib/Runtime/Language/AsmJsLink.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@ namespace Js{
191191
bool ASMLink::CheckIsBuiltinFunction(ScriptContext* scriptContext, const Var object, PropertyId propertyId, const FunctionInfo& funcInfo)
192192
{
193193
Var mathFuncObj = JavascriptOperators::OP_GetProperty(object, propertyId, scriptContext);
194+
#ifdef ENABLE_JS_BUILTINS
195+
if (scriptContext->IsJsBuiltInEnabled())
196+
{
197+
switch (propertyId)
198+
{
199+
#define ASMJS_JSBUILTIN_MATH_FUNC_NAMES(propertyId, funcName) case propertyId: \
200+
return VarIs<JavascriptFunction>(mathFuncObj) && \
201+
VarTo<JavascriptFunction>(mathFuncObj) == scriptContext->GetLibrary()->GetMath##funcName##Function();
202+
#include "AsmJsBuiltInNames.h"
203+
}
204+
}
205+
#endif
194206
return VarIs<JavascriptFunction>(mathFuncObj) &&
195207
VarTo<JavascriptFunction>(mathFuncObj)->GetFunctionInfo()->GetOriginalEntryPoint() == funcInfo.GetOriginalEntryPoint();
196208
}

lib/Runtime/Library/EngineInterfaceObjectBuiltIns.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ GlobalBuiltInConstructor(Symbol)
5656

5757
GlobalMathBuiltIn(Abs)
5858
GlobalMathBuiltIn(Floor)
59-
GlobalMathBuiltIn(Max)
60-
GlobalMathBuiltIn(Min)
6159
GlobalMathBuiltIn(Pow)
6260

6361
GlobalBuiltIn(JavascriptObject, DefineProperty)
@@ -91,8 +89,6 @@ GlobalBuiltIn(JavascriptString, Substring)
9189
GlobalBuiltIn(JavascriptString, Repeat)
9290
GlobalBuiltIn(JavascriptString, IndexOf)
9391

94-
GlobalBuiltIn(JavascriptNumber, IsNaN)
95-
9692
GlobalBuiltIn(GlobalObject, IsFinite) // TODO(jahorto): consider switching to Number.isFinite
9793
GlobalBuiltIn(GlobalObject, IsNaN) // TODO(jahorto): consider switching to Number.isNaN
9894
GlobalBuiltIn(GlobalObject, Eval) // TODO(jahorto): consider deleting (currently used by WinRT Promises)

lib/Runtime/Library/InJavascript/Intl.js.bc.32b.h

Lines changed: 298 additions & 293 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/Intl.js.bc.64b.h

Lines changed: 298 additions & 298 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/Intl.js.nojit.bc.32b.h

Lines changed: 295 additions & 295 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/InJavascript/Intl.js.nojit.bc.64b.h

Lines changed: 315 additions & 297 deletions
Large diffs are not rendered by default.

lib/Runtime/Library/JavascriptLibraryBase.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ namespace Js
340340
Field(JavascriptFunction*) getStackTrace;
341341
#ifdef EDIT_AND_CONTINUE
342342
Field(JavascriptFunction*) editSource;
343+
#endif
344+
Field(JavascriptFunction*) mathMin;
345+
Field(JavascriptFunction*) mathMax;
346+
347+
#ifdef ENABLE_JS_BUILTINS
348+
public:
349+
JavascriptFunction* GetMathMinFunction() const { return mathMin; }
350+
JavascriptFunction* GetMathMaxFunction() const { return mathMax; }
343351
#endif
344352
};
345353
}

0 commit comments

Comments
 (0)