| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 case BinaryOpIC::NUMBER: return TypeInfo::Double(); | 451 case BinaryOpIC::NUMBER: return TypeInfo::Double(); |
| 452 case BinaryOpIC::ODDBALL: return TypeInfo::Unknown(); | 452 case BinaryOpIC::ODDBALL: return TypeInfo::Unknown(); |
| 453 case BinaryOpIC::STRING: return TypeInfo::String(); | 453 case BinaryOpIC::STRING: return TypeInfo::String(); |
| 454 case BinaryOpIC::GENERIC: return TypeInfo::Unknown(); | 454 case BinaryOpIC::GENERIC: return TypeInfo::Unknown(); |
| 455 } | 455 } |
| 456 UNREACHABLE(); | 456 UNREACHABLE(); |
| 457 return TypeInfo::Unknown(); | 457 return TypeInfo::Unknown(); |
| 458 } | 458 } |
| 459 | 459 |
| 460 | 460 |
| 461 void TypeFeedbackOracle::BinaryType(BinaryOperation* expr, | 461 void TypeFeedbackOracle::BinaryType(TypeFeedbackId type_feedback_id, |
| 462 TypeInfo* left, | 462 TypeInfo* left, |
| 463 TypeInfo* right, | 463 TypeInfo* right, |
| 464 TypeInfo* result) { | 464 TypeInfo* result) { |
| 465 Handle<Object> object = GetInfo(expr->BinaryOperationFeedbackId()); | 465 Handle<Object> object = GetInfo(type_feedback_id); |
| 466 TypeInfo unknown = TypeInfo::Unknown(); | 466 TypeInfo unknown = TypeInfo::Unknown(); |
| 467 if (!object->IsCode()) { | 467 if (!object->IsCode()) { |
| 468 *left = *right = *result = unknown; | 468 *left = *right = *result = unknown; |
| 469 return; | 469 return; |
| 470 } | 470 } |
| 471 Handle<Code> code = Handle<Code>::cast(object); | 471 Handle<Code> code = Handle<Code>::cast(object); |
| 472 if (code->is_binary_op_stub()) { | 472 if (code->is_binary_op_stub()) { |
| 473 BinaryOpIC::TypeInfo left_type, right_type, result_type; | 473 BinaryOpIC::TypeInfo left_type, right_type, result_type; |
| 474 BinaryOpStub::decode_types_from_minor_key(code->stub_info(), &left_type, | 474 BinaryOpStub::decode_types_from_minor_key(code->stub_info(), &left_type, |
| 475 &right_type, &result_type); | 475 &right_type, &result_type); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 USE(maybe_result); | 759 USE(maybe_result); |
| 760 #ifdef DEBUG | 760 #ifdef DEBUG |
| 761 Object* result = NULL; | 761 Object* result = NULL; |
| 762 // Dictionary has been allocated with sufficient size for all elements. | 762 // Dictionary has been allocated with sufficient size for all elements. |
| 763 ASSERT(maybe_result->ToObject(&result)); | 763 ASSERT(maybe_result->ToObject(&result)); |
| 764 ASSERT(*dictionary_ == result); | 764 ASSERT(*dictionary_ == result); |
| 765 #endif | 765 #endif |
| 766 } | 766 } |
| 767 | 767 |
| 768 } } // namespace v8::internal | 768 } } // namespace v8::internal |
| OLD | NEW |