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

Side by Side Diff: runtime/vm/assembler_x64.h

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 7 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 | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/compiler.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_ASSEMBLER_X64_H_ 5 #ifndef VM_ASSEMBLER_X64_H_
6 #define VM_ASSEMBLER_X64_H_ 6 #define VM_ASSEMBLER_X64_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_x64.h directly; use assembler.h instead. 9 #error Do not include assembler_x64.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 memmove(&encoding_[0], &other.encoding_[0], other.length_); 84 memmove(&encoding_[0], &other.encoding_[0], other.length_);
85 } 85 }
86 86
87 Operand& operator=(const Operand& other) { 87 Operand& operator=(const Operand& other) {
88 length_ = other.length_; 88 length_ = other.length_;
89 rex_ = other.rex_; 89 rex_ = other.rex_;
90 memmove(&encoding_[0], &other.encoding_[0], other.length_); 90 memmove(&encoding_[0], &other.encoding_[0], other.length_);
91 return *this; 91 return *this;
92 } 92 }
93 93
94 bool Equals(const Operand& other) {
95 if (length_ != other.length_) return false;
96 if (rex_ != other.rex_) return false;
97 for (uint8_t i = 0; i < length_; i++) {
98 if (encoding_[i] != other.encoding_[i]) return false;
99 }
100 return true;
101 }
102
94 protected: 103 protected:
95 Operand() : length_(0), rex_(REX_NONE) { } // Needed by subclass Address. 104 Operand() : length_(0), rex_(REX_NONE) { } // Needed by subclass Address.
96 105
97 void SetModRM(int mod, Register rm) { 106 void SetModRM(int mod, Register rm) {
98 ASSERT((mod & ~3) == 0); 107 ASSERT((mod & ~3) == 0);
99 if ((rm > 7) && !((rm == R12) && (mod != 3))) { 108 if ((rm > 7) && !((rm == R12) && (mod != 3))) {
100 rex_ |= REX_B; 109 rex_ |= REX_B;
101 } 110 }
102 encoding_[0] = (mod << 6) | (rm & 7); 111 encoding_[0] = (mod << 6) | (rm & 7);
103 length_ = 1; 112 length_ = 1;
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 } 918 }
910 919
911 920
912 inline void Assembler::EmitOperandSizeOverride() { 921 inline void Assembler::EmitOperandSizeOverride() {
913 EmitUint8(0x66); 922 EmitUint8(0x66);
914 } 923 }
915 924
916 } // namespace dart 925 } // namespace dart
917 926
918 #endif // VM_ASSEMBLER_X64_H_ 927 #endif // VM_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698