summaryrefslogtreecommitdiff
path: root/deps/v8/src/arm/disasm-arm.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-07-05 14:40:13 -0700
committerRyan Dahl <ry@tinyclouds.org>2011-07-05 14:51:29 -0700
commit149562555c9bf56457dee9a1ad70c53ed670a776 (patch)
treef6217cf3c54ddbee03f37247a3c7c75203f868fd /deps/v8/src/arm/disasm-arm.cc
parentf08720606757577d95bd09b48697c7decbf17f00 (diff)
downloadnode-new-149562555c9bf56457dee9a1ad70c53ed670a776.tar.gz
Downgrade V8 to 3.1.8.25
There are serious performance regressions both in V8 and our own legacy networking stack. Until we correct our own problems we are going back to the old V8.
Diffstat (limited to 'deps/v8/src/arm/disasm-arm.cc')
-rw-r--r--deps/v8/src/arm/disasm-arm.cc145
1 files changed, 39 insertions, 106 deletions
diff --git a/deps/v8/src/arm/disasm-arm.cc b/deps/v8/src/arm/disasm-arm.cc
index d4bd81ce46..08f605b164 100644
--- a/deps/v8/src/arm/disasm-arm.cc
+++ b/deps/v8/src/arm/disasm-arm.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 the V8 project authors. All rights reserved.
+// Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -89,9 +89,6 @@ class Decoder {
// Returns the length of the disassembled machine instruction in bytes.
int InstructionDecode(byte* instruction);
- static bool IsConstantPoolAt(byte* instr_ptr);
- static int ConstantPoolSizeAt(byte* instr_ptr);
-
private:
// Bottleneck functions to print into the out_buffer.
void PrintChar(const char ch);
@@ -371,34 +368,25 @@ int Decoder::FormatRegister(Instruction* instr, const char* format) {
int Decoder::FormatVFPRegister(Instruction* instr, const char* format) {
ASSERT((format[0] == 'S') || (format[0] == 'D'));
- VFPRegPrecision precision =
- format[0] == 'D' ? kDoublePrecision : kSinglePrecision;
-
- int retval = 2;
- int reg = -1;
if (format[1] == 'n') {
- reg = instr->VFPNRegValue(precision);
+ int reg = instr->VnValue();
+ if (format[0] == 'S') PrintSRegister(((reg << 1) | instr->NValue()));
+ if (format[0] == 'D') PrintDRegister(reg);
+ return 2;
} else if (format[1] == 'm') {
- reg = instr->VFPMRegValue(precision);
+ int reg = instr->VmValue();
+ if (format[0] == 'S') PrintSRegister(((reg << 1) | instr->MValue()));
+ if (format[0] == 'D') PrintDRegister(reg);
+ return 2;
} else if (format[1] == 'd') {
- reg = instr->VFPDRegValue(precision);
- if (format[2] == '+') {
- int immed8 = instr->Immed8Value();
- if (format[0] == 'S') reg += immed8 - 1;
- if (format[0] == 'D') reg += (immed8 / 2 - 1);
- }
- if (format[2] == '+') retval = 3;
- } else {
- UNREACHABLE();
- }
-
- if (precision == kSinglePrecision) {
- PrintSRegister(reg);
- } else {
- PrintDRegister(reg);
+ int reg = instr->VdValue();
+ if (format[0] == 'S') PrintSRegister(((reg << 1) | instr->DValue()));
+ if (format[0] == 'D') PrintDRegister(reg);
+ return 2;
}
- return retval;
+ UNREACHABLE();
+ return -1;
}
@@ -502,16 +490,13 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
ASSERT(STRING_STARTS_WITH(format, "memop"));
if (instr->HasL()) {
Print("ldr");
- } else {
- if ((instr->Bits(27, 25) == 0) && (instr->Bit(20) == 0) &&
- (instr->Bits(7, 6) == 3) && (instr->Bit(4) == 1)) {
- if (instr->Bit(5) == 1) {
- Print("strd");
- } else {
- Print("ldrd");
- }
- return 5;
+ } else if ((instr->Bits(27, 25) == 0) && (instr->Bit(20) == 0)) {
+ if (instr->Bits(7, 4) == 0xf) {
+ Print("strd");
+ } else {
+ Print("ldrd");
}
+ } else {
Print("str");
}
return 5;
@@ -914,7 +899,6 @@ void Decoder::DecodeType2(Instruction* instr) {
case da_x: {
if (instr->HasW()) {
Unknown(instr); // not used in V8
- return;
}
Format(instr, "'memop'cond'b 'rd, ['rn], #-'off12");
break;
@@ -922,7 +906,6 @@ void Decoder::DecodeType2(Instruction* instr) {
case ia_x: {
if (instr->HasW()) {
Unknown(instr); // not used in V8
- return;
}
Format(instr, "'memop'cond'b 'rd, ['rn], #+'off12");
break;
@@ -1009,15 +992,11 @@ void Decoder::DecodeType3(Instruction* instr) {
void Decoder::DecodeType4(Instruction* instr) {
- if (instr->Bit(22) != 0) {
- // Privileged mode currently not supported.
- Unknown(instr);
+ ASSERT(instr->Bit(22) == 0); // Privileged mode currently not supported.
+ if (instr->HasL()) {
+ Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
} else {
- if (instr->HasL()) {
- Format(instr, "ldm'cond'pu 'rn'w, 'rlist");
- } else {
- Format(instr, "stm'cond'pu 'rn'w, 'rlist");
- }
+ Format(instr, "stm'cond'pu 'rn'w, 'rlist");
}
}
@@ -1063,8 +1042,6 @@ int Decoder::DecodeType7(Instruction* instr) {
// vmov: Rt = Sn
// vcvt: Dd = Sm
// vcvt: Sd = Dm
-// Dd = vabs(Dm)
-// Dd = vneg(Dm)
// Dd = vadd(Dn, Dm)
// Dd = vsub(Dn, Dm)
// Dd = vmul(Dn, Dm)
@@ -1089,10 +1066,7 @@ void Decoder::DecodeTypeVFP(Instruction* instr) {
}
} else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) {
// vabs
- Format(instr, "vabs.f64'cond 'Dd, 'Dm");
- } else if ((instr->Opc2Value() == 0x1) && (instr->Opc3Value() == 0x1)) {
- // vneg
- Format(instr, "vneg.f64'cond 'Dd, 'Dm");
+ Format(instr, "vabs'cond 'Dd, 'Dm");
} else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) {
DecodeVCVTBetweenDoubleAndSingle(instr);
} else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) {
@@ -1285,22 +1259,9 @@ void Decoder::DecodeType6CoprocessorIns(Instruction* instr) {
Format(instr, "vstr'cond 'Sd, ['rn + 4*'imm08@00]");
}
break;
- case 0x4:
- case 0x5:
- case 0x6:
- case 0x7:
- case 0x9:
- case 0xB: {
- bool to_vfp_register = (instr->VLValue() == 0x1);
- if (to_vfp_register) {
- Format(instr, "vldm'cond'pu 'rn'w, {'Sd-'Sd+}");
- } else {
- Format(instr, "vstm'cond'pu 'rn'w, {'Sd-'Sd+}");
- }
- break;
- }
default:
Unknown(instr); // Not used by V8.
+ break;
}
} else if (instr->CoprocessorValue() == 0xB) {
switch (instr->OpcodeValue()) {
@@ -1328,38 +1289,12 @@ void Decoder::DecodeType6CoprocessorIns(Instruction* instr) {
Format(instr, "vstr'cond 'Dd, ['rn + 4*'imm08@00]");
}
break;
- case 0x4:
- case 0x5:
- case 0x9: {
- bool to_vfp_register = (instr->VLValue() == 0x1);
- if (to_vfp_register) {
- Format(instr, "vldm'cond'pu 'rn'w, {'Dd-'Dd+}");
- } else {
- Format(instr, "vstm'cond'pu 'rn'w, {'Dd-'Dd+}");
- }
- break;
- }
default:
Unknown(instr); // Not used by V8.
+ break;
}
} else {
- Unknown(instr); // Not used by V8.
- }
-}
-
-
-bool Decoder::IsConstantPoolAt(byte* instr_ptr) {
- int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
- return (instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker;
-}
-
-
-int Decoder::ConstantPoolSizeAt(byte* instr_ptr) {
- if (IsConstantPoolAt(instr_ptr)) {
- int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
- return instruction_bits & kConstantPoolLengthMask;
- } else {
- return -1;
+ UNIMPLEMENTED(); // Not used by V8.
}
}
@@ -1372,15 +1307,7 @@ int Decoder::InstructionDecode(byte* instr_ptr) {
"%08x ",
instr->InstructionBits());
if (instr->ConditionField() == kSpecialCondition) {
- Unknown(instr);
- return Instruction::kInstrSize;
- }
- int instruction_bits = *(reinterpret_cast<int*>(instr_ptr));
- if ((instruction_bits & kConstantPoolMarkerMask) == kConstantPoolMarker) {
- out_buffer_pos_ += OS::SNPrintF(out_buffer_ + out_buffer_pos_,
- "constant pool begin (length %d)",
- instruction_bits &
- kConstantPoolLengthMask);
+ UNIMPLEMENTED();
return Instruction::kInstrSize;
}
switch (instr->TypeValue()) {
@@ -1432,8 +1359,9 @@ namespace disasm {
const char* NameConverter::NameOfAddress(byte* addr) const {
- v8::internal::OS::SNPrintF(tmp_buffer_, "%p", addr);
- return tmp_buffer_.start();
+ static v8::internal::EmbeddedVector<char, 32> tmp_buffer;
+ v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr);
+ return tmp_buffer.start();
}
@@ -1483,7 +1411,12 @@ int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
int Disassembler::ConstantPoolSizeAt(byte* instruction) {
- return v8::internal::Decoder::ConstantPoolSizeAt(instruction);
+ int instruction_bits = *(reinterpret_cast<int*>(instruction));
+ if ((instruction_bits & 0xfff00000) == 0x03000000) {
+ return instruction_bits & 0x0000ffff;
+ } else {
+ return -1;
+ }
}