| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 | 60 |
| 61 class UnaryOpStub: public CodeStub { | 61 class UnaryOpStub: public CodeStub { |
| 62 public: | 62 public: |
| 63 UnaryOpStub(Token::Value op, | 63 UnaryOpStub(Token::Value op, |
| 64 UnaryOverwriteMode mode, | 64 UnaryOverwriteMode mode, |
| 65 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) | 65 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) |
| 66 : op_(op), | 66 : op_(op), |
| 67 mode_(mode), | 67 mode_(mode), |
| 68 operand_type_(operand_type), | 68 operand_type_(operand_type) { |
| 69 name_(NULL) { | |
| 70 } | 69 } |
| 71 | 70 |
| 72 private: | 71 private: |
| 73 Token::Value op_; | 72 Token::Value op_; |
| 74 UnaryOverwriteMode mode_; | 73 UnaryOverwriteMode mode_; |
| 75 | 74 |
| 76 // Operand type information determined at runtime. | 75 // Operand type information determined at runtime. |
| 77 UnaryOpIC::TypeInfo operand_type_; | 76 UnaryOpIC::TypeInfo operand_type_; |
| 78 | 77 |
| 79 char* name_; | 78 virtual void PrintName(StringStream* stream); |
| 80 | |
| 81 virtual const char* GetName(); | |
| 82 | |
| 83 #ifdef DEBUG | |
| 84 void Print() { | |
| 85 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", | |
| 86 MinorKey(), | |
| 87 Token::String(op_), | |
| 88 static_cast<int>(mode_), | |
| 89 UnaryOpIC::GetName(operand_type_)); | |
| 90 } | |
| 91 #endif | |
| 92 | 79 |
| 93 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; | 80 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; |
| 94 class OpBits: public BitField<Token::Value, 1, 7> {}; | 81 class OpBits: public BitField<Token::Value, 1, 7> {}; |
| 95 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; | 82 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; |
| 96 | 83 |
| 97 Major MajorKey() { return UnaryOp; } | 84 Major MajorKey() { return UnaryOp; } |
| 98 int MinorKey() { | 85 int MinorKey() { |
| 99 return ModeBits::encode(mode_) | 86 return ModeBits::encode(mode_) |
| 100 | OpBits::encode(op_) | 87 | OpBits::encode(op_) |
| 101 | OperandTypeInfoBits::encode(operand_type_); | 88 | OperandTypeInfoBits::encode(operand_type_); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 122 } |
| 136 }; | 123 }; |
| 137 | 124 |
| 138 | 125 |
| 139 class BinaryOpStub: public CodeStub { | 126 class BinaryOpStub: public CodeStub { |
| 140 public: | 127 public: |
| 141 BinaryOpStub(Token::Value op, OverwriteMode mode) | 128 BinaryOpStub(Token::Value op, OverwriteMode mode) |
| 142 : op_(op), | 129 : op_(op), |
| 143 mode_(mode), | 130 mode_(mode), |
| 144 operands_type_(BinaryOpIC::UNINITIALIZED), | 131 operands_type_(BinaryOpIC::UNINITIALIZED), |
| 145 result_type_(BinaryOpIC::UNINITIALIZED), | 132 result_type_(BinaryOpIC::UNINITIALIZED) { |
| 146 name_(NULL) { | |
| 147 use_vfp3_ = CpuFeatures::IsSupported(VFP3); | 133 use_vfp3_ = CpuFeatures::IsSupported(VFP3); |
| 148 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | 134 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); |
| 149 } | 135 } |
| 150 | 136 |
| 151 BinaryOpStub( | 137 BinaryOpStub( |
| 152 int key, | 138 int key, |
| 153 BinaryOpIC::TypeInfo operands_type, | 139 BinaryOpIC::TypeInfo operands_type, |
| 154 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED) | 140 BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED) |
| 155 : op_(OpBits::decode(key)), | 141 : op_(OpBits::decode(key)), |
| 156 mode_(ModeBits::decode(key)), | 142 mode_(ModeBits::decode(key)), |
| 157 use_vfp3_(VFP3Bits::decode(key)), | 143 use_vfp3_(VFP3Bits::decode(key)), |
| 158 operands_type_(operands_type), | 144 operands_type_(operands_type), |
| 159 result_type_(result_type), | 145 result_type_(result_type) { } |
| 160 name_(NULL) { } | |
| 161 | 146 |
| 162 private: | 147 private: |
| 163 enum SmiCodeGenerateHeapNumberResults { | 148 enum SmiCodeGenerateHeapNumberResults { |
| 164 ALLOW_HEAPNUMBER_RESULTS, | 149 ALLOW_HEAPNUMBER_RESULTS, |
| 165 NO_HEAPNUMBER_RESULTS | 150 NO_HEAPNUMBER_RESULTS |
| 166 }; | 151 }; |
| 167 | 152 |
| 168 Token::Value op_; | 153 Token::Value op_; |
| 169 OverwriteMode mode_; | 154 OverwriteMode mode_; |
| 170 bool use_vfp3_; | 155 bool use_vfp3_; |
| 171 | 156 |
| 172 // Operand type information determined at runtime. | 157 // Operand type information determined at runtime. |
| 173 BinaryOpIC::TypeInfo operands_type_; | 158 BinaryOpIC::TypeInfo operands_type_; |
| 174 BinaryOpIC::TypeInfo result_type_; | 159 BinaryOpIC::TypeInfo result_type_; |
| 175 | 160 |
| 176 char* name_; | 161 virtual void PrintName(StringStream* stream); |
| 177 | |
| 178 virtual const char* GetName(); | |
| 179 | |
| 180 #ifdef DEBUG | |
| 181 void Print() { | |
| 182 PrintF("BinaryOpStub %d (op %s), " | |
| 183 "(mode %d, runtime_type_info %s)\n", | |
| 184 MinorKey(), | |
| 185 Token::String(op_), | |
| 186 static_cast<int>(mode_), | |
| 187 BinaryOpIC::GetName(operands_type_)); | |
| 188 } | |
| 189 #endif | |
| 190 | 162 |
| 191 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM. | 163 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM. |
| 192 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | 164 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; |
| 193 class OpBits: public BitField<Token::Value, 2, 7> {}; | 165 class OpBits: public BitField<Token::Value, 2, 7> {}; |
| 194 class VFP3Bits: public BitField<bool, 9, 1> {}; | 166 class VFP3Bits: public BitField<bool, 9, 1> {}; |
| 195 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; | 167 class OperandTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; |
| 196 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; | 168 class ResultTypeInfoBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; |
| 197 | 169 |
| 198 Major MajorKey() { return BinaryOp; } | 170 Major MajorKey() { return BinaryOp; } |
| 199 int MinorKey() { | 171 int MinorKey() { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 | 595 |
| 624 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 596 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 625 | 597 |
| 626 LookupMode mode_; | 598 LookupMode mode_; |
| 627 }; | 599 }; |
| 628 | 600 |
| 629 | 601 |
| 630 } } // namespace v8::internal | 602 } } // namespace v8::internal |
| 631 | 603 |
| 632 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 604 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
| OLD | NEW |