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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 Handle<Object> object = GetInfo(expr->id()); | 217 Handle<Object> object = GetInfo(expr->id()); |
218 TypeInfo unknown = TypeInfo::Unknown(); | 218 TypeInfo unknown = TypeInfo::Unknown(); |
219 if (!object->IsCode()) return unknown; | 219 if (!object->IsCode()) return unknown; |
220 Handle<Code> code = Handle<Code>::cast(object); | 220 Handle<Code> code = Handle<Code>::cast(object); |
221 if (!code->is_compare_ic_stub()) return unknown; | 221 if (!code->is_compare_ic_stub()) return unknown; |
222 | 222 |
223 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); | 223 CompareIC::State state = static_cast<CompareIC::State>(code->compare_state()); |
224 switch (state) { | 224 switch (state) { |
225 case CompareIC::UNINITIALIZED: | 225 case CompareIC::UNINITIALIZED: |
226 // Uninitialized means never executed. | 226 // Uninitialized means never executed. |
227 return TypeInfo::Uninitialized(); | 227 // TODO(fschneider): Introduce a separate value for never-executed ICs. |
| 228 return unknown; |
228 case CompareIC::SMIS: | 229 case CompareIC::SMIS: |
229 return TypeInfo::Smi(); | 230 return TypeInfo::Smi(); |
230 case CompareIC::HEAP_NUMBERS: | 231 case CompareIC::HEAP_NUMBERS: |
231 return TypeInfo::Number(); | 232 return TypeInfo::Number(); |
232 case CompareIC::SYMBOLS: | 233 case CompareIC::SYMBOLS: |
233 case CompareIC::STRINGS: | 234 case CompareIC::STRINGS: |
234 return TypeInfo::String(); | 235 return TypeInfo::String(); |
235 case CompareIC::OBJECTS: | 236 case CompareIC::OBJECTS: |
236 // TODO(kasperl): We really need a type for JS objects here. | 237 // TODO(kasperl): We really need a type for JS objects here. |
237 return TypeInfo::NonPrimitive(); | 238 return TypeInfo::NonPrimitive(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 Handle<Code> code = Handle<Code>::cast(object); | 279 Handle<Code> code = Handle<Code>::cast(object); |
279 if (code->is_binary_op_stub()) { | 280 if (code->is_binary_op_stub()) { |
280 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>( | 281 BinaryOpIC::TypeInfo type = static_cast<BinaryOpIC::TypeInfo>( |
281 code->binary_op_type()); | 282 code->binary_op_type()); |
282 BinaryOpIC::TypeInfo result_type = static_cast<BinaryOpIC::TypeInfo>( | 283 BinaryOpIC::TypeInfo result_type = static_cast<BinaryOpIC::TypeInfo>( |
283 code->binary_op_result_type()); | 284 code->binary_op_result_type()); |
284 | 285 |
285 switch (type) { | 286 switch (type) { |
286 case BinaryOpIC::UNINITIALIZED: | 287 case BinaryOpIC::UNINITIALIZED: |
287 // Uninitialized means never executed. | 288 // Uninitialized means never executed. |
288 return TypeInfo::Uninitialized(); | 289 // TODO(fschneider): Introduce a separate value for never-executed ICs |
| 290 return unknown; |
289 case BinaryOpIC::SMI: | 291 case BinaryOpIC::SMI: |
290 switch (result_type) { | 292 switch (result_type) { |
291 case BinaryOpIC::UNINITIALIZED: | 293 case BinaryOpIC::UNINITIALIZED: |
292 case BinaryOpIC::SMI: | 294 case BinaryOpIC::SMI: |
293 return TypeInfo::Smi(); | 295 return TypeInfo::Smi(); |
294 case BinaryOpIC::INT32: | 296 case BinaryOpIC::INT32: |
295 return TypeInfo::Integer32(); | 297 return TypeInfo::Integer32(); |
296 case BinaryOpIC::HEAP_NUMBER: | 298 case BinaryOpIC::HEAP_NUMBER: |
297 return TypeInfo::Double(); | 299 return TypeInfo::Double(); |
298 default: | 300 default: |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 static_cast<int>(info->pc() - code->instruction_start())); | 498 static_cast<int>(info->pc() - code->instruction_start())); |
497 ASSERT(ast_ids->length() == 0 || | 499 ASSERT(ast_ids->length() == 0 || |
498 (*ast_ids)[ast_ids->length()-1] != | 500 (*ast_ids)[ast_ids->length()-1] != |
499 static_cast<unsigned>(info->data())); | 501 static_cast<unsigned>(info->data())); |
500 ast_ids->Add(static_cast<unsigned>(info->data())); | 502 ast_ids->Add(static_cast<unsigned>(info->data())); |
501 } | 503 } |
502 } | 504 } |
503 } | 505 } |
504 | 506 |
505 } } // namespace v8::internal | 507 } } // namespace v8::internal |
OLD | NEW |