Commit f1b5a4ac authored by haitao.feng@intel.com's avatar haitao.feng@intel.com

Adjust various constants for x32 port

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/216513003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20420 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent bf1155e8
......@@ -43,7 +43,8 @@ namespace internal {
static const byte kCallOpcode = 0xE8;
static const int kNoCodeAgeSequenceLength = 6;
// The length of pushq(rbp), movp(rbp, rsp), Push(rsi) and Push(rdi).
static const int kNoCodeAgeSequenceLength = kPointerSize == kInt64Size ? 6 : 17;
void Assembler::emitl(uint32_t x) {
......
......@@ -2800,17 +2800,19 @@ void InstanceofStub::Generate(MacroAssembler* masm) {
// indicate that the value is not an instance.
static const int kOffsetToMapCheckValue = 2;
static const int kOffsetToResultValue = 18;
static const int kOffsetToResultValue = kPointerSize == kInt64Size ? 18 : 14;
// The last 4 bytes of the instruction sequence
// movq(rdi, FieldOperand(rax, HeapObject::kMapOffset))
// movp(rdi, FieldOperand(rax, HeapObject::kMapOffset))
// Move(kScratchRegister, Factory::the_hole_value())
// in front of the hole value address.
static const unsigned int kWordBeforeMapCheckValue = 0xBA49FF78;
static const unsigned int kWordBeforeMapCheckValue =
kPointerSize == kInt64Size ? 0xBA49FF78 : 0xBA41FF78;
// The last 4 bytes of the instruction sequence
// __ j(not_equal, &cache_miss);
// __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex);
// before the offset of the hole value in the root array.
static const unsigned int kWordBeforeResultValue = 0x458B4906;
static const unsigned int kWordBeforeResultValue =
kPointerSize == kInt64Size ? 0x458B4906 : 0x458B4106;
// Only the inline check flag is supported on X64.
ASSERT(flags_ == kNoFlags || HasCallSiteInlineCheck());
int extra_argument_offset = HasCallSiteInlineCheck() ? 1 : 0;
......
......@@ -438,9 +438,10 @@ void FullCodeGenerator::EmitReturnSequence() {
#ifdef ENABLE_DEBUGGER_SUPPORT
// Add padding that will be overwritten by a debugger breakpoint. We
// have just generated at least 7 bytes: "movq rsp, rbp; pop rbp; ret k"
// (3 + 1 + 3).
const int kPadding = Assembler::kJSReturnSequenceLength - 7;
// have just generated at least 7 bytes: "movp rsp, rbp; pop rbp; ret k"
// (3 + 1 + 3) for x64 and at least 6 (2 + 1 + 3) bytes for x32.
const int kPadding = Assembler::kJSReturnSequenceLength -
kPointerSize == kInt64Size ? 7 : 6;
for (int i = 0; i < kPadding; ++i) {
masm_->int3();
}
......@@ -4843,7 +4844,7 @@ FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
static const byte kJnsInstruction = 0x79;
static const byte kJnsOffset = 0x1d;
static const byte kJnsOffset = kPointerSize == kInt64Size ? 0x1d : 0x14;
static const byte kNopByteOne = 0x66;
static const byte kNopByteTwo = 0x90;
#ifdef DEBUG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment