| 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 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 Isolate* isolate) { | 2582 Isolate* isolate) { |
| 2583 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo; | 2583 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo; |
| 2584 BinaryOpStub::decode_types_from_minor_key( | 2584 BinaryOpStub::decode_types_from_minor_key( |
| 2585 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo); | 2585 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo); |
| 2586 *left = TypeInfoToType(left_typeinfo, isolate); | 2586 *left = TypeInfoToType(left_typeinfo, isolate); |
| 2587 *right = TypeInfoToType(right_typeinfo, isolate); | 2587 *right = TypeInfoToType(right_typeinfo, isolate); |
| 2588 *result = TypeInfoToType(result_typeinfo, isolate); | 2588 *result = TypeInfoToType(result_typeinfo, isolate); |
| 2589 } | 2589 } |
| 2590 | 2590 |
| 2591 | 2591 |
| 2592 MaybeObject* UnaryOpIC::Transition(Handle<Object> object) { | |
| 2593 Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state(); | |
| 2594 UnaryOpStub stub(extra_ic_state); | |
| 2595 | |
| 2596 stub.UpdateStatus(object); | |
| 2597 | |
| 2598 Handle<Code> code = stub.GetCode(isolate()); | |
| 2599 set_target(*code); | |
| 2600 | |
| 2601 return stub.Result(object, isolate()); | |
| 2602 } | |
| 2603 | |
| 2604 | |
| 2605 RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss) { | |
| 2606 HandleScope scope(isolate); | |
| 2607 Handle<Object> object = args.at<Object>(0); | |
| 2608 UnaryOpIC ic(isolate); | |
| 2609 return ic.Transition(object); | |
| 2610 } | |
| 2611 | |
| 2612 | |
| 2613 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value, | 2592 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value, |
| 2614 Token::Value op) { | 2593 Token::Value op) { |
| 2615 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value); | 2594 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value); |
| 2616 if (type.IsSmi()) return BinaryOpIC::SMI; | 2595 if (type.IsSmi()) return BinaryOpIC::SMI; |
| 2617 if (type.IsInteger32()) { | 2596 if (type.IsInteger32()) { |
| 2618 if (kSmiValueSize == 32) return BinaryOpIC::SMI; | 2597 if (kSmiValueSize == 32) return BinaryOpIC::SMI; |
| 2619 return BinaryOpIC::INT32; | 2598 return BinaryOpIC::INT32; |
| 2620 } | 2599 } |
| 2621 if (type.IsNumber()) return BinaryOpIC::NUMBER; | 2600 if (type.IsNumber()) return BinaryOpIC::NUMBER; |
| 2622 if (type.IsString()) return BinaryOpIC::STRING; | 2601 if (type.IsString()) return BinaryOpIC::STRING; |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3128 #undef ADDR | 3107 #undef ADDR |
| 3129 }; | 3108 }; |
| 3130 | 3109 |
| 3131 | 3110 |
| 3132 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3111 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 3133 return IC_utilities[id]; | 3112 return IC_utilities[id]; |
| 3134 } | 3113 } |
| 3135 | 3114 |
| 3136 | 3115 |
| 3137 } } // namespace v8::internal | 3116 } } // namespace v8::internal |
| OLD | NEW |