summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/llint
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/llint')
-rw-r--r--Source/JavaScriptCore/llint/LLIntSlowPaths.cpp8
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter.asm17
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm83
-rw-r--r--Source/JavaScriptCore/llint/LowLevelInterpreter64.asm79
4 files changed, 47 insertions, 140 deletions
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index 8a578ffac..ba44bf404 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -275,7 +275,7 @@ inline bool shouldJIT(ExecState* exec)
// Returns true if we should try to OSR.
inline bool jitCompileAndSetHeuristics(CodeBlock* codeBlock, ExecState* exec)
{
- codeBlock->updateAllValueProfilePredictions();
+ codeBlock->updateAllPredictions();
if (!codeBlock->checkIfJITThresholdReached()) {
#if ENABLE(JIT_VERBOSE_OSR)
@@ -510,19 +510,19 @@ LLINT_SLOW_PATH_DECL(slow_path_new_object)
LLINT_SLOW_PATH_DECL(slow_path_new_array)
{
LLINT_BEGIN();
- LLINT_RETURN(constructArray(exec, pc[4].u.arrayAllocationProfile, bitwise_cast<JSValue*>(&LLINT_OP(2)), pc[3].u.operand));
+ LLINT_RETURN(constructArray(exec, bitwise_cast<JSValue*>(&LLINT_OP(2)), pc[3].u.operand));
}
LLINT_SLOW_PATH_DECL(slow_path_new_array_with_size)
{
LLINT_BEGIN();
- LLINT_RETURN(constructArrayWithSizeQuirk(exec, pc[3].u.arrayAllocationProfile, exec->lexicalGlobalObject(), LLINT_OP_C(2).jsValue()));
+ LLINT_RETURN(constructArrayWithSizeQuirk(exec, exec->lexicalGlobalObject(), LLINT_OP_C(2).jsValue()));
}
LLINT_SLOW_PATH_DECL(slow_path_new_array_buffer)
{
LLINT_BEGIN();
- LLINT_RETURN(constructArray(exec, pc[4].u.arrayAllocationProfile, exec->codeBlock()->constantBuffer(pc[2].u.operand), pc[3].u.operand));
+ LLINT_RETURN(constructArray(exec, exec->codeBlock()->constantBuffer(pc[2].u.operand), pc[3].u.operand));
}
LLINT_SLOW_PATH_DECL(slow_path_new_regexp)
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
index 00d5c4f6f..ba5b67df4 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -88,13 +88,10 @@ else
end
# Constant for reasoning about butterflies.
-const IsArray = 1
-const IndexingShapeMask = 30
-const NoIndexingShape = 0
-const Int32Shape = 20
-const DoubleShape = 22
-const ContiguousShape = 26
-const ArrayStorageShape = 28
+const IsArray = 1
+const IndexingShapeMask = 30
+const ContiguousShape = 26
+const ArrayStorageShape = 28
const SlowPutArrayStorageShape = 30
# Type constants.
@@ -465,19 +462,19 @@ end
_llint_op_new_array:
traceExecution()
callSlowPath(_llint_slow_path_new_array)
- dispatch(5)
+ dispatch(4)
_llint_op_new_array_with_size:
traceExecution()
callSlowPath(_llint_slow_path_new_array_with_size)
- dispatch(4)
+ dispatch(3)
_llint_op_new_array_buffer:
traceExecution()
callSlowPath(_llint_slow_path_new_array_buffer)
- dispatch(5)
+ dispatch(4)
_llint_op_new_regexp:
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
index e3ef909f5..ffb146247 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
@@ -1185,9 +1185,7 @@ _llint_op_get_by_val:
loadConstantOrVariablePayload(t3, Int32Tag, t1, .opGetByValSlow)
loadp JSObject::m_butterfly[t0], t3
andi IndexingShapeMask, t2
- bieq t2, Int32Shape, .opGetByValIsContiguous
bineq t2, ContiguousShape, .opGetByValNotContiguous
-.opGetByValIsContiguous:
biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t3], .opGetByValSlow
loadi TagOffset[t3, t1, 8], t2
@@ -1195,16 +1193,6 @@ _llint_op_get_by_val:
jmp .opGetByValDone
.opGetByValNotContiguous:
- bineq t2, DoubleShape, .opGetByValNotDouble
- biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t3], .opGetByValSlow
- loadd [t3, t1, 8], ft0
- bdnequn ft0, ft0, .opGetByValSlow
- # FIXME: This could be massively optimized.
- fd2ii ft0, t1, t2
- loadi 4[PC], t0
- jmp .opGetByValNotEmpty
-
-.opGetByValNotDouble:
subi ArrayStorageShape, t2
bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValSlow
biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t3], .opGetByValSlow
@@ -1214,7 +1202,6 @@ _llint_op_get_by_val:
.opGetByValDone:
loadi 4[PC], t0
bieq t2, EmptyValueTag, .opGetByValSlow
-.opGetByValNotEmpty:
storei t2, TagOffset[cfr, t0, 8]
storei t1, PayloadOffset[cfr, t0, 8]
loadi 20[PC], t0
@@ -1283,24 +1270,6 @@ _llint_op_get_by_pname:
dispatch(7)
-macro contiguousPutByVal(storeCallback)
- biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .outOfBounds
-.storeResult:
- loadi 12[PC], t2
- storeCallback(t2, t1, t0, t3)
- dispatch(5)
-
-.outOfBounds:
- biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
- if VALUE_PROFILER
- loadp 16[PC], t2
- storeb 1, ArrayProfile::m_mayStoreToHole[t2]
- end
- addi 1, t3, t2
- storei t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
- jmp .storeResult
-end
-
_llint_op_put_by_val:
traceExecution()
loadi 4[PC], t0
@@ -1312,42 +1281,26 @@ _llint_op_put_by_val:
loadConstantOrVariablePayload(t0, Int32Tag, t3, .opPutByValSlow)
loadp JSObject::m_butterfly[t1], t0
andi IndexingShapeMask, t2
- bineq t2, Int32Shape, .opPutByValNotInt32
- contiguousPutByVal(
- macro (operand, scratch, base, index)
- loadConstantOrVariablePayload(operand, Int32Tag, scratch, .opPutByValSlow)
- storei Int32Tag, TagOffset[base, index, 8]
- storei scratch, PayloadOffset[base, index, 8]
- end)
+ bineq t2, ContiguousShape, .opPutByValNotContiguous
-.opPutByValNotInt32:
- bineq t2, DoubleShape, .opPutByValNotDouble
- contiguousPutByVal(
- macro (operand, scratch, base, index)
- const tag = scratch
- const payload = operand
- loadConstantOrVariable2Reg(operand, tag, payload)
- bineq tag, Int32Tag, .notInt
- ci2d payload, ft0
- jmp .ready
- .notInt:
- fii2d payload, tag, ft0
- bdnequn ft0, ft0, .opPutByValSlow
- .ready:
- stored ft0, [base, index, 8]
- end)
+ biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValContiguousOutOfBounds
+.opPutByValContiguousStoreResult:
+ loadi 12[PC], t2
+ loadConstantOrVariable2Reg(t2, t1, t2)
+ writeBarrier(t1, t2)
+ storei t1, TagOffset[t0, t3, 8]
+ storei t2, PayloadOffset[t0, t3, 8]
+ dispatch(5)
-.opPutByValNotDouble:
- bineq t2, ContiguousShape, .opPutByValNotContiguous
- contiguousPutByVal(
- macro (operand, scratch, base, index)
- const tag = scratch
- const payload = operand
- loadConstantOrVariable2Reg(operand, tag, payload)
- writeBarrier(tag, payload)
- storei tag, TagOffset[base, index, 8]
- storei payload, PayloadOffset[base, index, 8]
- end)
+.opPutByValContiguousOutOfBounds:
+ biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
+ if VALUE_PROFILER
+ loadp 16[PC], t1
+ storeb 1, ArrayProfile::m_mayStoreToHole[t1]
+ end
+ addi 1, t3, t2
+ storei t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
+ jmp .opPutByValContiguousStoreResult
.opPutByValNotContiguous:
bineq t2, ArrayStorageShape, .opPutByValSlow
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
index d8a293337..c9900b343 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
@@ -1025,9 +1025,7 @@ _llint_op_get_by_val:
sxi2q t1, t1
loadp JSObject::m_butterfly[t0], t3
andi IndexingShapeMask, t2
- bieq t2, Int32Shape, .opGetByValIsContiguous
bineq t2, ContiguousShape, .opGetByValNotContiguous
-.opGetByValIsContiguous:
biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t3], .opGetByValSlow
loadisFromInstruction(1, t0)
@@ -1036,16 +1034,6 @@ _llint_op_get_by_val:
jmp .opGetByValDone
.opGetByValNotContiguous:
- bineq t2, DoubleShape, .opGetByValNotDouble
- biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t3], .opGetByValSlow
- loadis 8[PB, PC, 8], t0
- loadd [t3, t1, 8], ft0
- bdnequn ft0, ft0, .opGetByValSlow
- fd2q ft0, t2
- subq tagTypeNumber, t2
- jmp .opGetByValDone
-
-.opGetByValNotDouble:
subi ArrayStorageShape, t2
bia t2, SlowPutArrayStorageShape - ArrayStorageShape, .opGetByValSlow
biaeq t1, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t3], .opGetByValSlow
@@ -1121,24 +1109,6 @@ _llint_op_get_by_pname:
dispatch(7)
-macro contiguousPutByVal(storeCallback)
- biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .outOfBounds
-.storeResult:
- loadisFromInstruction(3, t2)
- storeCallback(t2, t1, [t0, t3, 8])
- dispatch(5)
-
-.outOfBounds:
- biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
- if VALUE_PROFILER
- loadp 32[PB, PC, 8], t2
- storeb 1, ArrayProfile::m_mayStoreToHole[t2]
- end
- addi 1, t3, t2
- storei t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
- jmp .storeResult
-end
-
_llint_op_put_by_val:
traceExecution()
loadisFromInstruction(1, t0)
@@ -1151,38 +1121,25 @@ _llint_op_put_by_val:
sxi2q t3, t3
loadp JSObject::m_butterfly[t1], t0
andi IndexingShapeMask, t2
- bineq t2, Int32Shape, .opPutByValNotInt32
- contiguousPutByVal(
- macro (operand, scratch, address)
- loadConstantOrVariable(operand, scratch)
- bpb scratch, tagTypeNumber, .opPutByValSlow
- storep scratch, address
- end)
-
-.opPutByValNotInt32:
- bineq t2, DoubleShape, .opPutByValNotDouble
- contiguousPutByVal(
- macro (operand, scratch, address)
- loadConstantOrVariable(operand, scratch)
- bqb scratch, tagTypeNumber, .notInt
- ci2d scratch, ft0
- jmp .ready
- .notInt:
- addp tagTypeNumber, scratch
- fq2d scratch, ft0
- bdnequn ft0, ft0, .opPutByValSlow
- .ready:
- stored ft0, address
- end)
-
-.opPutByValNotDouble:
bineq t2, ContiguousShape, .opPutByValNotContiguous
- contiguousPutByVal(
- macro (operand, scratch, address)
- loadConstantOrVariable(operand, scratch)
- writeBarrier(scratch)
- storep scratch, address
- end)
+
+ biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0], .opPutByValContiguousOutOfBounds
+.opPutByValContiguousStoreResult:
+ loadisFromInstruction(3, t2)
+ loadConstantOrVariable(t2, t1)
+ writeBarrier(t1)
+ storeq t1, [t0, t3, 8]
+ dispatch(5)
+
+.opPutByValContiguousOutOfBounds:
+ biaeq t3, -sizeof IndexingHeader + IndexingHeader::m_vectorLength[t0], .opPutByValSlow
+ if VALUE_PROFILER
+ loadpFromInstruction(4, t2)
+ storeb 1, ArrayProfile::m_mayStoreToHole[t2]
+ end
+ addi 1, t3, t2
+ storei t2, -sizeof IndexingHeader + IndexingHeader::m_publicLength[t0]
+ jmp .opPutByValContiguousStoreResult
.opPutByValNotContiguous:
bineq t2, ArrayStorageShape, .opPutByValSlow