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

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

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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/builtins-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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Create a code patcher. 103 // Create a code patcher.
104 CodePatcher patcher(pc_, code_size); 104 CodePatcher patcher(pc_, code_size);
105 105
106 // Add a label for checking the size of the code used for returning. 106 // Add a label for checking the size of the code used for returning.
107 #ifdef DEBUG 107 #ifdef DEBUG
108 Label check_codesize; 108 Label check_codesize;
109 patcher.masm()->bind(&check_codesize); 109 patcher.masm()->bind(&check_codesize);
110 #endif 110 #endif
111 111
112 // Patch the code. 112 // Patch the code.
113 patcher.masm()->movp(kScratchRegister, target, RelocInfo::NONE64); 113 patcher.masm()->movp(kScratchRegister, target, Assembler::RelocInfoNone());
114 patcher.masm()->call(kScratchRegister); 114 patcher.masm()->call(kScratchRegister);
115 115
116 // Check that the size of the code generated is as expected. 116 // Check that the size of the code generated is as expected.
117 ASSERT_EQ(Assembler::kCallSequenceLength, 117 ASSERT_EQ(Assembler::kCallSequenceLength,
118 patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize)); 118 patcher.masm()->SizeOfCodeGeneratedSince(&check_codesize));
119 119
120 // Add the requested number of int3 instructions after the call. 120 // Add the requested number of int3 instructions after the call.
121 for (int i = 0; i < guard_bytes; i++) { 121 for (int i = 0; i < guard_bytes; i++) {
122 patcher.masm()->int3(); 122 patcher.masm()->int3();
123 } 123 }
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 743
744 void Assembler::bts(const Operand& dst, Register src) { 744 void Assembler::bts(const Operand& dst, Register src) {
745 EnsureSpace ensure_space(this); 745 EnsureSpace ensure_space(this);
746 emit_rex_64(src, dst); 746 emit_rex_64(src, dst);
747 emit(0x0F); 747 emit(0x0F);
748 emit(0xAB); 748 emit(0xAB);
749 emit_operand(src, dst); 749 emit_operand(src, dst);
750 } 750 }
751 751
752 752
753 void Assembler::bsrl(Register dst, Register src) {
754 EnsureSpace ensure_space(this);
755 emit_optional_rex_32(dst, src);
756 emit(0x0F);
757 emit(0xBD);
758 emit_modrm(dst, src);
759 }
760
761
753 void Assembler::call(Label* L) { 762 void Assembler::call(Label* L) {
754 positions_recorder()->WriteRecordedPositions(); 763 positions_recorder()->WriteRecordedPositions();
755 EnsureSpace ensure_space(this); 764 EnsureSpace ensure_space(this);
756 // 1110 1000 #32-bit disp. 765 // 1110 1000 #32-bit disp.
757 emit(0xE8); 766 emit(0xE8);
758 if (L->is_bound()) { 767 if (L->is_bound()) {
759 int offset = L->pos() - pc_offset() - sizeof(int32_t); 768 int offset = L->pos() - pc_offset() - sizeof(int32_t);
760 ASSERT(offset <= 0); 769 ASSERT(offset <= 0);
761 emitl(offset); 770 emitl(offset);
762 } else if (L->is_linked()) { 771 } else if (L->is_linked()) {
(...skipping 2418 matching lines...) Expand 10 before | Expand all | Expand 10 after
3181 bool RelocInfo::IsCodedSpecially() { 3190 bool RelocInfo::IsCodedSpecially() {
3182 // The deserializer needs to know whether a pointer is specially coded. Being 3191 // The deserializer needs to know whether a pointer is specially coded. Being
3183 // specially coded on x64 means that it is a relative 32 bit address, as used 3192 // specially coded on x64 means that it is a relative 32 bit address, as used
3184 // by branch instructions. 3193 // by branch instructions.
3185 return (1 << rmode_) & kApplyMask; 3194 return (1 << rmode_) & kApplyMask;
3186 } 3195 }
3187 3196
3188 } } // namespace v8::internal 3197 } } // namespace v8::internal
3189 3198
3190 #endif // V8_TARGET_ARCH_X64 3199 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698