OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 // 0000 1111 1000 tttn #32-bit disp. | 1131 // 0000 1111 1000 tttn #32-bit disp. |
1132 emit(0x0F); | 1132 emit(0x0F); |
1133 emit(0x80 | cc); | 1133 emit(0x80 | cc); |
1134 emit_code_target(target, rmode); | 1134 emit_code_target(target, rmode); |
1135 } | 1135 } |
1136 | 1136 |
1137 | 1137 |
1138 void Assembler::jmp(Label* L) { | 1138 void Assembler::jmp(Label* L) { |
1139 EnsureSpace ensure_space(this); | 1139 EnsureSpace ensure_space(this); |
1140 last_pc_ = pc_; | 1140 last_pc_ = pc_; |
| 1141 const int short_size = sizeof(int8_t); |
| 1142 const int long_size = sizeof(int32_t); |
1141 if (L->is_bound()) { | 1143 if (L->is_bound()) { |
1142 const int short_size = sizeof(int8_t); | |
1143 const int long_size = sizeof(int32_t); | |
1144 int offs = L->pos() - pc_offset() - 1; | 1144 int offs = L->pos() - pc_offset() - 1; |
1145 ASSERT(offs <= 0); | 1145 ASSERT(offs <= 0); |
1146 if (is_int8(offs - short_size)) { | 1146 if (is_int8(offs - short_size)) { |
1147 // 1110 1011 #8-bit disp. | 1147 // 1110 1011 #8-bit disp. |
1148 emit(0xEB); | 1148 emit(0xEB); |
1149 emit((offs - short_size) & 0xFF); | 1149 emit((offs - short_size) & 0xFF); |
1150 } else { | 1150 } else { |
1151 // 1110 1001 #32-bit disp. | 1151 // 1110 1001 #32-bit disp. |
1152 emit(0xE9); | 1152 emit(0xE9); |
1153 emitl(offs - long_size); | 1153 emitl(offs - long_size); |
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2650 written_position_ = current_position_; | 2650 written_position_ = current_position_; |
2651 } | 2651 } |
2652 } | 2652 } |
2653 | 2653 |
2654 | 2654 |
2655 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | | 2655 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | |
2656 1 << RelocInfo::INTERNAL_REFERENCE | | 2656 1 << RelocInfo::INTERNAL_REFERENCE | |
2657 1 << RelocInfo::JS_RETURN; | 2657 1 << RelocInfo::JS_RETURN; |
2658 | 2658 |
2659 } } // namespace v8::internal | 2659 } } // namespace v8::internal |
OLD | NEW |