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

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

Issue 6347067: Fix potential overwriting of debug jumps of following code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-x64
Patch Set: Addressed review comments. Created 9 years, 10 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/x64/assembler-x64.h ('k') | src/x64/deoptimizer-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 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 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 positions_recorder()->WriteRecordedPositions(); 909 positions_recorder()->WriteRecordedPositions();
910 EnsureSpace ensure_space(this); 910 EnsureSpace ensure_space(this);
911 last_pc_ = pc_; 911 last_pc_ = pc_;
912 // Opcode: FF /2 m64. 912 // Opcode: FF /2 m64.
913 emit_optional_rex_32(op); 913 emit_optional_rex_32(op);
914 emit(0xFF); 914 emit(0xFF);
915 emit_operand(0x2, op); 915 emit_operand(0x2, op);
916 } 916 }
917 917
918 918
919 // Calls directly to the given address using a relative offset.
920 // Should only ever be used in Code objects for calls within the
921 // same Code object. Should not be used when generating new code (use labels),
922 // but only when patching existing code.
923 void Assembler::call(Address target) {
924 positions_recorder()->WriteRecordedPositions();
925 EnsureSpace ensure_space(this);
926 last_pc_ = pc_;
927 // 1110 1000 #32-bit disp.
928 emit(0xE8);
929 Address source = pc_ + 4;
930 intptr_t displacement = target - source;
931 ASSERT(is_int32(displacement));
932 emitl(static_cast<int32_t>(displacement));
933 }
934
935
919 void Assembler::clc() { 936 void Assembler::clc() {
920 EnsureSpace ensure_space(this); 937 EnsureSpace ensure_space(this);
921 last_pc_ = pc_; 938 last_pc_ = pc_;
922 emit(0xF8); 939 emit(0xF8);
923 } 940 }
924 941
925 void Assembler::cdq() { 942 void Assembler::cdq() {
926 EnsureSpace ensure_space(this); 943 EnsureSpace ensure_space(this);
927 last_pc_ = pc_; 944 last_pc_ = pc_;
928 emit(0x99); 945 emit(0x99);
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3089 // specially coded on x64 means that it is a relative 32 bit address, as used 3106 // specially coded on x64 means that it is a relative 32 bit address, as used
3090 // by branch instructions. 3107 // by branch instructions.
3091 return (1 << rmode_) & kApplyMask; 3108 return (1 << rmode_) & kApplyMask;
3092 } 3109 }
3093 3110
3094 3111
3095 3112
3096 } } // namespace v8::internal 3113 } } // namespace v8::internal
3097 3114
3098 #endif // V8_TARGET_ARCH_X64 3115 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698