OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 return static_cast<State>(target->compare_state()); | 2134 return static_cast<State>(target->compare_state()); |
2135 } | 2135 } |
2136 | 2136 |
2137 | 2137 |
2138 const char* CompareIC::GetStateName(State state) { | 2138 const char* CompareIC::GetStateName(State state) { |
2139 switch (state) { | 2139 switch (state) { |
2140 case UNINITIALIZED: return "UNINITIALIZED"; | 2140 case UNINITIALIZED: return "UNINITIALIZED"; |
2141 case SMIS: return "SMIS"; | 2141 case SMIS: return "SMIS"; |
2142 case HEAP_NUMBERS: return "HEAP_NUMBERS"; | 2142 case HEAP_NUMBERS: return "HEAP_NUMBERS"; |
2143 case OBJECTS: return "OBJECTS"; | 2143 case OBJECTS: return "OBJECTS"; |
| 2144 case SYMBOLS: return "SYMBOLS"; |
2144 case STRINGS: return "STRINGS"; | 2145 case STRINGS: return "STRINGS"; |
2145 case GENERIC: return "GENERIC"; | 2146 case GENERIC: return "GENERIC"; |
2146 default: | 2147 default: |
2147 UNREACHABLE(); | 2148 UNREACHABLE(); |
2148 return NULL; | 2149 return NULL; |
2149 } | 2150 } |
2150 } | 2151 } |
2151 | 2152 |
2152 | 2153 |
2153 CompareIC::State CompareIC::TargetState(State state, | 2154 CompareIC::State CompareIC::TargetState(State state, |
2154 bool has_inlined_smi_code, | 2155 bool has_inlined_smi_code, |
2155 Handle<Object> x, | 2156 Handle<Object> x, |
2156 Handle<Object> y) { | 2157 Handle<Object> y) { |
2157 if (!has_inlined_smi_code && state != UNINITIALIZED) return GENERIC; | 2158 if (!has_inlined_smi_code && state != UNINITIALIZED && state != SYMBOLS) { |
| 2159 return GENERIC; |
| 2160 } |
2158 if (state == UNINITIALIZED && x->IsSmi() && y->IsSmi()) return SMIS; | 2161 if (state == UNINITIALIZED && x->IsSmi() && y->IsSmi()) return SMIS; |
2159 if ((state == UNINITIALIZED || (state == SMIS && has_inlined_smi_code)) && | 2162 if ((state == UNINITIALIZED || (state == SMIS && has_inlined_smi_code)) && |
2160 x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS; | 2163 x->IsNumber() && y->IsNumber()) return HEAP_NUMBERS; |
2161 if (op_ != Token::EQ && op_ != Token::EQ_STRICT) return GENERIC; | 2164 if (op_ != Token::EQ && op_ != Token::EQ_STRICT) return GENERIC; |
2162 if (state == UNINITIALIZED && | 2165 if (state == UNINITIALIZED && |
| 2166 x->IsSymbol() && y->IsSymbol()) return SYMBOLS; |
| 2167 if ((state == UNINITIALIZED || state == SYMBOLS) && |
2163 x->IsString() && y->IsString()) return STRINGS; | 2168 x->IsString() && y->IsString()) return STRINGS; |
2164 if (state == UNINITIALIZED && | 2169 if (state == UNINITIALIZED && |
2165 x->IsJSObject() && y->IsJSObject()) return OBJECTS; | 2170 x->IsJSObject() && y->IsJSObject()) return OBJECTS; |
2166 return GENERIC; | 2171 return GENERIC; |
2167 } | 2172 } |
2168 | 2173 |
2169 | 2174 |
2170 // Used from ic_<arch>.cc. | 2175 // Used from ic_<arch>.cc. |
2171 RUNTIME_FUNCTION(Code*, CompareIC_Miss) { | 2176 RUNTIME_FUNCTION(Code*, CompareIC_Miss) { |
2172 NoHandleAllocation na; | 2177 NoHandleAllocation na; |
(...skipping 11 matching lines...) Expand all Loading... |
2184 #undef ADDR | 2189 #undef ADDR |
2185 }; | 2190 }; |
2186 | 2191 |
2187 | 2192 |
2188 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2193 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2189 return IC_utilities[id]; | 2194 return IC_utilities[id]; |
2190 } | 2195 } |
2191 | 2196 |
2192 | 2197 |
2193 } } // namespace v8::internal | 2198 } } // namespace v8::internal |
OLD | NEW |