summaryrefslogtreecommitdiff
path: root/deps/v8/src/x64/assembler-x64.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-10-01 14:18:59 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-10-01 14:19:11 -0700
commitc9627e0a0d191583e266836b8ce279e6dc527a40 (patch)
treef830b00031cc1d5eed1988d76e0a4647ca0be3a8 /deps/v8/src/x64/assembler-x64.cc
parent5829716649a543f2c7e43859e5c0e32491b61198 (diff)
downloadnode-new-c9627e0a0d191583e266836b8ce279e6dc527a40.tar.gz
Upgrade V8 to 2.4.7
Diffstat (limited to 'deps/v8/src/x64/assembler-x64.cc')
-rw-r--r--deps/v8/src/x64/assembler-x64.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/deps/v8/src/x64/assembler-x64.cc b/deps/v8/src/x64/assembler-x64.cc
index 9318bb8555..6e29b7a5a6 100644
--- a/deps/v8/src/x64/assembler-x64.cc
+++ b/deps/v8/src/x64/assembler-x64.cc
@@ -418,6 +418,20 @@ void Assembler::bind(Label* L) {
}
+void Assembler::bind(NearLabel* L) {
+ ASSERT(!L->is_bound());
+ last_pc_ = NULL;
+ while (L->unresolved_branches_ > 0) {
+ int branch_pos = L->unresolved_positions_[L->unresolved_branches_ - 1];
+ int disp = pc_offset() - branch_pos;
+ ASSERT(is_int8(disp));
+ set_byte_at(branch_pos - sizeof(int8_t), disp);
+ L->unresolved_branches_--;
+ }
+ L->bind_to(pc_offset());
+}
+
+
void Assembler::GrowBuffer() {
ASSERT(buffer_overflow());
if (!own_buffer_) FATAL("external code buffer is too small");
@@ -1227,6 +1241,27 @@ void Assembler::j(Condition cc,
}
+void Assembler::j(Condition cc, NearLabel* L, Hint hint) {
+ EnsureSpace ensure_space(this);
+ last_pc_ = pc_;
+ ASSERT(0 <= cc && cc < 16);
+ if (FLAG_emit_branch_hints && hint != no_hint) emit(hint);
+ if (L->is_bound()) {
+ const int short_size = 2;
+ int offs = L->pos() - pc_offset();
+ ASSERT(offs <= 0);
+ ASSERT(is_int8(offs - short_size));
+ // 0111 tttn #8-bit disp
+ emit(0x70 | cc);
+ emit((offs - short_size) & 0xFF);
+ } else {
+ emit(0x70 | cc);
+ emit(0x00); // The displacement will be resolved later.
+ L->link_to(pc_offset());
+ }
+}
+
+
void Assembler::jmp(Label* L) {
EnsureSpace ensure_space(this);
last_pc_ = pc_;
@@ -1269,6 +1304,25 @@ void Assembler::jmp(Handle<Code> target, RelocInfo::Mode rmode) {
}
+void Assembler::jmp(NearLabel* L) {
+ EnsureSpace ensure_space(this);
+ last_pc_ = pc_;
+ if (L->is_bound()) {
+ const int short_size = sizeof(int8_t);
+ int offs = L->pos() - pc_offset();
+ ASSERT(offs <= 0);
+ ASSERT(is_int8(offs - short_size));
+ // 1110 1011 #8-bit disp.
+ emit(0xEB);
+ emit((offs - short_size) & 0xFF);
+ } else {
+ emit(0xEB);
+ emit(0x00); // The displacement will be resolved later.
+ L->link_to(pc_offset());
+ }
+}
+
+
void Assembler::jmp(Register target) {
EnsureSpace ensure_space(this);
last_pc_ = pc_;