WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
the patch
blah.patch (text/plain), 13.36 KB, created by
Filip Pizlo
on 2014-03-13 12:11:55 PDT
(
hide
)
Description:
the patch
Filename:
MIME Type:
Creator:
Filip Pizlo
Created:
2014-03-13 12:11:55 PDT
Size:
13.36 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 165552) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,39 @@ >+2014-03-13 Filip Pizlo <fpizlo@apple.com> >+ >+ FTL should support IsBlah >+ https://bugs.webkit.org/show_bug.cgi?id=130202 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * ftl/FTLCapabilities.cpp: >+ (JSC::FTL::canCompile): >+ * ftl/FTLIntrinsicRepository.h: >+ * ftl/FTLLowerDFGToLLVM.cpp: >+ (JSC::FTL::LowerDFGToLLVM::compileNode): >+ (JSC::FTL::LowerDFGToLLVM::compileIsUndefined): >+ (JSC::FTL::LowerDFGToLLVM::compileIsBoolean): >+ (JSC::FTL::LowerDFGToLLVM::compileIsNumber): >+ (JSC::FTL::LowerDFGToLLVM::compileIsString): >+ (JSC::FTL::LowerDFGToLLVM::compileIsObject): >+ (JSC::FTL::LowerDFGToLLVM::compileIsFunction): >+ (JSC::FTL::LowerDFGToLLVM::compileStoreBarrier): >+ (JSC::FTL::LowerDFGToLLVM::compileStoreBarrierWithNullCheck): >+ (JSC::FTL::LowerDFGToLLVM::isNotCellOrMisc): >+ (JSC::FTL::LowerDFGToLLVM::isNumber): >+ (JSC::FTL::LowerDFGToLLVM::isNotNumber): >+ (JSC::FTL::LowerDFGToLLVM::isBoolean): >+ * ftl/FTLOSRExitCompiler.cpp: >+ * tests/stress/is-undefined-exit-on-masquerader.js: Added. >+ (bar): >+ (foo): >+ (test): >+ * tests/stress/is-undefined-jettison-on-masquerader.js: Added. >+ (foo): >+ (test): >+ * tests/stress/is-undefined-masquerader.js: Added. >+ (foo): >+ (test): >+ > 2014-03-13 Radu Stavila <stavila@adobe.com> > > Webkit not building on XCode 5.1 due to garbage collection no longer being supported >Index: Source/JavaScriptCore/ftl/FTLCapabilities.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLCapabilities.cpp (revision 165552) >+++ Source/JavaScriptCore/ftl/FTLCapabilities.cpp (working copy) >@@ -143,6 +143,12 @@ inline CapabilityLevel canCompile(Node* > case ThrowReferenceError: > case Unreachable: > case GetMyArgumentByVal: >+ case IsUndefined: >+ case IsBoolean: >+ case IsNumber: >+ case IsString: >+ case IsObject: >+ case IsFunction: > // These are OK. > break; > case PutByIdDirect: >Index: Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h >=================================================================== >--- Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h (revision 165552) >+++ Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h (working copy) >@@ -82,6 +82,7 @@ namespace JSC { namespace FTL { > macro(P_JITOperation_EStZ, functionType(intPtr, intPtr, intPtr, int32)) \ > macro(S_JITOperation_EJ, functionType(intPtr, intPtr, int64)) \ > macro(S_JITOperation_EJJ, functionType(intPtr, intPtr, int64, int64)) \ >+ macro(S_JITOperation_J, functionType(intPtr, int64)) \ > macro(V_JITOperation_EJJJ, functionType(voidType, intPtr, int64, int64, int64)) \ > macro(V_JITOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \ > macro(V_JITOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \ >Index: Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (revision 165552) >+++ Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (working copy) >@@ -575,6 +575,24 @@ private: > case CheckArgumentsNotCreated: > compileCheckArgumentsNotCreated(); > break; >+ case IsUndefined: >+ compileIsUndefined(); >+ break; >+ case IsBoolean: >+ compileIsBoolean(); >+ break; >+ case IsNumber: >+ compileIsNumber(); >+ break; >+ case IsString: >+ compileIsString(); >+ break; >+ case IsObject: >+ compileIsObject(); >+ break; >+ case IsFunction: >+ compileIsFunction(); >+ break; > case CountExecution: > compileCountExecution(); > break; >@@ -709,27 +727,6 @@ private: > setJSValue(lowJSValue(m_node->child1())); > } > >- void compileStoreBarrier() >- { >- emitStoreBarrier(lowCell(m_node->child1())); >- } >- >- void compileStoreBarrierWithNullCheck() >- { >-#if ENABLE(GGC) >- LBasicBlock isNotNull = FTL_NEW_BLOCK(m_out, ("Store barrier with null check value not null")); >- LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation")); >- >- LValue base = lowJSValue(m_node->child1()); >- m_out.branch(m_out.isZero64(base), unsure(continuation), unsure(isNotNull)); >- LBasicBlock lastNext = m_out.appendTo(isNotNull, continuation); >- emitStoreBarrier(base); >- m_out.appendTo(continuation, lastNext); >-#else >- speculate(m_node->child1()); >-#endif >- } >- > void compileUpsilon() > { > LValue destination = m_phis.get(m_node->phi()); >@@ -3727,12 +3724,80 @@ private: > checkArgumentsNotCreated(); > } > >+ void compileIsUndefined() >+ { >+ setBoolean(equalNullOrUndefined(m_node->child1(), AllCellsAreFalse, EqualUndefined)); >+ } >+ >+ void compileIsBoolean() >+ { >+ setBoolean(isBoolean(lowJSValue(m_node->child1()))); >+ } >+ >+ void compileIsNumber() >+ { >+ setBoolean(isNumber(lowJSValue(m_node->child1()))); >+ } >+ >+ void compileIsString() >+ { >+ LValue value = lowJSValue(m_node->child1()); >+ >+ LBasicBlock isCellCase = FTL_NEW_BLOCK(m_out, ("IsString cell case")); >+ LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("IsString continuation")); >+ >+ ValueFromBlock notCellResult = m_out.anchor(m_out.booleanFalse); >+ m_out.branch(isCell(value), unsure(isCellCase), unsure(continuation)); >+ >+ LBasicBlock lastNext = m_out.appendTo(isCellCase, continuation); >+ ValueFromBlock cellResult = m_out.anchor(isString(value)); >+ m_out.jump(continuation); >+ >+ m_out.appendTo(continuation, lastNext); >+ setBoolean(m_out.phi(m_out.boolean, notCellResult, cellResult)); >+ } >+ >+ void compileIsObject() >+ { >+ LValue pointerResult = vmCall( >+ m_out.operation(operationIsObject), m_callFrame, lowJSValue(m_node->child1())); >+ setBoolean(m_out.notNull(pointerResult)); >+ } >+ >+ void compileIsFunction() >+ { >+ LValue pointerResult = vmCall( >+ m_out.operation(operationIsFunction), lowJSValue(m_node->child1())); >+ setBoolean(m_out.notNull(pointerResult)); >+ } >+ > void compileCountExecution() > { > TypedPointer counter = m_out.absolute(m_node->executionCounter()->address()); > m_out.store64(m_out.add(m_out.load64(counter), m_out.constInt64(1)), counter); > } > >+ void compileStoreBarrier() >+ { >+ emitStoreBarrier(lowCell(m_node->child1())); >+ } >+ >+ void compileStoreBarrierWithNullCheck() >+ { >+#if ENABLE(GGC) >+ LBasicBlock isNotNull = FTL_NEW_BLOCK(m_out, ("Store barrier with null check value not null")); >+ LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Store barrier continuation")); >+ >+ LValue base = lowJSValue(m_node->child1()); >+ m_out.branch(m_out.isZero64(base), unsure(continuation), unsure(isNotNull)); >+ LBasicBlock lastNext = m_out.appendTo(isNotNull, continuation); >+ emitStoreBarrier(base); >+ m_out.appendTo(continuation, lastNext); >+#else >+ speculate(m_node->child1()); >+#endif >+ } >+ > LValue didOverflowStack() > { > // This does a very simple leaf function analysis. The invariant of FTL call >@@ -4949,6 +5014,10 @@ private: > { > return m_out.testIsZero64(jsValue, m_tagTypeNumber); > } >+ LValue isNotCellOrMisc(LValue jsValue) >+ { >+ return m_out.testNonZero64(jsValue, m_tagTypeNumber); >+ } > LValue unboxDouble(LValue jsValue) > { > return m_out.bitCast(m_out.add(jsValue, m_tagTypeNumber), m_out.doubleType); >@@ -4958,6 +5027,15 @@ private: > return m_out.sub(m_out.bitCast(doubleValue, m_out.int64), m_tagTypeNumber); > } > >+ LValue isNumber(LValue jsValue) >+ { >+ return isNotCellOrMisc(jsValue); >+ } >+ LValue isNotNumber(LValue jsValue) >+ { >+ return isCellOrMisc(jsValue); >+ } >+ > LValue isNotCell(LValue jsValue) > { > return m_out.testNonZero64(jsValue, m_tagMask); >@@ -4984,6 +5062,10 @@ private: > m_out.bitXor(jsValue, m_out.constInt64(ValueFalse)), > m_out.constInt64(~1)); > } >+ LValue isBoolean(LValue jsValue) >+ { >+ return m_out.bitNot(isNotBoolean(jsValue)); >+ } > LValue unboxBoolean(LValue jsValue) > { > // We want to use a cast that guarantees that LLVM knows that even the integer >Index: Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp (revision 165552) >+++ Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp (working copy) >@@ -33,6 +33,7 @@ > #include "FTLExitArgumentForOperand.h" > #include "FTLJITCode.h" > #include "FTLOSRExit.h" >+#include "FTLState.h" > #include "FTLSaveRestore.h" > #include "LinkBuffer.h" > #include "MaxFrameExtentForSlowPathCall.h" >Index: Source/JavaScriptCore/tests/stress/is-undefined-exit-on-masquerader.js >=================================================================== >--- Source/JavaScriptCore/tests/stress/is-undefined-exit-on-masquerader.js (revision 0) >+++ Source/JavaScriptCore/tests/stress/is-undefined-exit-on-masquerader.js (working copy) >@@ -0,0 +1,33 @@ >+var doMasquerading = false; >+ >+function bar(o) { >+ if (doMasquerading) >+ return makeMasquerader(); >+ return o; >+} >+ >+noInline(bar); >+ >+function foo(o) { >+ o = bar(o); >+ return typeof o === "undefined"; >+} >+ >+noInline(foo); >+ >+function test(o, expected) { >+ var result = foo(o); >+ if (result != expected) >+ throw new Error("bad result: " + result); >+} >+ >+for (var i = 0; i < 10000; ++i) { >+ test(void 0, true); >+ test(null, false); >+ test(42, false); >+ test({}, false); >+ test("undefined", false); >+} >+ >+doMasquerading = true; >+test({}, true); >Index: Source/JavaScriptCore/tests/stress/is-undefined-jettison-on-masquerader.js >=================================================================== >--- Source/JavaScriptCore/tests/stress/is-undefined-jettison-on-masquerader.js (revision 0) >+++ Source/JavaScriptCore/tests/stress/is-undefined-jettison-on-masquerader.js (working copy) >@@ -0,0 +1,21 @@ >+function foo(o) { >+ return typeof o === "undefined"; >+} >+ >+noInline(foo); >+ >+function test(o, expected) { >+ var result = foo(o); >+ if (result != expected) >+ throw new Error("bad result: " + result); >+} >+ >+for (var i = 0; i < 10000; ++i) { >+ test(void 0, true); >+ test(null, false); >+ test(42, false); >+ test({}, false); >+ test("undefined", false); >+} >+ >+test(makeMasquerader(), true); >Index: Source/JavaScriptCore/tests/stress/is-undefined-masquerader.js >=================================================================== >--- Source/JavaScriptCore/tests/stress/is-undefined-masquerader.js (revision 0) >+++ Source/JavaScriptCore/tests/stress/is-undefined-masquerader.js (working copy) >@@ -0,0 +1,20 @@ >+function foo(o) { >+ return typeof o === "undefined"; >+} >+ >+noInline(foo); >+ >+function test(o, expected) { >+ var result = foo(o); >+ if (result != expected) >+ throw new Error("bad result: " + result); >+} >+ >+for (var i = 0; i < 10000; ++i) { >+ test(void 0, true); >+ test(null, false); >+ test(42, false); >+ test({}, false); >+ test("undefined", false); >+ test(makeMasquerader(), true); >+} >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 165552) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2014-03-13 Filip Pizlo <fpizlo@apple.com> >+ >+ FTL should support IsBlah >+ https://bugs.webkit.org/show_bug.cgi?id=130202 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Running existing JSRegress tests with noInline gives us coverage for these >+ changes. Chances are, this will also give coverage for other interesting things >+ as well. >+ >+ * Scripts/run-jsc-stress-tests: >+ > 2014-03-12 Brian Burg <bburg@apple.com> > > Web Inspector: Remove unused callId parameter from evaluateInWebInspector >Index: Tools/Scripts/run-jsc-stress-tests >=================================================================== >--- Tools/Scripts/run-jsc-stress-tests (revision 165552) >+++ Tools/Scripts/run-jsc-stress-tests (working copy) >@@ -547,6 +547,10 @@ def runFTLNoCJITValidate > run("ftl-no-cjit-validate", "--enableConcurrentJIT=false", "--validateGraph=true", *FTL_OPTIONS) if $enableFTL > end > >+def runFTLNoCJITNoInlineValidate >+ run("ftl-no-cjit-no-inline-validate", "--enableConcurrentJIT=false", "--validateGraph=true", "--maximumInliningDepth=1", "--maximumInliningDepthForMustInline=1", *FTL_OPTIONS) if $enableFTL >+end >+ > def runFTLNoCJITOSRValidation > run("ftl-no-cjit-osr-validation", "--enableConcurrentJIT=false", "--validateFTLOSRExitLiveness=true", *FTL_OPTIONS) if $enableFTL > end >@@ -592,6 +596,7 @@ def defaultRun > runDFGEagerNoCJITValidate > runDefaultFTL > runFTLNoCJITValidate >+ runFTLNoCJITNoInlineValidate > runFTLNoCJITOSRValidation > runFTLEager > runFTLEagerNoCJITValidate
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ggaren
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 130202
: 226608