Skip to content

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ runDefault("--validateOptions=true", "--thresholdForJITSoon=10", "--thresholdForJITAfterWarmUp=10", "--thresholdForOptimizeAfterWarmUp=100", "--thresholdForOptimizeAfterLongWarmUp=100", "--thresholdForOptimizeSoon=100", "--thresholdForFTLOptimizeAfterWarmUp=1000", "--thresholdForFTLOptimizeSoon=1000", "--validateBCE=true", "--useConcurrentJIT=0")
2+
3+
function opt(arg) {
4+
try {
5+
arg.test({ test: "padEnd" });
6+
} catch (e) { }
7+
arg.test(/123/);
8+
}
9+
10+
for (let i = 0; i < 50; i++) {
11+
opt({ test: opt });
12+
}

Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,12 +2115,16 @@ class FixupPhase : public Phase {
21152115
case SkipScope:
21162116
case GetScope:
21172117
case GetGetter:
2118-
case GetSetter:
2119-
case GetGlobalObject: {
2118+
case GetSetter: {
21202119
fixEdge<KnownCellUse>(node->child1());
21212120
break;
21222121
}
21232122

2123+
case GetGlobalObject: {
2124+
fixEdge<ObjectUse>(node->child1());
2125+
break;
2126+
}
2127+
21242128
case UnwrapGlobalProxy: {
21252129
fixEdge<GlobalProxyUse>(node->child1());
21262130
break;

Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7966,9 +7966,15 @@ void SpeculativeJIT::compileGetGlobalObject(Node* node)
79667966
{
79677967
SpeculateCellOperand object(this, node->child1());
79687968
GPRTemporary result(this);
7969-
emitLoadStructure(vm(), object.gpr(), result.gpr());
7970-
loadPtr(Address(result.gpr(), Structure::globalObjectOffset()), result.gpr());
7971-
cellResult(result.gpr(), node);
7969+
7970+
GPRReg objectGPR = object.gpr();
7971+
GPRReg resultGPR = result.gpr();
7972+
7973+
speculateObject(node->child1(), objectGPR);
7974+
7975+
emitLoadStructure(vm(), objectGPR, resultGPR);
7976+
loadPtr(Address(resultGPR, Structure::globalObjectOffset()), resultGPR);
7977+
cellResult(resultGPR, node);
79727978
}
79737979

79747980
void SpeculativeJIT::compileGetGlobalThis(Node* node)

Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11749,7 +11749,7 @@ IGNORE_CLANG_WARNINGS_END
1174911749

1175011750
void compileGetGlobalObject()
1175111751
{
11752-
LValue structure = loadStructure(lowCell(m_node->child1()));
11752+
LValue structure = loadStructure(lowObject(m_node->child1()));
1175311753
setJSValue(m_out.loadPtr(structure, m_heaps.Structure_globalObject));
1175411754
}
1175511755

0 commit comments

Comments
 (0)