| OLD | NEW |
| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 | 75 |
| 76 class UnaryOpStub: public CodeStub { | 76 class UnaryOpStub: public CodeStub { |
| 77 public: | 77 public: |
| 78 UnaryOpStub(Token::Value op, | 78 UnaryOpStub(Token::Value op, |
| 79 UnaryOverwriteMode mode, | 79 UnaryOverwriteMode mode, |
| 80 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) | 80 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) |
| 81 : op_(op), | 81 : op_(op), |
| 82 mode_(mode), | 82 mode_(mode), |
| 83 operand_type_(operand_type), | 83 operand_type_(operand_type) { |
| 84 name_(NULL) { | |
| 85 } | 84 } |
| 86 | 85 |
| 87 private: | 86 private: |
| 88 Token::Value op_; | 87 Token::Value op_; |
| 89 UnaryOverwriteMode mode_; | 88 UnaryOverwriteMode mode_; |
| 90 | 89 |
| 91 // Operand type information determined at runtime. | 90 // Operand type information determined at runtime. |
| 92 UnaryOpIC::TypeInfo operand_type_; | 91 UnaryOpIC::TypeInfo operand_type_; |
| 93 | 92 |
| 94 char* name_; | 93 virtual void PrintName(StringStream* stream); |
| 95 | |
| 96 virtual const char* GetName(); | |
| 97 | |
| 98 #ifdef DEBUG | |
| 99 void Print() { | |
| 100 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", | |
| 101 MinorKey(), | |
| 102 Token::String(op_), | |
| 103 static_cast<int>(mode_), | |
| 104 UnaryOpIC::GetName(operand_type_)); | |
| 105 } | |
| 106 #endif | |
| 107 | 94 |
| 108 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; | 95 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; |
| 109 class OpBits: public BitField<Token::Value, 1, 7> {}; | 96 class OpBits: public BitField<Token::Value, 1, 7> {}; |
| 110 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; | 97 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; |
| 111 | 98 |
| 112 Major MajorKey() { return UnaryOp; } | 99 Major MajorKey() { return UnaryOp; } |
| 113 int MinorKey() { | 100 int MinorKey() { |
| 114 return ModeBits::encode(mode_) | 101 return ModeBits::encode(mode_) |
| 115 | OpBits::encode(op_) | 102 | OpBits::encode(op_) |
| 116 | OperandTypeInfoBits::encode(operand_type_); | 103 | OperandTypeInfoBits::encode(operand_type_); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 137 } |
| 151 }; | 138 }; |
| 152 | 139 |
| 153 | 140 |
| 154 class BinaryOpStub: public CodeStub { | 141 class BinaryOpStub: public CodeStub { |
| 155 public: | 142 public: |
| 156 BinaryOpStub(Token::Value op, OverwriteMode mode) | 143 BinaryOpStub(Token::Value op, OverwriteMode mode) |
| 157 : op_(op), | 144 : op_(op), |
| 158 mode_(mode), | 145 mode_(mode), |
| 159 operands_type_(BinaryOpIC::UNINITIALIZED), | 146 operands_type_(BinaryOpIC::UNINITIALIZED), |
| 160 result_type_(BinaryOpIC::UNINITIALIZED), | 147 result_type_(BinaryOpIC::UNINITIALIZED) { |
| 161 name_(NULL) { | |
| 162 use_vfp3_ = CpuFeatures::IsSupported(VFP3); | 148 use_vfp3_ = CpuFeatures::IsSupported(VFP3); |
| 163 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 149 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 164 } | 150 } |
| 165 | 151 |
| 166 BinaryOpStub( | 152 BinaryOpStub( |
| 167 int key, | 153 int key, |
| 168 BinaryOpIC::TypeInfo operands_type, | 154 BinaryOpIC::TypeInfo operands_type, |
| 169 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED) | 155 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED) |
| 170 : op_(OpBits::decode(key)), | 156 : op_(OpBits::decode(key)), |
| 171 mode_(ModeBits::decode(key)), | 157 mode_(ModeBits::decode(key)), |
| 172 use_vfp3_(VFP3Bits::decode(key)), | 158 use_vfp3_(VFP3Bits::decode(key)), |
| 173 operands_type_(operands_type), | 159 operands_type_(operands_type), |
| 174 result_type_(result_type), | 160 result_type_(result_type) { } |
| 175 name_(NULL) { } | |
| 176 | 161 |
| 177 private: | 162 private: |
| 178 enum SmiCodeGenerateHeapNumberResults { | 163 enum SmiCodeGenerateHeapNumberResults { |
| 179 ALLOW_HEAPNUMBER_RESULTS, | 164 ALLOW_HEAPNUMBER_RESULTS, |
| 180 NO_HEAPNUMBER_RESULTS | 165 NO_HEAPNUMBER_RESULTS |
| 181 }; | 166 }; |
| 182 | 167 |
| 183 Token::Value op_; | 168 Token::Value op_; |
| 184 OverwriteMode mode_; | 169 OverwriteMode mode_; |
| 185 bool use_vfp3_; | 170 bool use_vfp3_; |
| 186 | 171 |
| 187 // Operand type information determined at runtime. | 172 // Operand type information determined at runtime. |
| 188 BinaryOpIC::TypeInfo operands_type_; | 173 BinaryOpIC::TypeInfo operands_type_; |
| 189 BinaryOpIC::TypeInfo result_type_; | 174 BinaryOpIC::TypeInfo result_type_; |
| 190 | 175 |
| 191 char* name_; | 176 virtual void PrintName(StringStream* stream); |
| 192 | |
| 193 virtual const char* GetName(); | |
| 194 | |
| 195 #ifdef DEBUG | |
| 196 void Print() { | |
| 197 PrintF("BinaryOpStub %d (op %s), " | |
| 198 "(mode %d, runtime_type_info %s)\n", | |
| 199 MinorKey(), | |
| 200 Token::String(op_), | |
| 201 static_cast<int>(mode_), | |
| 202 BinaryOpIC::GetName(operands_type_)); | |
| 203 } | |
| 204 #endif | |
| 205 | 177 |
| 206 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM. | 178 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM. |
| 207 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | 179 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; |
| 208 class OpBits: public BitField<Token::Value, 2, 7> {}; | 180 class OpBits: public BitField<Token::Value, 2, 7> {}; |
| 209 class VFP3Bits: public BitField<bool, 9, 1> {}; | 181 class VFP3Bits: public BitField<bool, 9, 1> {}; |
| 210 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; | 182 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; |
| 211 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; | 183 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; |
| 212 | 184 |
| 213 Major MajorKey() { return BinaryOp; } | 185 Major MajorKey() { return BinaryOp; } |
| 214 int MinorKey() { | 186 int MinorKey() { |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 | 759 |
| 788 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 760 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 789 | 761 |
| 790 LookupMode mode_; | 762 LookupMode mode_; |
| 791 }; | 763 }; |
| 792 | 764 |
| 793 | 765 |
| 794 } } // namespace v8::internal | 766 } } // namespace v8::internal |
| 795 | 767 |
| 796 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 768 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
| OLD | NEW |