Chromium Code Reviews| 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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 bool result); | 1023 bool result); |
| 1024 void GenerateTypeTransition(MacroAssembler* masm); | 1024 void GenerateTypeTransition(MacroAssembler* masm); |
| 1025 | 1025 |
| 1026 Register tos_; | 1026 Register tos_; |
| 1027 Types types_; | 1027 Types types_; |
| 1028 }; | 1028 }; |
| 1029 | 1029 |
| 1030 | 1030 |
| 1031 class FastElementsConversionStub : public CodeStub { | 1031 class FastElementsConversionStub : public CodeStub { |
| 1032 public: | 1032 public: |
| 1033 enum Type { | |
| 1034 TRANSITION_ONLY, | |
| 1035 TRANSITION_AND_STORE | |
| 1036 }; | |
| 1037 | |
| 1033 FastElementsConversionStub(ElementsKind from, | 1038 FastElementsConversionStub(ElementsKind from, |
| 1034 ElementsKind to, | 1039 ElementsKind to, |
| 1035 bool is_jsarray, | 1040 bool is_jsarray, |
| 1036 StrictModeFlag strict_mode) | 1041 StrictModeFlag strict_mode) |
| 1037 : from_(from), | 1042 : from_(from), |
| 1038 to_(to), | 1043 to_(to), |
| 1039 is_jsarray_(is_jsarray), | 1044 is_jsarray_(is_jsarray), |
| 1040 strict_mode_(strict_mode) {} | 1045 strict_mode_(strict_mode) {} |
| 1041 | 1046 |
| 1047 static void GenerateSmiOnlyToDouble( | |
| 1048 MacroAssembler* masm, | |
| 1049 Type type, | |
| 1050 StrictModeFlag strict_mode = kInvalidStrictFlag); | |
| 1051 | |
| 1052 static void GenerateDoubleToObject( | |
| 1053 MacroAssembler* masm, | |
| 1054 Type type, | |
| 1055 StrictModeFlag strict_mode = kInvalidStrictFlag); | |
| 1056 | |
| 1042 private: | 1057 private: |
| 1043 class FromBits: public BitField<ElementsKind, 0, 8> {}; | 1058 class FromBits: public BitField<ElementsKind, 0, 4> {}; |
|
Jakob Kummerow
2011/10/19 18:36:31
why this change? (I'm not saying it's bad; it's ju
| |
| 1044 class ToBits: public BitField<ElementsKind, 8, 8> {}; | 1059 class ToBits: public BitField<ElementsKind, 8, 8> {}; |
| 1045 class IsJSArrayBits: public BitField<bool, 16, 8> {}; | 1060 class IsJSArrayBits: public BitField<bool, 16, 8> {}; |
| 1046 class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {}; | 1061 class StrictModeBits: public BitField<StrictModeFlag, 24, 8> {}; |
| 1047 | 1062 |
| 1048 Major MajorKey() { return FastElementsConversion; } | 1063 Major MajorKey() { return FastElementsConversion; } |
| 1049 int MinorKey() { | 1064 int MinorKey() { |
| 1050 return FromBits::encode(from_) | | 1065 return FromBits::encode(from_) | |
| 1051 ToBits::encode(to_) | | 1066 ToBits::encode(to_) | |
| 1052 IsJSArrayBits::encode(is_jsarray_) | | 1067 IsJSArrayBits::encode(is_jsarray_) | |
| 1053 StrictModeBits::encode(strict_mode_); | 1068 StrictModeBits::encode(strict_mode_); |
| 1054 } | 1069 } |
| 1055 | 1070 |
| 1056 void Generate(MacroAssembler* masm); | 1071 void Generate(MacroAssembler* masm); |
| 1072 | |
| 1057 static void GenerateSmiOnlyToObject(MacroAssembler* masm); | 1073 static void GenerateSmiOnlyToObject(MacroAssembler* masm); |
| 1058 static void GenerateSmiOnlyToDouble(MacroAssembler* masm, | |
| 1059 StrictModeFlag strict_mode); | |
| 1060 static void GenerateDoubleToObject(MacroAssembler* masm, | |
| 1061 StrictModeFlag strict_mode); | |
| 1062 | 1074 |
| 1063 ElementsKind from_; | 1075 ElementsKind from_; |
| 1064 ElementsKind to_; | 1076 ElementsKind to_; |
| 1065 bool is_jsarray_; | 1077 bool is_jsarray_; |
| 1066 StrictModeFlag strict_mode_; | 1078 StrictModeFlag strict_mode_; |
| 1067 | 1079 |
| 1068 DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); | 1080 DISALLOW_COPY_AND_ASSIGN(FastElementsConversionStub); |
| 1069 }; | 1081 }; |
| 1070 | 1082 |
| 1071 } } // namespace v8::internal | 1083 } } // namespace v8::internal |
| 1072 | 1084 |
| 1073 #endif // V8_CODE_STUBS_H_ | 1085 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |