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

Side by Side Diff: src/assembler-ia32.cc

Issue 11608: * Added tests for regexp-macro-assembler-ia32. (Closed)
Patch Set: Created 12 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/regexp-macro-assembler-ia32.h » ('j') | src/regexp-macro-assembler-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 420 }
421 421
422 422
423 void Assembler::push(Label* label, RelocInfo::Mode reloc_mode) { 423 void Assembler::push(Label* label, RelocInfo::Mode reloc_mode) {
424 ASSERT_NOT_NULL(label); 424 ASSERT_NOT_NULL(label);
425 EnsureSpace ensure_space(this); 425 EnsureSpace ensure_space(this);
426 last_pc_ = pc_; 426 last_pc_ = pc_;
427 // If reloc_mode == NONE, the label is stored as buffer relative. 427 // If reloc_mode == NONE, the label is stored as buffer relative.
428 ASSERT(reloc_mode == RelocInfo::NONE); 428 ASSERT(reloc_mode == RelocInfo::NONE);
429 if (label->is_bound()) { 429 if (label->is_bound()) {
430 // Index of position in Code object: 430 // Index of position relative to Code Object-pointer.
431 int pos = label->pos() + Code::kHeaderSize; 431 int rel_pos = label->pos() + Code::kHeaderSize - kHeapObjectTag;
432 if (pos >= 0 && pos < 256) { 432 if (rel_pos >= 0 && rel_pos < 256) {
433 EMIT(0x6a); 433 EMIT(0x6a);
434 EMIT(pos); 434 EMIT(rel_pos);
435 } else { 435 } else {
436 EMIT(0x68); 436 EMIT(0x68);
437 emit(pos); 437 emit(rel_pos);
438 } 438 }
439 } else { 439 } else {
440 EMIT(0x68); 440 EMIT(0x68);
441 emit_disp(label, Displacement::CODE_RELATIVE); 441 emit_disp(label, Displacement::CODE_RELATIVE);
442 } 442 }
443 } 443 }
444 444
445 445
446 void Assembler::pop(Register dst) { 446 void Assembler::pop(Register dst) {
447 ASSERT(reloc_info_writer.last_pc() != NULL); 447 ASSERT(reloc_info_writer.last_pc() != NULL);
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 1330
1331 1331
1332 void Assembler::bind_to(Label* L, int pos) { 1332 void Assembler::bind_to(Label* L, int pos) {
1333 EnsureSpace ensure_space(this); 1333 EnsureSpace ensure_space(this);
1334 last_pc_ = NULL; 1334 last_pc_ = NULL;
1335 ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position 1335 ASSERT(0 <= pos && pos <= pc_offset()); // must have a valid binding position
1336 while (L->is_linked()) { 1336 while (L->is_linked()) {
1337 Displacement disp = disp_at(L); 1337 Displacement disp = disp_at(L);
1338 int fixup_pos = L->pos(); 1338 int fixup_pos = L->pos();
1339 if (disp.type() == Displacement::CODE_RELATIVE) { 1339 if (disp.type() == Displacement::CODE_RELATIVE) {
1340 long_at_put(fixup_pos, pos + Code::kHeaderSize); 1340 // Relative to Code* heap object pointer.
1341 long_at_put(fixup_pos, pos + Code::kHeaderSize - kHeapObjectTag);
1341 } else { 1342 } else {
1342 if (disp.type() == Displacement::UNCONDITIONAL_JUMP) { 1343 if (disp.type() == Displacement::UNCONDITIONAL_JUMP) {
1343 ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected 1344 ASSERT(byte_at(fixup_pos - 1) == 0xE9); // jmp expected
1344 } 1345 }
1345 // relative address, relative to point after address 1346 // relative address, relative to point after address
1346 int imm32 = pos - (fixup_pos + sizeof(int32_t)); 1347 int imm32 = pos - (fixup_pos + sizeof(int32_t));
1347 long_at_put(fixup_pos, imm32); 1348 long_at_put(fixup_pos, imm32);
1348 } 1349 }
1349 disp.next(L); 1350 disp.next(L);
1350 } 1351 }
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 ASSERT(bound_label.is_bound()); 2135 ASSERT(bound_label.is_bound());
2135 ASSERT(0 <= position); 2136 ASSERT(0 <= position);
2136 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset()); 2137 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset());
2137 ASSERT(long_at(position) == 0); // only initialize once! 2138 ASSERT(long_at(position) == 0); // only initialize once!
2138 2139
2139 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos())); 2140 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos()));
2140 long_at_put(position, label_loc); 2141 long_at_put(position, label_loc);
2141 } 2142 }
2142 2143
2143 } } // namespace v8::internal 2144 } } // namespace v8::internal
OLDNEW
« 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