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

Side by Side Diff: src/mips/code-stubs-mips.h

Issue 7342042: Disentangle printing of stub names and memory allocation. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 }; 59 };
60 60
61 61
62 class UnaryOpStub: public CodeStub { 62 class UnaryOpStub: public CodeStub {
63 public: 63 public:
64 UnaryOpStub(Token::Value op, 64 UnaryOpStub(Token::Value op,
65 UnaryOverwriteMode mode, 65 UnaryOverwriteMode mode,
66 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) 66 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED)
67 : op_(op), 67 : op_(op),
68 mode_(mode), 68 mode_(mode),
69 operand_type_(operand_type), 69 operand_type_(operand_type) {
70 name_(NULL) {
71 } 70 }
72 71
73 private: 72 private:
74 Token::Value op_; 73 Token::Value op_;
75 UnaryOverwriteMode mode_; 74 UnaryOverwriteMode mode_;
76 75
77 // Operand type information determined at runtime. 76 // Operand type information determined at runtime.
78 UnaryOpIC::TypeInfo operand_type_; 77 UnaryOpIC::TypeInfo operand_type_;
79 78
80 char* name_; 79 virtual void PrintName(StringStream* stream);
81
82 virtual const char* GetName();
83
84 #ifdef DEBUG
85 void Print() {
86 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n",
87 MinorKey(),
88 Token::String(op_),
89 static_cast<int>(mode_),
90 UnaryOpIC::GetName(operand_type_));
91 }
92 #endif
93 80
94 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; 81 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {};
95 class OpBits: public BitField<Token::Value, 1, 7> {}; 82 class OpBits: public BitField<Token::Value, 1, 7> {};
96 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; 83 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {};
97 84
98 Major MajorKey() { return UnaryOp; } 85 Major MajorKey() { return UnaryOp; }
99 int MinorKey() { 86 int MinorKey() {
100 return ModeBits::encode(mode_) 87 return ModeBits::encode(mode_)
101 | OpBits::encode(op_) 88 | OpBits::encode(op_)
102 | OperandTypeInfoBits::encode(operand_type_); 89 | OperandTypeInfoBits::encode(operand_type_);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 123 }
137 }; 124 };
138 125
139 126
140 class BinaryOpStub: public CodeStub { 127 class BinaryOpStub: public CodeStub {
141 public: 128 public:
142 BinaryOpStub(Token::Value op, OverwriteMode mode) 129 BinaryOpStub(Token::Value op, OverwriteMode mode)
143 : op_(op), 130 : op_(op),
144 mode_(mode), 131 mode_(mode),
145 operands_type_(BinaryOpIC::UNINITIALIZED), 132 operands_type_(BinaryOpIC::UNINITIALIZED),
146 result_type_(BinaryOpIC::UNINITIALIZED), 133 result_type_(BinaryOpIC::UNINITIALIZED) {
147 name_(NULL) {
148 use_fpu_ = CpuFeatures::IsSupported(FPU); 134 use_fpu_ = CpuFeatures::IsSupported(FPU);
149 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); 135 ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
150 } 136 }
151 137
152 BinaryOpStub( 138 BinaryOpStub(
153 int key, 139 int key,
154 BinaryOpIC::TypeInfo operands_type, 140 BinaryOpIC::TypeInfo operands_type,
155 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED) 141 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED)
156 : op_(OpBits::decode(key)), 142 : op_(OpBits::decode(key)),
157 mode_(ModeBits::decode(key)), 143 mode_(ModeBits::decode(key)),
158 use_fpu_(FPUBits::decode(key)), 144 use_fpu_(FPUBits::decode(key)),
159 operands_type_(operands_type), 145 operands_type_(operands_type),
160 result_type_(result_type), 146 result_type_(result_type) { }
161 name_(NULL) { }
162 147
163 private: 148 private:
164 enum SmiCodeGenerateHeapNumberResults { 149 enum SmiCodeGenerateHeapNumberResults {
165 ALLOW_HEAPNUMBER_RESULTS, 150 ALLOW_HEAPNUMBER_RESULTS,
166 NO_HEAPNUMBER_RESULTS 151 NO_HEAPNUMBER_RESULTS
167 }; 152 };
168 153
169 Token::Value op_; 154 Token::Value op_;
170 OverwriteMode mode_; 155 OverwriteMode mode_;
171 bool use_fpu_; 156 bool use_fpu_;
172 157
173 // Operand type information determined at runtime. 158 // Operand type information determined at runtime.
174 BinaryOpIC::TypeInfo operands_type_; 159 BinaryOpIC::TypeInfo operands_type_;
175 BinaryOpIC::TypeInfo result_type_; 160 BinaryOpIC::TypeInfo result_type_;
176 161
177 char* name_; 162 virtual void PrintName(StringStream* stream);
178
179 virtual const char* GetName();
180
181 #ifdef DEBUG
182 void Print() {
183 PrintF("BinaryOpStub %d (op %s), "
184 "(mode %d, runtime_type_info %s)\n",
185 MinorKey(),
186 Token::String(op_),
187 static_cast<int>(mode_),
188 BinaryOpIC::GetName(operands_type_));
189 }
190 #endif
191 163
192 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM. 164 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM.
193 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; 165 class ModeBits: public BitField<OverwriteMode, 0, 2> {};
194 class OpBits: public BitField<Token::Value, 2, 7> {}; 166 class OpBits: public BitField<Token::Value, 2, 7> {};
195 class FPUBits: public BitField<bool, 9, 1> {}; 167 class FPUBits: public BitField<bool, 9, 1> {};
196 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; 168 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {};
197 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; 169 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {};
198 170
199 Major MajorKey() { return BinaryOp; } 171 Major MajorKey() { return BinaryOp; }
200 int MinorKey() { 172 int MinorKey() {
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 598
627 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 599 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
628 600
629 LookupMode mode_; 601 LookupMode mode_;
630 }; 602 };
631 603
632 604
633 } } // namespace v8::internal 605 } } // namespace v8::internal
634 606
635 #endif // V8_MIPS_CODE_STUBS_ARM_H_ 607 #endif // V8_MIPS_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698