| OLD | NEW | 
|     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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1416  |  1416  | 
|  1417  |  1417  | 
|  1418 void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) { |  1418 void Assembler::jmp(Handle<Code> code, RelocInfo::Mode rmode) { | 
|  1419   EnsureSpace ensure_space(this); |  1419   EnsureSpace ensure_space(this); | 
|  1420   ASSERT(RelocInfo::IsCodeTarget(rmode)); |  1420   ASSERT(RelocInfo::IsCodeTarget(rmode)); | 
|  1421   EMIT(0xE9); |  1421   EMIT(0xE9); | 
|  1422   emit(reinterpret_cast<intptr_t>(code.location()), rmode); |  1422   emit(reinterpret_cast<intptr_t>(code.location()), rmode); | 
|  1423 } |  1423 } | 
|  1424  |  1424  | 
|  1425  |  1425  | 
|  1426 void Assembler::j(Condition cc, Label* L, Hint hint, Label::Distance distance) { |  1426 void Assembler::j(Condition cc, Label* L, Label::Distance distance) { | 
|  1427   EnsureSpace ensure_space(this); |  1427   EnsureSpace ensure_space(this); | 
|  1428   ASSERT(0 <= cc && cc < 16); |  1428   ASSERT(0 <= cc && cc < 16); | 
|  1429   if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint); |  | 
|  1430   if (L->is_bound()) { |  1429   if (L->is_bound()) { | 
|  1431     const int short_size = 2; |  1430     const int short_size = 2; | 
|  1432     const int long_size  = 6; |  1431     const int long_size  = 6; | 
|  1433     int offs = L->pos() - pc_offset(); |  1432     int offs = L->pos() - pc_offset(); | 
|  1434     ASSERT(offs <= 0); |  1433     ASSERT(offs <= 0); | 
|  1435     if (is_int8(offs - short_size)) { |  1434     if (is_int8(offs - short_size)) { | 
|  1436       // 0111 tttn #8-bit disp |  1435       // 0111 tttn #8-bit disp | 
|  1437       EMIT(0x70 | cc); |  1436       EMIT(0x70 | cc); | 
|  1438       EMIT((offs - short_size) & 0xFF); |  1437       EMIT((offs - short_size) & 0xFF); | 
|  1439     } else { |  1438     } else { | 
|  1440       // 0000 1111 1000 tttn #32-bit disp |  1439       // 0000 1111 1000 tttn #32-bit disp | 
|  1441       EMIT(0x0F); |  1440       EMIT(0x0F); | 
|  1442       EMIT(0x80 | cc); |  1441       EMIT(0x80 | cc); | 
|  1443       emit(offs - long_size); |  1442       emit(offs - long_size); | 
|  1444     } |  1443     } | 
|  1445   } else if (distance == Label::kNear) { |  1444   } else if (distance == Label::kNear) { | 
|  1446     EMIT(0x70 | cc); |  1445     EMIT(0x70 | cc); | 
|  1447     emit_near_disp(L); |  1446     emit_near_disp(L); | 
|  1448   } else { |  1447   } else { | 
|  1449     // 0000 1111 1000 tttn #32-bit disp |  1448     // 0000 1111 1000 tttn #32-bit disp | 
|  1450     // Note: could eliminate cond. jumps to this jump if condition |  1449     // Note: could eliminate cond. jumps to this jump if condition | 
|  1451     //       is the same however, seems to be rather unlikely case. |  1450     //       is the same however, seems to be rather unlikely case. | 
|  1452     EMIT(0x0F); |  1451     EMIT(0x0F); | 
|  1453     EMIT(0x80 | cc); |  1452     EMIT(0x80 | cc); | 
|  1454     emit_disp(L, Displacement::OTHER); |  1453     emit_disp(L, Displacement::OTHER); | 
|  1455   } |  1454   } | 
|  1456 } |  1455 } | 
|  1457  |  1456  | 
|  1458  |  1457  | 
|  1459 void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) { |  1458 void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode) { | 
|  1460   EnsureSpace ensure_space(this); |  1459   EnsureSpace ensure_space(this); | 
|  1461   ASSERT((0 <= cc) && (cc < 16)); |  1460   ASSERT((0 <= cc) && (cc < 16)); | 
|  1462   if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint); |  | 
|  1463   // 0000 1111 1000 tttn #32-bit disp. |  1461   // 0000 1111 1000 tttn #32-bit disp. | 
|  1464   EMIT(0x0F); |  1462   EMIT(0x0F); | 
|  1465   EMIT(0x80 | cc); |  1463   EMIT(0x80 | cc); | 
|  1466   emit(entry - (pc_ + sizeof(int32_t)), rmode); |  1464   emit(entry - (pc_ + sizeof(int32_t)), rmode); | 
|  1467 } |  1465 } | 
|  1468  |  1466  | 
|  1469  |  1467  | 
|  1470 void Assembler::j(Condition cc, Handle<Code> code, Hint hint) { |  1468 void Assembler::j(Condition cc, Handle<Code> code) { | 
|  1471   EnsureSpace ensure_space(this); |  1469   EnsureSpace ensure_space(this); | 
|  1472   if (FLAG_emit_branch_hints && hint != no_hint) EMIT(hint); |  | 
|  1473   // 0000 1111 1000 tttn #32-bit disp |  1470   // 0000 1111 1000 tttn #32-bit disp | 
|  1474   EMIT(0x0F); |  1471   EMIT(0x0F); | 
|  1475   EMIT(0x80 | cc); |  1472   EMIT(0x80 | cc); | 
|  1476   emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET); |  1473   emit(reinterpret_cast<intptr_t>(code.location()), RelocInfo::CODE_TARGET); | 
|  1477 } |  1474 } | 
|  1478  |  1475  | 
|  1479  |  1476  | 
|  1480 // FPU instructions. |  1477 // FPU instructions. | 
|  1481  |  1478  | 
|  1482 void Assembler::fld(int i) { |  1479 void Assembler::fld(int i) { | 
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2481     fprintf(coverage_log, "%s\n", file_line); |  2478     fprintf(coverage_log, "%s\n", file_line); | 
|  2482     fflush(coverage_log); |  2479     fflush(coverage_log); | 
|  2483   } |  2480   } | 
|  2484 } |  2481 } | 
|  2485  |  2482  | 
|  2486 #endif |  2483 #endif | 
|  2487  |  2484  | 
|  2488 } }  // namespace v8::internal |  2485 } }  // namespace v8::internal | 
|  2489  |  2486  | 
|  2490 #endif  // V8_TARGET_ARCH_IA32 |  2487 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW |