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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 BinaryOpIC::State state(code->extended_extra_ic_state()); | 424 BinaryOpIC::State state(code->extended_extra_ic_state()); |
425 ASSERT_EQ(op, state.op()); | 425 ASSERT_EQ(op, state.op()); |
426 | 426 |
427 *left = state.GetLeftType(isolate()); | 427 *left = state.GetLeftType(isolate()); |
428 *right = state.GetRightType(isolate()); | 428 *right = state.GetRightType(isolate()); |
429 *result = state.GetResultType(isolate()); | 429 *result = state.GetResultType(isolate()); |
430 *fixed_right_arg = state.fixed_right_arg(); | 430 *fixed_right_arg = state.fixed_right_arg(); |
431 } | 431 } |
432 | 432 |
433 | 433 |
434 Handle<Type> TypeFeedbackOracle::ClauseType(TypeFeedbackId id) { | |
435 Handle<Object> info = GetInfo(id); | |
436 Handle<Type> result(Type::None(), isolate_); | |
437 if (info->IsCode() && Handle<Code>::cast(info)->is_compare_ic_stub()) { | |
438 Handle<Code> code = Handle<Code>::cast(info); | |
439 CompareIC::State state = ICCompareStub::CompareState(code->stub_info()); | |
440 result = CompareIC::StateToType(isolate_, state); | |
441 } | |
442 return result; | |
443 } | |
444 | |
445 | |
446 Handle<Type> TypeFeedbackOracle::CountType(TypeFeedbackId id) { | 434 Handle<Type> TypeFeedbackOracle::CountType(TypeFeedbackId id) { |
447 Handle<Object> object = GetInfo(id); | 435 Handle<Object> object = GetInfo(id); |
448 if (!object->IsCode()) return handle(Type::None(), isolate_); | 436 if (!object->IsCode()) return handle(Type::None(), isolate_); |
449 Handle<Code> code = Handle<Code>::cast(object); | 437 Handle<Code> code = Handle<Code>::cast(object); |
450 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); | 438 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); |
451 BinaryOpIC::State state(code->extended_extra_ic_state()); | 439 BinaryOpIC::State state(code->extended_extra_ic_state()); |
452 return state.GetLeftType(isolate()); | 440 return state.GetLeftType(isolate()); |
453 } | 441 } |
454 | 442 |
455 | 443 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 if (info.IsUninitialized()) return Representation::None(); | 744 if (info.IsUninitialized()) return Representation::None(); |
757 if (info.IsSmi()) return Representation::Smi(); | 745 if (info.IsSmi()) return Representation::Smi(); |
758 if (info.IsInteger32()) return Representation::Integer32(); | 746 if (info.IsInteger32()) return Representation::Integer32(); |
759 if (info.IsDouble()) return Representation::Double(); | 747 if (info.IsDouble()) return Representation::Double(); |
760 if (info.IsNumber()) return Representation::Double(); | 748 if (info.IsNumber()) return Representation::Double(); |
761 return Representation::Tagged(); | 749 return Representation::Tagged(); |
762 } | 750 } |
763 | 751 |
764 | 752 |
765 } } // namespace v8::internal | 753 } } // namespace v8::internal |
OLD | NEW |