Chromium Code Reviews

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

Issue 6390001: Add support for deoptimization on x64. ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1260 matching lines...)
1271 emit(0x70 | cc); 1271 emit(0x70 | cc);
1272 emit((offs - short_size) & 0xFF); 1272 emit((offs - short_size) & 0xFF);
1273 } else { 1273 } else {
1274 emit(0x70 | cc); 1274 emit(0x70 | cc);
1275 emit(0x00); // The displacement will be resolved later. 1275 emit(0x00); // The displacement will be resolved later.
1276 L->link_to(pc_offset()); 1276 L->link_to(pc_offset());
1277 } 1277 }
1278 } 1278 }
1279 1279
1280 1280
1281 void Assembler::j(Condition cc, byte* entry, RelocInfo::Mode rmode, Hint hint) {
1282 EnsureSpace ensure_space(this);
1283 RecordRelocInfo(rmode);
1284 last_pc_ = pc_;
1285 ASSERT((0 <= cc) && (cc < 16));
1286 if (FLAG_emit_branch_hints && hint != no_hint) emit(hint);
1287 // 0000 1111 1000 tttn #32-bit disp.
1288 emit(0x0F);
1289 emit(0x80 | cc);
1290 emit(entry - (pc_ + sizeof(intptr_t)));
1291 }
1292
1293
1281 void Assembler::jmp(Label* L) { 1294 void Assembler::jmp(Label* L) {
1282 EnsureSpace ensure_space(this); 1295 EnsureSpace ensure_space(this);
1283 last_pc_ = pc_; 1296 last_pc_ = pc_;
1284 const int short_size = sizeof(int8_t); 1297 const int short_size = sizeof(int8_t);
1285 const int long_size = sizeof(int32_t); 1298 const int long_size = sizeof(int32_t);
1286 if (L->is_bound()) { 1299 if (L->is_bound()) {
1287 int offs = L->pos() - pc_offset() - 1; 1300 int offs = L->pos() - pc_offset() - 1;
1288 ASSERT(offs <= 0); 1301 ASSERT(offs <= 0);
1289 if (is_int8(offs - short_size)) { 1302 if (is_int8(offs - short_size)) {
1290 // 1110 1011 #8-bit disp. 1303 // 1110 1011 #8-bit disp.
(...skipping 651 matching lines...)
1942 if (is_int8(value.value_)) { 1955 if (is_int8(value.value_)) {
1943 emit(0x6A); 1956 emit(0x6A);
1944 emit(value.value_); // Emit low byte of value. 1957 emit(value.value_); // Emit low byte of value.
1945 } else { 1958 } else {
1946 emit(0x68); 1959 emit(0x68);
1947 emitl(value.value_); 1960 emitl(value.value_);
1948 } 1961 }
1949 } 1962 }
1950 1963
1951 1964
1965 void Assembler::push_imm32(int32_t imm32) {
1966 EnsureSpace ensure_space(this);
1967 last_pc_ = pc_;
1968 emit(0x68);
1969 emitl(imm32);
1970 }
1971
1972
1952 void Assembler::pushfq() { 1973 void Assembler::pushfq() {
1953 EnsureSpace ensure_space(this); 1974 EnsureSpace ensure_space(this);
1954 last_pc_ = pc_; 1975 last_pc_ = pc_;
1955 emit(0x9C); 1976 emit(0x9C);
1956 } 1977 }
1957 1978
1958 1979
1959 void Assembler::rdtsc() { 1980 void Assembler::rdtsc() {
1960 EnsureSpace ensure_space(this); 1981 EnsureSpace ensure_space(this);
1961 last_pc_ = pc_; 1982 last_pc_ = pc_;
(...skipping 1045 matching lines...)
3007 // specially coded on x64 means that it is a relative 32 bit address, as used 3028 // specially coded on x64 means that it is a relative 32 bit address, as used
3008 // by branch instructions. 3029 // by branch instructions.
3009 return (1 << rmode_) & kApplyMask; 3030 return (1 << rmode_) & kApplyMask;
3010 } 3031 }
3011 3032
3012 3033
3013 3034
3014 } } // namespace v8::internal 3035 } } // namespace v8::internal
3015 3036
3016 #endif // V8_TARGET_ARCH_X64 3037 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine