| 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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 void Add(Type type) { set_.Add(type); } | 926 void Add(Type type) { set_.Add(type); } |
| 927 byte ToByte() const { return set_.ToIntegral(); } | 927 byte ToByte() const { return set_.ToIntegral(); } |
| 928 void Print(StringStream* stream); | 928 void Print(StringStream* stream); |
| 929 void TraceTransition(Types to); | 929 void TraceTransition(Types to); |
| 930 bool Record(Handle<Object> object); | 930 bool Record(Handle<Object> object); |
| 931 | 931 |
| 932 private: | 932 private: |
| 933 EnumSet<Type, byte> set_; | 933 EnumSet<Type, byte> set_; |
| 934 }; | 934 }; |
| 935 | 935 |
| 936 static Types no_types() { return Types(); } |
| 937 |
| 936 explicit ToBooleanStub(Register tos, Types types = Types()) | 938 explicit ToBooleanStub(Register tos, Types types = Types()) |
| 937 : tos_(tos), types_(types) { } | 939 : tos_(tos), types_(types) { } |
| 938 | 940 |
| 939 void Generate(MacroAssembler* masm); | 941 void Generate(MacroAssembler* masm); |
| 940 virtual int GetCodeKind() { return Code::TO_BOOLEAN_IC; } | 942 virtual int GetCodeKind() { return Code::TO_BOOLEAN_IC; } |
| 941 virtual void PrintName(StringStream* stream); | 943 virtual void PrintName(StringStream* stream); |
| 942 | 944 |
| 943 private: | 945 private: |
| 944 Major MajorKey() { return ToBoolean; } | 946 Major MajorKey() { return ToBoolean; } |
| 945 int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | types_.ToByte(); } | 947 int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | types_.ToByte(); } |
| 946 | 948 |
| 947 virtual void FinishCode(Code* code) { | 949 virtual void FinishCode(Code* code) { |
| 948 code->set_to_boolean_state(types_.ToByte()); | 950 code->set_to_boolean_state(types_.ToByte()); |
| 949 } | 951 } |
| 950 | 952 |
| 951 void CheckOddball(MacroAssembler* masm, | 953 void CheckOddball(MacroAssembler* masm, |
| 952 Type type, | 954 Type type, |
| 953 Handle<Object> value, | 955 Handle<Object> value, |
| 954 bool result, | 956 bool result, |
| 955 Label* patch); | 957 Label* patch); |
| 956 void GenerateTypeTransition(MacroAssembler* masm); | 958 void GenerateTypeTransition(MacroAssembler* masm); |
| 957 | 959 |
| 958 Register tos_; | 960 Register tos_; |
| 959 Types types_; | 961 Types types_; |
| 960 }; | 962 }; |
| 961 | 963 |
| 962 } } // namespace v8::internal | 964 } } // namespace v8::internal |
| 963 | 965 |
| 964 #endif // V8_CODE_STUBS_H_ | 966 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |