Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: src/ia32/assembler-ia32.cc

Issue 8081016: Shorter opcodes in ia32 in some cases where register is wrapped in an operand. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: minor change. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.cc
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc
index b4eb0658a626939113e555c44e5e7fdf023e3655..b9e8ed9b067202e35cbcbf810d705a85bdaf643b 100644
--- a/src/ia32/assembler-ia32.cc
+++ b/src/ia32/assembler-ia32.cc
@@ -457,6 +457,10 @@ void Assembler::push(Register src) {
void Assembler::push(const Operand& src) {
+ if (src.is_reg_only()) {
+ push(src.reg());
+ return;
+ }
EnsureSpace ensure_space(this);
EMIT(0xFF);
emit_operand(esi, src);
@@ -478,6 +482,10 @@ void Assembler::pop(Register dst) {
void Assembler::pop(const Operand& dst) {
+ if (dst.is_reg_only()) {
+ pop(dst.reg());
+ return;
+ }
EnsureSpace ensure_space(this);
EMIT(0x8F);
emit_operand(eax, dst);
@@ -560,6 +568,10 @@ void Assembler::mov(Register dst, Handle<Object> handle) {
void Assembler::mov(Register dst, const Operand& src) {
+ if (src.is_reg_only()) {
+ mov(dst, src.reg());
+ return;
+ }
EnsureSpace ensure_space(this);
EMIT(0x8B);
emit_operand(dst, src);
@@ -865,6 +877,10 @@ void Assembler::dec(Register dst) {
void Assembler::dec(const Operand& dst) {
+ if (dst.is_reg_only()) {
+ dec(dst.reg());
+ return;
+ }
EnsureSpace ensure_space(this);
EMIT(0xFF);
emit_operand(ecx, dst);
@@ -920,6 +936,10 @@ void Assembler::inc(Register dst) {
void Assembler::inc(const Operand& dst) {
+ if (dst.is_reg_only()) {
+ inc(dst.reg());
+ return;
+ }
EnsureSpace ensure_space(this);
EMIT(0xFF);
emit_operand(eax, dst);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698