From 4e3fc717861ad27d8840ef7d1206bdf9c1655bfe Mon Sep 17 00:00:00 2001 From: "ricow@chromium.org" Date: Wed, 14 Apr 2010 08:54:08 +0000 Subject: [PATCH] Create const ints for int8_t and int32_t in jmp assembler (making win64 build happy) Review URL: http://codereview.chromium.org/1637009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4408 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/assembler-x64.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc index 136431f218..618a32188a 100644 --- a/src/x64/assembler-x64.cc +++ b/src/x64/assembler-x64.cc @@ -1139,22 +1139,24 @@ void Assembler::jmp(Label* L) { EnsureSpace ensure_space(this); last_pc_ = pc_; if (L->is_bound()) { + const int short_size = sizeof(int8_t); + const int long_size = sizeof(int32_t); int offs = L->pos() - pc_offset() - 1; ASSERT(offs <= 0); - if (is_int8(offs - sizeof(int8_t))) { + if (is_int8(offs - short_size)) { // 1110 1011 #8-bit disp. emit(0xEB); - emit((offs - sizeof(int8_t)) & 0xFF); + emit((offs - short_size) & 0xFF); } else { // 1110 1001 #32-bit disp. emit(0xE9); - emitl(offs - sizeof(int32_t)); + emitl(offs - long_size); } } else if (L->is_linked()) { // 1110 1001 #32-bit disp. emit(0xE9); emitl(L->pos()); - L->link_to(pc_offset() - sizeof(int32_t)); + L->link_to(pc_offset() - long_size); } else { // 1110 1001 #32-bit disp. ASSERT(L->is_unused());