| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) { | 136 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr, Side side) { |
| 137 Handle<Object> object = GetElement(map_, expr->position()); | 137 Handle<Object> object = GetElement(map_, expr->position()); |
| 138 TypeInfo unknown = TypeInfo::Unknown(); | 138 TypeInfo unknown = TypeInfo::Unknown(); |
| 139 if (!object->IsCode()) return unknown; | 139 if (!object->IsCode()) return unknown; |
| 140 Handle<Code> code = Handle<Code>::cast(object); | 140 Handle<Code> code = Handle<Code>::cast(object); |
| 141 if (!code->is_compare_ic_stub()) return unknown; | 141 if (!code->is_compare_ic_stub()) return unknown; |
| 142 | 142 |
| 143 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); | 143 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); |
| 144 switch (state) { | 144 switch (state) { |
| 145 case CompareIC::UNINITIALIZED: | 145 case CompareIC::UNINITIALIZED: |
| 146 // Uninitialized means never executed. |
| 147 // TODO(fschneider): Introduce a separate value for never-executed ICs. |
| 148 return unknown; |
| 146 case CompareIC::SMIS: | 149 case CompareIC::SMIS: |
| 147 return TypeInfo::Smi(); | 150 return TypeInfo::Smi(); |
| 148 case CompareIC::HEAP_NUMBERS: | 151 case CompareIC::HEAP_NUMBERS: |
| 149 return TypeInfo::Number(); | 152 return TypeInfo::Number(); |
| 150 case CompareIC::OBJECTS: | 153 case CompareIC::OBJECTS: |
| 151 // TODO(kasperl): We really need a type for JS objects here. | 154 // TODO(kasperl): We really need a type for JS objects here. |
| 152 return TypeInfo::NonPrimitive(); | 155 return TypeInfo::NonPrimitive(); |
| 153 case CompareIC::GENERIC: | 156 case CompareIC::GENERIC: |
| 154 default: | 157 default: |
| 155 return unknown; | 158 return unknown; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 178 return unknown; | 181 return unknown; |
| 179 } | 182 } |
| 180 } else if (code->is_type_recording_binary_op_stub()) { | 183 } else if (code->is_type_recording_binary_op_stub()) { |
| 181 TRBinaryOpIC::TypeInfo type = static_cast<TRBinaryOpIC::TypeInfo>( | 184 TRBinaryOpIC::TypeInfo type = static_cast<TRBinaryOpIC::TypeInfo>( |
| 182 code->type_recording_binary_op_type()); | 185 code->type_recording_binary_op_type()); |
| 183 TRBinaryOpIC::TypeInfo result_type = static_cast<TRBinaryOpIC::TypeInfo>( | 186 TRBinaryOpIC::TypeInfo result_type = static_cast<TRBinaryOpIC::TypeInfo>( |
| 184 code->type_recording_binary_op_result_type()); | 187 code->type_recording_binary_op_result_type()); |
| 185 | 188 |
| 186 switch (type) { | 189 switch (type) { |
| 187 case TRBinaryOpIC::UNINITIALIZED: | 190 case TRBinaryOpIC::UNINITIALIZED: |
| 191 // Uninitialized means never executed. |
| 192 // TODO(fschneider): Introduce a separate value for never-executed ICs |
| 193 return unknown; |
| 188 case TRBinaryOpIC::SMI: | 194 case TRBinaryOpIC::SMI: |
| 189 switch (result_type) { | 195 switch (result_type) { |
| 190 case TRBinaryOpIC::UNINITIALIZED: | 196 case TRBinaryOpIC::UNINITIALIZED: |
| 191 case TRBinaryOpIC::SMI: | 197 case TRBinaryOpIC::SMI: |
| 192 return TypeInfo::Smi(); | 198 return TypeInfo::Smi(); |
| 193 case TRBinaryOpIC::INT32: | 199 case TRBinaryOpIC::INT32: |
| 194 return TypeInfo::Integer32(); | 200 return TypeInfo::Integer32(); |
| 195 case TRBinaryOpIC::HEAP_NUMBER: | 201 case TRBinaryOpIC::HEAP_NUMBER: |
| 196 return TypeInfo::Double(); | 202 return TypeInfo::Double(); |
| 197 default: | 203 default: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 218 TypeInfo TypeFeedbackOracle::SwitchType(CaseClause* clause) { | 224 TypeInfo TypeFeedbackOracle::SwitchType(CaseClause* clause) { |
| 219 Handle<Object> object = GetElement(map_, clause->position()); | 225 Handle<Object> object = GetElement(map_, clause->position()); |
| 220 TypeInfo unknown = TypeInfo::Unknown(); | 226 TypeInfo unknown = TypeInfo::Unknown(); |
| 221 if (!object->IsCode()) return unknown; | 227 if (!object->IsCode()) return unknown; |
| 222 Handle<Code> code = Handle<Code>::cast(object); | 228 Handle<Code> code = Handle<Code>::cast(object); |
| 223 if (!code->is_compare_ic_stub()) return unknown; | 229 if (!code->is_compare_ic_stub()) return unknown; |
| 224 | 230 |
| 225 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); | 231 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); |
| 226 switch (state) { | 232 switch (state) { |
| 227 case CompareIC::UNINITIALIZED: | 233 case CompareIC::UNINITIALIZED: |
| 234 // Uninitialized means never executed. |
| 235 // TODO(fschneider): Introduce a separate value for never-executed ICs. |
| 236 return unknown; |
| 228 case CompareIC::SMIS: | 237 case CompareIC::SMIS: |
| 229 return TypeInfo::Smi(); | 238 return TypeInfo::Smi(); |
| 230 case CompareIC::HEAP_NUMBERS: | 239 case CompareIC::HEAP_NUMBERS: |
| 231 return TypeInfo::Number(); | 240 return TypeInfo::Number(); |
| 232 case CompareIC::OBJECTS: | 241 case CompareIC::OBJECTS: |
| 233 // TODO(kasperl): We really need a type for JS objects here. | 242 // TODO(kasperl): We really need a type for JS objects here. |
| 234 return TypeInfo::NonPrimitive(); | 243 return TypeInfo::NonPrimitive(); |
| 235 case CompareIC::GENERIC: | 244 case CompareIC::GENERIC: |
| 236 default: | 245 default: |
| 237 return unknown; | 246 return unknown; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 source_positions->Add(position); | 353 source_positions->Add(position); |
| 345 } | 354 } |
| 346 } else { | 355 } else { |
| 347 ASSERT(RelocInfo::IsPosition(mode)); | 356 ASSERT(RelocInfo::IsPosition(mode)); |
| 348 position = static_cast<int>(info->data()); | 357 position = static_cast<int>(info->data()); |
| 349 } | 358 } |
| 350 } | 359 } |
| 351 } | 360 } |
| 352 | 361 |
| 353 } } // namespace v8::internal | 362 } } // namespace v8::internal |
| OLD | NEW |