summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/assembler
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /JavaScriptCore/assembler
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'JavaScriptCore/assembler')
-rw-r--r--JavaScriptCore/assembler/ARMAssembler.h1
-rw-r--r--JavaScriptCore/assembler/ARMv7Assembler.h3
-rw-r--r--JavaScriptCore/assembler/AbstractMacroAssembler.h8
-rw-r--r--JavaScriptCore/assembler/LinkBuffer.h2
-rw-r--r--JavaScriptCore/assembler/MIPSAssembler.h1
-rw-r--r--JavaScriptCore/assembler/MacroAssembler.h2
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerARM.h22
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerARMv7.h24
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerMIPS.h18
-rw-r--r--JavaScriptCore/assembler/MacroAssemblerX86Common.h14
-rw-r--r--JavaScriptCore/assembler/X86Assembler.h1
11 files changed, 54 insertions, 42 deletions
diff --git a/JavaScriptCore/assembler/ARMAssembler.h b/JavaScriptCore/assembler/ARMAssembler.h
index 1d24dd3..77ec60f 100644
--- a/JavaScriptCore/assembler/ARMAssembler.h
+++ b/JavaScriptCore/assembler/ARMAssembler.h
@@ -240,6 +240,7 @@ namespace JSC {
}
bool isUsed() const { return m_used; }
+ bool isSet() const { return (m_offset != -1); }
void used() { m_used = true; }
private:
JmpDst(int offset)
diff --git a/JavaScriptCore/assembler/ARMv7Assembler.h b/JavaScriptCore/assembler/ARMv7Assembler.h
index a40208a..b0fcd06 100644
--- a/JavaScriptCore/assembler/ARMv7Assembler.h
+++ b/JavaScriptCore/assembler/ARMv7Assembler.h
@@ -304,7 +304,7 @@ public:
}
if ((bytes.byte1 == bytes.byte3) && !(bytes.byte0 | bytes.byte2)) {
- encoding.immediate = bytes.byte0;
+ encoding.immediate = bytes.byte1;
encoding.pattern = 2;
return ARMThumbImmediate(TypeEncoded, encoding);
}
@@ -553,6 +553,7 @@ public:
}
bool isUsed() const { return m_used; }
+ bool isSet() const { return (m_offset != -1); }
void used() { m_used = true; }
private:
JmpDst(int offset)
diff --git a/JavaScriptCore/assembler/AbstractMacroAssembler.h b/JavaScriptCore/assembler/AbstractMacroAssembler.h
index 1fa5ec7..07bd702 100644
--- a/JavaScriptCore/assembler/AbstractMacroAssembler.h
+++ b/JavaScriptCore/assembler/AbstractMacroAssembler.h
@@ -241,6 +241,7 @@ public:
}
bool isUsed() const { return m_label.isUsed(); }
+ bool isSet() const { return m_label.isSet(); }
void used() { m_label.used(); }
private:
JmpDst m_label;
@@ -264,6 +265,8 @@ public:
{
}
+ bool isSet() const { return m_label.isSet(); }
+
private:
JmpDst m_label;
};
@@ -410,6 +413,11 @@ public:
return !m_jumps.size();
}
+ void clear()
+ {
+ m_jumps.clear();
+ }
+
const JumpVector& jumps() { return m_jumps; }
private:
diff --git a/JavaScriptCore/assembler/LinkBuffer.h b/JavaScriptCore/assembler/LinkBuffer.h
index e1dca0b..e38b9d4 100644
--- a/JavaScriptCore/assembler/LinkBuffer.h
+++ b/JavaScriptCore/assembler/LinkBuffer.h
@@ -265,7 +265,7 @@ private:
jumpsToLink.clear();
m_size = writePtr + m_assembler->size() - readPtr;
- m_executablePool->returnLastBytes(initialSize - m_size);
+ m_executablePool->tryShrink(m_code, initialSize, m_size);
#if DUMP_LINK_STATISTICS
dumpLinkStatistics(m_code, initialSize, m_size);
diff --git a/JavaScriptCore/assembler/MIPSAssembler.h b/JavaScriptCore/assembler/MIPSAssembler.h
index f9e40c4..f7bea6c 100644
--- a/JavaScriptCore/assembler/MIPSAssembler.h
+++ b/JavaScriptCore/assembler/MIPSAssembler.h
@@ -193,6 +193,7 @@ public:
}
bool isUsed() const { return m_used; }
+ bool isSet() const { return (m_offset != -1); }
void used() { m_used = true; }
private:
JmpDst(int offset)
diff --git a/JavaScriptCore/assembler/MacroAssembler.h b/JavaScriptCore/assembler/MacroAssembler.h
index ce1be78..fa165de 100644
--- a/JavaScriptCore/assembler/MacroAssembler.h
+++ b/JavaScriptCore/assembler/MacroAssembler.h
@@ -232,7 +232,7 @@ public:
void setPtr(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
void storePtr(RegisterID src, ImplicitAddress address)
diff --git a/JavaScriptCore/assembler/MacroAssemblerARM.h b/JavaScriptCore/assembler/MacroAssemblerARM.h
index c51686a..73390f8 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -628,40 +628,40 @@ public:
m_assembler.bx(linkRegister);
}
- void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
m_assembler.cmp_r(left, right);
m_assembler.mov_r(dest, ARMAssembler::getOp2(0));
m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
}
- void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARMRegisters::S0));
m_assembler.mov_r(dest, ARMAssembler::getOp2(0));
m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
}
- void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
// ARM doesn't have byte registers
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
- void set8(Condition cond, Address left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, Address left, RegisterID right, RegisterID dest)
{
// ARM doesn't have byte registers
load32(left, ARMRegisters::S1);
- set32(cond, ARMRegisters::S1, right, dest);
+ set32Compare32(cond, ARMRegisters::S1, right, dest);
}
- void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
// ARM doesn't have byte registers
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
- void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test32(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
load32(address, ARMRegisters::S1);
if (mask.m_value == -1)
@@ -672,10 +672,10 @@ public:
m_assembler.mov_r(dest, ARMAssembler::getOp2(1), ARMCondition(cond));
}
- void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test8(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
// ARM doesn't have byte registers
- setTest32(cond, address, mask, dest);
+ set32Test32(cond, address, mask, dest);
}
void add32(Imm32 imm, RegisterID src, RegisterID dest)
diff --git a/JavaScriptCore/assembler/MacroAssemblerARMv7.h b/JavaScriptCore/assembler/MacroAssemblerARMv7.h
index d5b4ce7..5980de0 100644
--- a/JavaScriptCore/assembler/MacroAssemblerARMv7.h
+++ b/JavaScriptCore/assembler/MacroAssemblerARMv7.h
@@ -1127,7 +1127,7 @@ public:
m_assembler.bx(linkRegister, ARMv7Assembler::JumpFixed);
}
- void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
m_assembler.cmp(left, right);
m_assembler.it(armV7Condition(cond), false);
@@ -1135,13 +1135,13 @@ public:
m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
}
- void set32(Condition cond, Address left, RegisterID right, RegisterID dest)
+ void set32Compare32(Condition cond, Address left, RegisterID right, RegisterID dest)
{
load32(left, dataTempRegister);
- set32(cond, dataTempRegister, right, dest);
+ set32Compare32(cond, dataTempRegister, right, dest);
}
- void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
compare32(left, right);
m_assembler.it(armV7Condition(cond), false);
@@ -1149,26 +1149,26 @@ public:
m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
}
- void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
- void set8(Condition cond, Address left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, Address left, RegisterID right, RegisterID dest)
{
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
- void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
// FIXME:
// The mask should be optional... paerhaps the argument order should be
// dest-src, operations always have a dest? ... possibly not true, considering
// asm ops like test, or pseudo ops like pop().
- void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test32(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
load32(address, dataTempRegister);
test32(dataTempRegister, mask);
@@ -1177,7 +1177,7 @@ public:
m_assembler.mov(dest, ARMThumbImmediate::makeUInt16(0));
}
- void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test8(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
load8(address, dataTempRegister);
test32(dataTempRegister, mask);
diff --git a/JavaScriptCore/assembler/MacroAssemblerMIPS.h b/JavaScriptCore/assembler/MacroAssemblerMIPS.h
index 3fb2549..41f0152 100644
--- a/JavaScriptCore/assembler/MacroAssemblerMIPS.h
+++ b/JavaScriptCore/assembler/MacroAssemblerMIPS.h
@@ -1372,18 +1372,18 @@ public:
m_assembler.nop();
}
- void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
- set32(cond, left, right, dest);
+ set32Compare32(cond, left, right, dest);
}
- void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
move(right, immTempRegister);
- set32(cond, left, immTempRegister, dest);
+ set32Compare32(cond, left, immTempRegister, dest);
}
- void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
if (cond == Equal || cond == Zero) {
m_assembler.xorInsn(dest, left, right);
@@ -1434,13 +1434,13 @@ public:
}
}
- void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
move(right, immTempRegister);
- set32(cond, left, immTempRegister, dest);
+ set32Compare32(cond, left, immTempRegister, dest);
}
- void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test8(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
ASSERT((cond == Zero) || (cond == NonZero));
load8(address, dataTempRegister);
@@ -1460,7 +1460,7 @@ public:
}
}
- void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test32(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
ASSERT((cond == Zero) || (cond == NonZero));
load32(address, dataTempRegister);
diff --git a/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/JavaScriptCore/assembler/MacroAssemblerX86Common.h
index cb86da7..b6f0b0c 100644
--- a/JavaScriptCore/assembler/MacroAssemblerX86Common.h
+++ b/JavaScriptCore/assembler/MacroAssemblerX86Common.h
@@ -939,19 +939,19 @@ public:
m_assembler.ret();
}
- void set8(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
m_assembler.cmpl_rr(right, left);
m_assembler.setCC_r(x86Condition(cond), dest);
}
- void set8(Condition cond, Address left, RegisterID right, RegisterID dest)
+ void set8Compare32(Condition cond, Address left, RegisterID right, RegisterID dest)
{
m_assembler.cmpl_mr(left.offset, left.base, right);
m_assembler.setCC_r(x86Condition(cond), dest);
}
- void set8(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set8Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
if (((cond == Equal) || (cond == NotEqual)) && !right.m_value)
m_assembler.testl_rr(left, left);
@@ -960,14 +960,14 @@ public:
m_assembler.setCC_r(x86Condition(cond), dest);
}
- void set32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, RegisterID right, RegisterID dest)
{
m_assembler.cmpl_rr(right, left);
m_assembler.setCC_r(x86Condition(cond), dest);
m_assembler.movzbl_rr(dest, dest);
}
- void set32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
+ void set32Compare32(Condition cond, RegisterID left, Imm32 right, RegisterID dest)
{
if (((cond == Equal) || (cond == NotEqual)) && !right.m_value)
m_assembler.testl_rr(left, left);
@@ -982,7 +982,7 @@ public:
// dest-src, operations always have a dest? ... possibly not true, considering
// asm ops like test, or pseudo ops like pop().
- void setTest8(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test8(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
if (mask.m_value == -1)
m_assembler.cmpb_im(0, address.offset, address.base);
@@ -992,7 +992,7 @@ public:
m_assembler.movzbl_rr(dest, dest);
}
- void setTest32(Condition cond, Address address, Imm32 mask, RegisterID dest)
+ void set32Test32(Condition cond, Address address, Imm32 mask, RegisterID dest)
{
if (mask.m_value == -1)
m_assembler.cmpl_im(0, address.offset, address.base);
diff --git a/JavaScriptCore/assembler/X86Assembler.h b/JavaScriptCore/assembler/X86Assembler.h
index 20d72f5..b352ad4 100644
--- a/JavaScriptCore/assembler/X86Assembler.h
+++ b/JavaScriptCore/assembler/X86Assembler.h
@@ -248,6 +248,7 @@ public:
}
bool isUsed() const { return m_used; }
+ bool isSet() const { return (m_offset != -1); }
void used() { m_used = true; }
private:
JmpDst(int offset)