| OLD | NEW |
| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 199 } |
| 200 virtual Code::StubType GetStubType() { | 200 virtual Code::StubType GetStubType() { |
| 201 return Code::NORMAL; | 201 return Code::NORMAL; |
| 202 } | 202 } |
| 203 virtual int GetStubFlags() { | 203 virtual int GetStubFlags() { |
| 204 return -1; | 204 return -1; |
| 205 } | 205 } |
| 206 | 206 |
| 207 virtual void PrintName(StringStream* stream); | 207 virtual void PrintName(StringStream* stream); |
| 208 | 208 |
| 209 // Returns a name for logging/debugging purposes. |
| 210 SmartArrayPointer<const char> GetName(); |
| 211 |
| 209 protected: | 212 protected: |
| 210 static bool CanUseFPRegisters(); | 213 static bool CanUseFPRegisters(); |
| 211 | 214 |
| 212 // Generates the assembler code for the stub. | 215 // Generates the assembler code for the stub. |
| 213 virtual Handle<Code> GenerateCode(Isolate* isolate) = 0; | 216 virtual Handle<Code> GenerateCode(Isolate* isolate) = 0; |
| 214 | 217 |
| 215 | 218 |
| 216 // Returns whether the code generated for this stub needs to be allocated as | 219 // Returns whether the code generated for this stub needs to be allocated as |
| 217 // a fixed (non-moveable) code object. | 220 // a fixed (non-moveable) code object. |
| 218 virtual bool NeedsImmovableCode() { return false; } | 221 virtual bool NeedsImmovableCode() { return false; } |
| 219 | 222 |
| 220 // Returns a name for logging/debugging purposes. | |
| 221 SmartArrayPointer<const char> GetName(); | |
| 222 virtual void PrintBaseName(StringStream* stream); | 223 virtual void PrintBaseName(StringStream* stream); |
| 223 virtual void PrintState(StringStream* stream) { } | 224 virtual void PrintState(StringStream* stream) { } |
| 224 | 225 |
| 225 private: | 226 private: |
| 226 // Perform bookkeeping required after code generation when stub code is | 227 // Perform bookkeeping required after code generation when stub code is |
| 227 // initially generated. | 228 // initially generated. |
| 228 void RecordCodeGeneration(Code* code, Isolate* isolate); | 229 void RecordCodeGeneration(Code* code, Isolate* isolate); |
| 229 | 230 |
| 230 // Finish the code object after it has been generated. | 231 // Finish the code object after it has been generated. |
| 231 virtual void FinishCode(Handle<Code> code) { } | 232 virtual void FinishCode(Handle<Code> code) { } |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 | 906 |
| 906 protected: | 907 protected: |
| 907 HICStub() { } | 908 HICStub() { } |
| 908 class KindBits: public BitField<Code::Kind, 0, 4> {}; | 909 class KindBits: public BitField<Code::Kind, 0, 4> {}; |
| 909 virtual Code::Kind kind() const = 0; | 910 virtual Code::Kind kind() const = 0; |
| 910 }; | 911 }; |
| 911 | 912 |
| 912 | 913 |
| 913 class HandlerStub: public HICStub { | 914 class HandlerStub: public HICStub { |
| 914 public: | 915 public: |
| 915 virtual Code::Kind GetCodeKind() const { return Code::STUB; } | 916 virtual Code::Kind GetCodeKind() const { return Code::HANDLER; } |
| 916 virtual int GetStubFlags() { return kind(); } | 917 virtual int GetStubFlags() { return kind(); } |
| 917 | 918 |
| 918 protected: | 919 protected: |
| 919 HandlerStub() : HICStub() { } | 920 HandlerStub() : HICStub() { } |
| 920 }; | 921 }; |
| 921 | 922 |
| 922 | 923 |
| 923 class LoadFieldStub: public HandlerStub { | 924 class LoadFieldStub: public HandlerStub { |
| 924 public: | 925 public: |
| 925 LoadFieldStub(bool inobject, int index, Representation representation) | 926 LoadFieldStub(bool inobject, int index, Representation representation) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 Isolate* isolate, | 997 Isolate* isolate, |
| 997 CodeStubInterfaceDescriptor* descriptor); | 998 CodeStubInterfaceDescriptor* descriptor); |
| 998 | 999 |
| 999 virtual Handle<Code> GenerateCode(Isolate* isolate); | 1000 virtual Handle<Code> GenerateCode(Isolate* isolate); |
| 1000 | 1001 |
| 1001 private: | 1002 private: |
| 1002 virtual CodeStub::Major MajorKey() { return KeyedLoadField; } | 1003 virtual CodeStub::Major MajorKey() { return KeyedLoadField; } |
| 1003 }; | 1004 }; |
| 1004 | 1005 |
| 1005 | 1006 |
| 1006 class BinaryOpStub: public PlatformCodeStub { | 1007 class BinaryOpStub: public HydrogenCodeStub { |
| 1007 public: | 1008 public: |
| 1008 BinaryOpStub(Token::Value op, OverwriteMode mode) | 1009 BinaryOpStub(Token::Value op, OverwriteMode mode) |
| 1009 : op_(op), | 1010 : HydrogenCodeStub(UNINITIALIZED), op_(op), mode_(mode) { |
| 1010 mode_(mode), | 1011 ASSERT(op <= LAST_TOKEN && op >= FIRST_TOKEN); |
| 1011 platform_specific_bit_(false), | |
| 1012 left_type_(BinaryOpIC::UNINITIALIZED), | |
| 1013 right_type_(BinaryOpIC::UNINITIALIZED), | |
| 1014 result_type_(BinaryOpIC::UNINITIALIZED), | |
| 1015 encoded_right_arg_(false, encode_arg_value(1)) { | |
| 1016 Initialize(); | 1012 Initialize(); |
| 1017 ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); | |
| 1018 } | 1013 } |
| 1019 | 1014 |
| 1020 BinaryOpStub( | 1015 explicit BinaryOpStub(Code::ExtraICState state) |
| 1021 int key, | 1016 : op_(decode_token(OpBits::decode(state))), |
| 1022 BinaryOpIC::TypeInfo left_type, | 1017 mode_(OverwriteModeField::decode(state)), |
| 1023 BinaryOpIC::TypeInfo right_type, | 1018 fixed_right_arg_( |
| 1024 BinaryOpIC::TypeInfo result_type, | 1019 Maybe<int>(HasFixedRightArgBits::decode(state), |
| 1025 Maybe<int32_t> fixed_right_arg) | 1020 decode_arg_value(FixedRightArgValueBits::decode(state)))), |
| 1026 : op_(OpBits::decode(key)), | 1021 left_state_(LeftStateField::decode(state)), |
| 1027 mode_(ModeBits::decode(key)), | 1022 right_state_(fixed_right_arg_.has_value |
| 1028 platform_specific_bit_(PlatformSpecificBits::decode(key)), | 1023 ? ((fixed_right_arg_.value <= Smi::kMaxValue) ? SMI : INT32) |
| 1029 left_type_(left_type), | 1024 : RightStateField::decode(state)), |
| 1030 right_type_(right_type), | 1025 result_state_(ResultStateField::decode(state)) { |
| 1031 result_type_(result_type), | 1026 // We don't deserialize the SSE2 Field, since this is only used to be able |
| 1032 encoded_right_arg_(fixed_right_arg.has_value, | 1027 // to include SSE2 as well as non-SSE2 versions in the snapshot. For code |
| 1033 encode_arg_value(fixed_right_arg.value)) { } | 1028 // generation we always want it to reflect the current state. |
| 1034 | 1029 ASSERT(!fixed_right_arg_.has_value || |
| 1035 static void decode_types_from_minor_key(int minor_key, | 1030 can_encode_arg_value(fixed_right_arg_.value)); |
| 1036 BinaryOpIC::TypeInfo* left_type, | |
| 1037 BinaryOpIC::TypeInfo* right_type, | |
| 1038 BinaryOpIC::TypeInfo* result_type) { | |
| 1039 *left_type = | |
| 1040 static_cast<BinaryOpIC::TypeInfo>(LeftTypeBits::decode(minor_key)); | |
| 1041 *right_type = | |
| 1042 static_cast<BinaryOpIC::TypeInfo>(RightTypeBits::decode(minor_key)); | |
| 1043 *result_type = | |
| 1044 static_cast<BinaryOpIC::TypeInfo>(ResultTypeBits::decode(minor_key)); | |
| 1045 } | 1031 } |
| 1046 | 1032 |
| 1047 static Token::Value decode_op_from_minor_key(int minor_key) { | 1033 static const int FIRST_TOKEN = Token::BIT_OR; |
| 1048 return static_cast<Token::Value>(OpBits::decode(minor_key)); | 1034 static const int LAST_TOKEN = Token::MOD; |
| 1035 |
| 1036 static void GenerateAheadOfTime(Isolate* isolate); |
| 1037 virtual void InitializeInterfaceDescriptor( |
| 1038 Isolate* isolate, CodeStubInterfaceDescriptor* descriptor); |
| 1039 static void InitializeForIsolate(Isolate* isolate) { |
| 1040 BinaryOpStub binopStub(UNINITIALIZED); |
| 1041 binopStub.InitializeInterfaceDescriptor( |
| 1042 isolate, isolate->code_stub_interface_descriptor(CodeStub::BinaryOp)); |
| 1049 } | 1043 } |
| 1050 | 1044 |
| 1051 static Maybe<int> decode_fixed_right_arg_from_minor_key(int minor_key) { | 1045 virtual Code::Kind GetCodeKind() const { return Code::BINARY_OP_IC; } |
| 1052 return Maybe<int>( | 1046 virtual InlineCacheState GetICState() { |
| 1053 HasFixedRightArgBits::decode(minor_key), | 1047 if (Max(left_state_, right_state_) == NONE) { |
| 1054 decode_arg_value(FixedRightArgValueBits::decode(minor_key))); | 1048 return ::v8::internal::UNINITIALIZED; |
| 1049 } |
| 1050 if (Max(left_state_, right_state_) == GENERIC) return MEGAMORPHIC; |
| 1051 return MONOMORPHIC; |
| 1055 } | 1052 } |
| 1056 | 1053 |
| 1057 int fixed_right_arg_value() const { | 1054 virtual Code::ExtraICState GetExtraICState() { |
| 1058 return decode_arg_value(encoded_right_arg_.value); | 1055 bool sse_field = Max(result_state_, Max(left_state_, right_state_)) > SMI && |
| 1056 CpuFeatures::IsSafeForSnapshot(SSE2); |
| 1057 |
| 1058 return OpBits::encode(encode_token(op_)) |
| 1059 | LeftStateField::encode(left_state_) |
| 1060 | RightStateField::encode(fixed_right_arg_.has_value |
| 1061 ? NONE : right_state_) |
| 1062 | ResultStateField::encode(result_state_) |
| 1063 | HasFixedRightArgBits::encode(fixed_right_arg_.has_value) |
| 1064 | FixedRightArgValueBits::encode(fixed_right_arg_.has_value |
| 1065 ? encode_arg_value( |
| 1066 fixed_right_arg_.value) |
| 1067 : 0) |
| 1068 | SSE2Field::encode(sse_field) |
| 1069 | OverwriteModeField::encode(mode_); |
| 1059 } | 1070 } |
| 1060 | 1071 |
| 1061 static bool can_encode_arg_value(int32_t value) { | 1072 bool CanReuseDoubleBox() { |
| 1062 return value > 0 && | 1073 return result_state_ <= NUMBER && result_state_ > SMI && |
| 1063 IsPowerOf2(value) && | 1074 ((left_state_ > SMI && left_state_ <= NUMBER && |
| 1064 FixedRightArgValueBits::is_valid(WhichPowerOf2(value)); | 1075 mode_ == OVERWRITE_LEFT) || |
| 1076 (right_state_ > SMI && right_state_ <= NUMBER && |
| 1077 mode_ == OVERWRITE_RIGHT)); |
| 1065 } | 1078 } |
| 1066 | 1079 |
| 1067 enum SmiCodeGenerateHeapNumberResults { | 1080 bool HasSideEffects(Isolate* isolate) const { |
| 1068 ALLOW_HEAPNUMBER_RESULTS, | 1081 Handle<Type> left = GetLeftType(isolate); |
| 1069 NO_HEAPNUMBER_RESULTS | 1082 Handle<Type> right = GetRightType(isolate); |
| 1070 }; | 1083 return left->Maybe(Type::Receiver()) || right->Maybe(Type::Receiver()); |
| 1084 } |
| 1085 |
| 1086 virtual Handle<Code> GenerateCode(Isolate* isolate); |
| 1087 |
| 1088 Maybe<Handle<Object> > Result(Handle<Object> left, |
| 1089 Handle<Object> right, |
| 1090 Isolate* isolate); |
| 1091 |
| 1092 Token::Value operation() const { return op_; } |
| 1093 OverwriteMode mode() const { return mode_; } |
| 1094 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
| 1095 |
| 1096 Handle<Type> GetLeftType(Isolate* isolate) const; |
| 1097 Handle<Type> GetRightType(Isolate* isolate) const; |
| 1098 Handle<Type> GetResultType(Isolate* isolate) const; |
| 1099 |
| 1100 void UpdateStatus(Handle<Object> left, |
| 1101 Handle<Object> right, |
| 1102 Maybe<Handle<Object> > result); |
| 1103 |
| 1104 void PrintState(StringStream* stream); |
| 1071 | 1105 |
| 1072 private: | 1106 private: |
| 1107 explicit BinaryOpStub(InitializationState state) : HydrogenCodeStub(state), |
| 1108 op_(Token::ADD), |
| 1109 mode_(NO_OVERWRITE) { |
| 1110 Initialize(); |
| 1111 } |
| 1112 void Initialize(); |
| 1113 |
| 1114 enum State { NONE, SMI, INT32, NUMBER, STRING, GENERIC }; |
| 1115 |
| 1116 // We truncate the last bit of the token. |
| 1117 STATIC_ASSERT(LAST_TOKEN - FIRST_TOKEN < (1 << 5)); |
| 1118 class LeftStateField: public BitField<State, 0, 3> {}; |
| 1119 // When fixed right arg is set, we don't need to store the right state. |
| 1120 // Thus the two fields can overlap. |
| 1121 class HasFixedRightArgBits: public BitField<bool, 4, 1> {}; |
| 1122 class FixedRightArgValueBits: public BitField<int, 5, 4> {}; |
| 1123 class RightStateField: public BitField<State, 5, 3> {}; |
| 1124 class ResultStateField: public BitField<State, 9, 3> {}; |
| 1125 class SSE2Field: public BitField<bool, 12, 1> {}; |
| 1126 class OverwriteModeField: public BitField<OverwriteMode, 13, 2> {}; |
| 1127 class OpBits: public BitField<int, 15, 5> {}; |
| 1128 |
| 1129 virtual CodeStub::Major MajorKey() { return BinaryOp; } |
| 1130 virtual int NotMissMinorKey() { return GetExtraICState(); } |
| 1131 |
| 1132 static Handle<Type> StateToType(State state, |
| 1133 Isolate* isolate); |
| 1134 |
| 1135 static void Generate(Token::Value op, |
| 1136 State left, |
| 1137 int right, |
| 1138 State result, |
| 1139 OverwriteMode mode, |
| 1140 Isolate* isolate); |
| 1141 |
| 1142 static void Generate(Token::Value op, |
| 1143 State left, |
| 1144 State right, |
| 1145 State result, |
| 1146 OverwriteMode mode, |
| 1147 Isolate* isolate); |
| 1148 |
| 1149 void UpdateStatus(Handle<Object> object, |
| 1150 State* state); |
| 1151 |
| 1152 bool can_encode_arg_value(int32_t value) const; |
| 1153 int encode_arg_value(int32_t value) const; |
| 1154 int32_t decode_arg_value(int value) const; |
| 1155 int encode_token(Token::Value op) const; |
| 1156 Token::Value decode_token(int op) const; |
| 1157 |
| 1158 bool has_int_result() const { |
| 1159 return op_ == Token::BIT_XOR || op_ == Token::BIT_AND || |
| 1160 op_ == Token::BIT_OR || op_ == Token::SAR || op_ == Token::SHL; |
| 1161 } |
| 1162 |
| 1163 const char* StateToName(State state); |
| 1164 |
| 1165 void PrintBaseName(StringStream* stream); |
| 1166 |
| 1073 Token::Value op_; | 1167 Token::Value op_; |
| 1074 OverwriteMode mode_; | 1168 OverwriteMode mode_; |
| 1075 bool platform_specific_bit_; // Indicates SSE3 on IA32. | |
| 1076 | 1169 |
| 1077 // Operand type information determined at runtime. | 1170 Maybe<int> fixed_right_arg_; |
| 1078 BinaryOpIC::TypeInfo left_type_; | 1171 State left_state_; |
| 1079 BinaryOpIC::TypeInfo right_type_; | 1172 State right_state_; |
| 1080 BinaryOpIC::TypeInfo result_type_; | 1173 State result_state_; |
| 1081 | |
| 1082 Maybe<int> encoded_right_arg_; | |
| 1083 | |
| 1084 static int encode_arg_value(int32_t value) { | |
| 1085 ASSERT(can_encode_arg_value(value)); | |
| 1086 return WhichPowerOf2(value); | |
| 1087 } | |
| 1088 | |
| 1089 static int32_t decode_arg_value(int value) { | |
| 1090 return 1 << value; | |
| 1091 } | |
| 1092 | |
| 1093 virtual void PrintName(StringStream* stream); | |
| 1094 | |
| 1095 // Minor key encoding in all 25 bits FFFFFHTTTRRRLLLPOOOOOOOMM. | |
| 1096 // Note: We actually do not need 7 bits for the operation, just 4 bits to | |
| 1097 // encode ADD, SUB, MUL, DIV, MOD, BIT_OR, BIT_AND, BIT_XOR, SAR, SHL, SHR. | |
| 1098 class ModeBits: public BitField<OverwriteMode, 0, 2> {}; | |
| 1099 class OpBits: public BitField<Token::Value, 2, 7> {}; | |
| 1100 class PlatformSpecificBits: public BitField<bool, 9, 1> {}; | |
| 1101 class LeftTypeBits: public BitField<BinaryOpIC::TypeInfo, 10, 3> {}; | |
| 1102 class RightTypeBits: public BitField<BinaryOpIC::TypeInfo, 13, 3> {}; | |
| 1103 class ResultTypeBits: public BitField<BinaryOpIC::TypeInfo, 16, 3> {}; | |
| 1104 class HasFixedRightArgBits: public BitField<bool, 19, 1> {}; | |
| 1105 class FixedRightArgValueBits: public BitField<int, 20, 5> {}; | |
| 1106 | |
| 1107 Major MajorKey() { return BinaryOp; } | |
| 1108 int MinorKey() { | |
| 1109 return OpBits::encode(op_) | |
| 1110 | ModeBits::encode(mode_) | |
| 1111 | PlatformSpecificBits::encode(platform_specific_bit_) | |
| 1112 | LeftTypeBits::encode(left_type_) | |
| 1113 | RightTypeBits::encode(right_type_) | |
| 1114 | ResultTypeBits::encode(result_type_) | |
| 1115 | HasFixedRightArgBits::encode(encoded_right_arg_.has_value) | |
| 1116 | FixedRightArgValueBits::encode(encoded_right_arg_.value); | |
| 1117 } | |
| 1118 | |
| 1119 | |
| 1120 // Platform-independent implementation. | |
| 1121 void Generate(MacroAssembler* masm); | |
| 1122 void GenerateCallRuntime(MacroAssembler* masm); | |
| 1123 | |
| 1124 // Platform-independent signature, platform-specific implementation. | |
| 1125 void Initialize(); | |
| 1126 void GenerateAddStrings(MacroAssembler* masm); | |
| 1127 void GenerateBothStringStub(MacroAssembler* masm); | |
| 1128 void GenerateGeneric(MacroAssembler* masm); | |
| 1129 void GenerateGenericStub(MacroAssembler* masm); | |
| 1130 void GenerateNumberStub(MacroAssembler* masm); | |
| 1131 void GenerateInt32Stub(MacroAssembler* masm); | |
| 1132 void GenerateLoadArguments(MacroAssembler* masm); | |
| 1133 void GenerateOddballStub(MacroAssembler* masm); | |
| 1134 void GenerateRegisterArgsPush(MacroAssembler* masm); | |
| 1135 void GenerateReturn(MacroAssembler* masm); | |
| 1136 void GenerateSmiStub(MacroAssembler* masm); | |
| 1137 void GenerateStringStub(MacroAssembler* masm); | |
| 1138 void GenerateTypeTransition(MacroAssembler* masm); | |
| 1139 void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm); | |
| 1140 void GenerateUninitializedStub(MacroAssembler* masm); | |
| 1141 | |
| 1142 // Entirely platform-specific methods are defined as static helper | |
| 1143 // functions in the <arch>/code-stubs-<arch>.cc files. | |
| 1144 | |
| 1145 virtual Code::Kind GetCodeKind() const { return Code::BINARY_OP_IC; } | |
| 1146 | |
| 1147 virtual InlineCacheState GetICState() { | |
| 1148 return BinaryOpIC::ToState(Max(left_type_, right_type_)); | |
| 1149 } | |
| 1150 | |
| 1151 virtual void FinishCode(Handle<Code> code) { | |
| 1152 code->set_stub_info(MinorKey()); | |
| 1153 } | |
| 1154 | |
| 1155 friend class CodeGenerator; | |
| 1156 }; | 1174 }; |
| 1157 | 1175 |
| 1158 | 1176 |
| 1159 class ICCompareStub: public PlatformCodeStub { | 1177 class ICCompareStub: public PlatformCodeStub { |
| 1160 public: | 1178 public: |
| 1161 ICCompareStub(Token::Value op, | 1179 ICCompareStub(Token::Value op, |
| 1162 CompareIC::State left, | 1180 CompareIC::State left, |
| 1163 CompareIC::State right, | 1181 CompareIC::State right, |
| 1164 CompareIC::State handler) | 1182 CompareIC::State handler) |
| 1165 : op_(op), | 1183 : op_(op), |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 int offset, | 1739 int offset, |
| 1722 bool is_truncating, | 1740 bool is_truncating, |
| 1723 bool skip_fastpath = false) : bit_field_(0) { | 1741 bool skip_fastpath = false) : bit_field_(0) { |
| 1724 #if V8_TARGET_ARCH_A64 | 1742 #if V8_TARGET_ARCH_A64 |
| 1725 // TODO(jbramley): Make A64's Register type compatible with the normal code, | 1743 // TODO(jbramley): Make A64's Register type compatible with the normal code, |
| 1726 // so we don't need this special case. | 1744 // so we don't need this special case. |
| 1727 bit_field_ = SourceRegisterBits::encode(source.code()) | | 1745 bit_field_ = SourceRegisterBits::encode(source.code()) | |
| 1728 DestinationRegisterBits::encode(destination.code()) | | 1746 DestinationRegisterBits::encode(destination.code()) | |
| 1729 OffsetBits::encode(offset) | | 1747 OffsetBits::encode(offset) | |
| 1730 IsTruncatingBits::encode(is_truncating) | | 1748 IsTruncatingBits::encode(is_truncating) | |
| 1731 SkipFastPathBits::encode(skip_fastpath); | 1749 SkipFastPathBits::encode(skip_fastpath) | |
| 1750 SSEBits::encode(CpuFeatures::IsSafeForSnapshot(SSE2) ? |
| 1751 CpuFeatures::IsSafeForSnapshot(SSE3) ? 2 : 1 : 0); |
| 1732 #else | 1752 #else |
| 1733 bit_field_ = SourceRegisterBits::encode(source.code_) | | 1753 bit_field_ = SourceRegisterBits::encode(source.code_) | |
| 1734 DestinationRegisterBits::encode(destination.code_) | | 1754 DestinationRegisterBits::encode(destination.code_) | |
| 1735 OffsetBits::encode(offset) | | 1755 OffsetBits::encode(offset) | |
| 1736 IsTruncatingBits::encode(is_truncating) | | 1756 IsTruncatingBits::encode(is_truncating) | |
| 1737 SkipFastPathBits::encode(skip_fastpath); | 1757 SkipFastPathBits::encode(skip_fastpath) | |
| 1758 SSEBits::encode(CpuFeatures::IsSafeForSnapshot(SSE2) ? |
| 1759 CpuFeatures::IsSafeForSnapshot(SSE3) ? 2 : 1 : 0); |
| 1738 #endif | 1760 #endif |
| 1739 } | 1761 } |
| 1740 | 1762 |
| 1741 Register source() { | 1763 Register source() { |
| 1742 #if V8_TARGET_ARCH_A64 | 1764 #if V8_TARGET_ARCH_A64 |
| 1743 // TODO(jbramley): Make A64's Register type compatible with the normal code, | 1765 // TODO(jbramley): Make A64's Register type compatible with the normal code, |
| 1744 // so we don't need this special case. | 1766 // so we don't need this special case. |
| 1745 return Register::XRegFromCode(SourceRegisterBits::decode(bit_field_)); | 1767 return Register::XRegFromCode(SourceRegisterBits::decode(bit_field_)); |
| 1746 #else | 1768 #else |
| 1747 Register result = { SourceRegisterBits::decode(bit_field_) }; | 1769 Register result = { SourceRegisterBits::decode(bit_field_) }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT | 1805 public BitField<int, 0, kBitsPerRegisterNumber> {}; // NOLINT |
| 1784 class DestinationRegisterBits: | 1806 class DestinationRegisterBits: |
| 1785 public BitField<int, kBitsPerRegisterNumber, | 1807 public BitField<int, kBitsPerRegisterNumber, |
| 1786 kBitsPerRegisterNumber> {}; // NOLINT | 1808 kBitsPerRegisterNumber> {}; // NOLINT |
| 1787 class IsTruncatingBits: | 1809 class IsTruncatingBits: |
| 1788 public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT | 1810 public BitField<bool, 2 * kBitsPerRegisterNumber, 1> {}; // NOLINT |
| 1789 class OffsetBits: | 1811 class OffsetBits: |
| 1790 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT | 1812 public BitField<int, 2 * kBitsPerRegisterNumber + 1, 3> {}; // NOLINT |
| 1791 class SkipFastPathBits: | 1813 class SkipFastPathBits: |
| 1792 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT | 1814 public BitField<int, 2 * kBitsPerRegisterNumber + 4, 1> {}; // NOLINT |
| 1815 class SSEBits: |
| 1816 public BitField<int, 2 * kBitsPerRegisterNumber + 5, 2> {}; // NOLINT |
| 1793 | 1817 |
| 1794 Major MajorKey() { return DoubleToI; } | 1818 Major MajorKey() { return DoubleToI; } |
| 1795 int MinorKey() { return bit_field_; } | 1819 int MinorKey() { return bit_field_; } |
| 1796 | 1820 |
| 1797 int bit_field_; | 1821 int bit_field_; |
| 1798 | 1822 |
| 1799 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); | 1823 DISALLOW_COPY_AND_ASSIGN(DoubleToIStub); |
| 1800 }; | 1824 }; |
| 1801 | 1825 |
| 1802 | 1826 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 int MinorKey() { return 0; } | 2373 int MinorKey() { return 0; } |
| 2350 | 2374 |
| 2351 void Generate(MacroAssembler* masm); | 2375 void Generate(MacroAssembler* masm); |
| 2352 | 2376 |
| 2353 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 2377 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 2354 }; | 2378 }; |
| 2355 | 2379 |
| 2356 } } // namespace v8::internal | 2380 } } // namespace v8::internal |
| 2357 | 2381 |
| 2358 #endif // V8_CODE_STUBS_H_ | 2382 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |