summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/jit/JIT.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/JavaScriptCore/jit/JIT.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/JavaScriptCore/jit/JIT.cpp')
-rw-r--r--Source/JavaScriptCore/jit/JIT.cpp65
1 files changed, 48 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 541cc896a..01b1260c9 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -229,12 +229,8 @@ void JIT::privateCompileMainPass()
DEFINE_BINARY_OP(op_lesseq)
DEFINE_BINARY_OP(op_greater)
DEFINE_BINARY_OP(op_greatereq)
- DEFINE_UNARY_OP(op_is_boolean)
DEFINE_UNARY_OP(op_is_function)
- DEFINE_UNARY_OP(op_is_number)
DEFINE_UNARY_OP(op_is_object)
- DEFINE_UNARY_OP(op_is_string)
- DEFINE_UNARY_OP(op_is_undefined)
DEFINE_UNARY_OP(op_typeof)
DEFINE_OP(op_add)
@@ -269,6 +265,10 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_get_scoped_var)
DEFINE_OP(op_check_has_instance)
DEFINE_OP(op_instanceof)
+ DEFINE_OP(op_is_undefined)
+ DEFINE_OP(op_is_boolean)
+ DEFINE_OP(op_is_number)
+ DEFINE_OP(op_is_string)
DEFINE_OP(op_jeq_null)
DEFINE_OP(op_jfalse)
DEFINE_OP(op_jmp)
@@ -283,7 +283,6 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_jnlesseq)
DEFINE_OP(op_jngreater)
DEFINE_OP(op_jngreatereq)
- DEFINE_OP(op_jsr)
DEFINE_OP(op_jtrue)
DEFINE_OP(op_loop)
DEFINE_OP(op_loop_hint)
@@ -340,7 +339,6 @@ void JIT::privateCompileMainPass()
DEFINE_OP(op_ret_object_or_this)
DEFINE_OP(op_rshift)
DEFINE_OP(op_urshift)
- DEFINE_OP(op_sret)
DEFINE_OP(op_strcat)
DEFINE_OP(op_stricteq)
DEFINE_OP(op_sub)
@@ -519,6 +517,48 @@ void JIT::privateCompileSlowCases()
#endif
}
+ALWAYS_INLINE void PropertyStubCompilationInfo::copyToStubInfo(StructureStubInfo& info, LinkBuffer &linkBuffer)
+{
+ ASSERT(bytecodeIndex != std::numeric_limits<unsigned>::max());
+ info.bytecodeIndex = bytecodeIndex;
+ info.callReturnLocation = linkBuffer.locationOf(callReturnLocation);
+ info.hotPathBegin = linkBuffer.locationOf(hotPathBegin);
+
+ switch (m_type) {
+ case MethodCheck: {
+ CodeLocationDataLabelPtr structureToCompareLocation = linkBuffer.locationOf(methodCheckStructureToCompare);
+ info.patch.baseline.methodCheckProtoObj = MacroAssembler::differenceBetweenCodePtr(structureToCompareLocation, linkBuffer.locationOf(methodCheckProtoObj));
+ info.patch.baseline.methodCheckProtoStructureToCompare = MacroAssembler::differenceBetweenCodePtr(structureToCompareLocation, linkBuffer.locationOf(methodCheckProtoStructureToCompare));
+ info.patch.baseline.methodCheckPutFunction = MacroAssembler::differenceBetweenCodePtr(structureToCompareLocation, linkBuffer.locationOf(methodCheckPutFunction));
+ // No break - fall through to GetById.
+ }
+ case GetById: {
+ CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin);
+ info.patch.baseline.u.get.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureToCompare));
+ info.patch.baseline.u.get.structureCheck = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getStructureCheck));
+#if USE(JSVALUE64)
+ info.patch.baseline.u.get.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel));
+#else
+ info.patch.baseline.u.get.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel1));
+ info.patch.baseline.u.get.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getDisplacementLabel2));
+#endif
+ info.patch.baseline.u.get.putResult = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(getPutResult));
+ info.patch.baseline.u.get.coldPathBegin = MacroAssembler::differenceBetweenCodePtr(linkBuffer.locationOf(getColdPathBegin), linkBuffer.locationOf(callReturnLocation));
+ break;
+ }
+ case PutById:
+ CodeLocationLabel hotPathBeginLocation = linkBuffer.locationOf(hotPathBegin);
+ info.patch.baseline.u.put.structureToCompare = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putStructureToCompare));
+#if USE(JSVALUE64)
+ info.patch.baseline.u.put.displacementLabel = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel));
+#else
+ info.patch.baseline.u.put.displacementLabel1 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel1));
+ info.patch.baseline.u.put.displacementLabel2 = MacroAssembler::differenceBetweenCodePtr(hotPathBeginLocation, linkBuffer.locationOf(putDisplacementLabel2));
+#endif
+ break;
+ }
+}
+
JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffort effort)
{
#if ENABLE(JIT_VERBOSE_OSR)
@@ -665,18 +705,9 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck, JITCompilationEffo
m_codeBlock->callReturnIndexVector().append(CallReturnOffsetToBytecodeOffset(patchBuffer.returnAddressOffset(iter->from), iter->bytecodeOffset));
}
- // Link absolute addresses for jsr
- for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter)
- patchBuffer.patch(iter->storeLocation, patchBuffer.locationOf(iter->target).executableAddress());
-
m_codeBlock->setNumberOfStructureStubInfos(m_propertyAccessCompilationInfo.size());
- for (unsigned i = 0; i < m_propertyAccessCompilationInfo.size(); ++i) {
- StructureStubInfo& info = m_codeBlock->structureStubInfo(i);
- ASSERT(m_propertyAccessCompilationInfo[i].bytecodeIndex != std::numeric_limits<unsigned>::max());
- info.bytecodeIndex = m_propertyAccessCompilationInfo[i].bytecodeIndex;
- info.callReturnLocation = patchBuffer.locationOf(m_propertyAccessCompilationInfo[i].callReturnLocation);
- info.hotPathBegin = patchBuffer.locationOf(m_propertyAccessCompilationInfo[i].hotPathBegin);
- }
+ for (unsigned i = 0; i < m_propertyAccessCompilationInfo.size(); ++i)
+ m_propertyAccessCompilationInfo[i].copyToStubInfo(m_codeBlock->structureStubInfo(i), patchBuffer);
m_codeBlock->setNumberOfCallLinkInfos(m_callStructureStubCompilationInfo.size());
for (unsigned i = 0; i < m_codeBlock->numberOfCallLinkInfos(); ++i) {
CallLinkInfo& info = m_codeBlock->callLinkInfo(i);