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

Unified Diff: src/assembler-ia32.cc

Issue 11608: * Added tests for regexp-macro-assembler-ia32. (Closed)
Patch Set: Created 12 years, 1 month 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 | src/regexp-macro-assembler-ia32.h » ('j') | src/regexp-macro-assembler-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler-ia32.cc
diff --git a/src/assembler-ia32.cc b/src/assembler-ia32.cc
index 1555ecc2da46ac1246315876e61e9d352b80ced6..b2d3b04c6f15626cb0ed266861a292ce7f36ac3e 100644
--- a/src/assembler-ia32.cc
+++ b/src/assembler-ia32.cc
@@ -427,14 +427,14 @@ void Assembler::push(Label* label, RelocInfo::Mode reloc_mode) {
// If reloc_mode == NONE, the label is stored as buffer relative.
ASSERT(reloc_mode == RelocInfo::NONE);
if (label->is_bound()) {
- // Index of position in Code object:
- int pos = label->pos() + Code::kHeaderSize;
- if (pos >= 0 && pos < 256) {
+ // Index of position relative to Code Object-pointer.
+ int rel_pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
+ if (rel_pos >= 0 && rel_pos < 256) {
EMIT(0x6a);
- EMIT(pos);
+ EMIT(rel_pos);
} else {
EMIT(0x68);
- emit(pos);
+ emit(rel_pos);
}
} else {
EMIT(0x68);
@@ -1337,7 +1337,8 @@ void Assembler::bind_to(Label* L, int pos) {
Displacement disp = disp_at(L);
int fixup_pos = L->pos();
if (disp.type() == Displacement::CODE_RELATIVE) {
- long_at_put(fixup_pos, pos + Code::kHeaderSize);
+ // Relative to Code* heap object pointer.
+ long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
} else {
if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
« no previous file with comments | « no previous file | src/regexp-macro-assembler-ia32.h » ('j') | src/regexp-macro-assembler-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698