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

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

Issue 237673007: JumpPatchSites can/should easily deal with uint8 sized offsets. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 // If the instruction following the call is not a test al, nothing 1275 // If the instruction following the call is not a test al, nothing
1276 // was inlined. 1276 // was inlined.
1277 if (*test_instruction_address != Assembler::kTestAlByte) { 1277 if (*test_instruction_address != Assembler::kTestAlByte) {
1278 ASSERT(*test_instruction_address == Assembler::kNopByte); 1278 ASSERT(*test_instruction_address == Assembler::kNopByte);
1279 return; 1279 return;
1280 } 1280 }
1281 1281
1282 Address delta_address = test_instruction_address + 1; 1282 Address delta_address = test_instruction_address + 1;
1283 // The delta to the start of the map check instruction and the 1283 // The delta to the start of the map check instruction and the
1284 // condition code uses at the patched jump. 1284 // condition code uses at the patched jump.
1285 int8_t delta = *reinterpret_cast<int8_t*>(delta_address); 1285 uint8_t delta = *reinterpret_cast<uint8_t*>(delta_address);
1286 if (FLAG_trace_ic) { 1286 if (FLAG_trace_ic) {
1287 PrintF("[ patching ic at %p, test=%p, delta=%d\n", 1287 PrintF("[ patching ic at %p, test=%p, delta=%d\n",
1288 address, test_instruction_address, delta); 1288 address, test_instruction_address, delta);
1289 } 1289 }
1290 1290
1291 // Patch with a short conditional jump. Enabling means switching from a short 1291 // Patch with a short conditional jump. Enabling means switching from a short
1292 // jump-if-carry/not-carry to jump-if-zero/not-zero, whereas disabling is the 1292 // jump-if-carry/not-carry to jump-if-zero/not-zero, whereas disabling is the
1293 // reverse operation of that. 1293 // reverse operation of that.
1294 Address jmp_address = test_instruction_address - delta; 1294 Address jmp_address = test_instruction_address - delta;
1295 ASSERT((check == ENABLE_INLINED_SMI_CHECK) 1295 ASSERT((check == ENABLE_INLINED_SMI_CHECK)
1296 ? (*jmp_address == Assembler::kJncShortOpcode || 1296 ? (*jmp_address == Assembler::kJncShortOpcode ||
1297 *jmp_address == Assembler::kJcShortOpcode) 1297 *jmp_address == Assembler::kJcShortOpcode)
1298 : (*jmp_address == Assembler::kJnzShortOpcode || 1298 : (*jmp_address == Assembler::kJnzShortOpcode ||
1299 *jmp_address == Assembler::kJzShortOpcode)); 1299 *jmp_address == Assembler::kJzShortOpcode));
1300 Condition cc = (check == ENABLE_INLINED_SMI_CHECK) 1300 Condition cc = (check == ENABLE_INLINED_SMI_CHECK)
1301 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1301 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1302 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1302 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1303 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1303 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1304 } 1304 }
1305 1305
1306 1306
1307 } } // namespace v8::internal 1307 } } // namespace v8::internal
1308 1308
1309 #endif // V8_TARGET_ARCH_IA32 1309 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698