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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 switch (target->kind()) { | 384 switch (target->kind()) { |
385 case Code::LOAD_IC: return LoadIC::Clear(address, target); | 385 case Code::LOAD_IC: return LoadIC::Clear(address, target); |
386 case Code::KEYED_LOAD_IC: return KeyedLoadIC::Clear(address, target); | 386 case Code::KEYED_LOAD_IC: return KeyedLoadIC::Clear(address, target); |
387 case Code::STORE_IC: return StoreIC::Clear(address, target); | 387 case Code::STORE_IC: return StoreIC::Clear(address, target); |
388 case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target); | 388 case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target); |
389 case Code::CALL_IC: return CallIC::Clear(address, target); | 389 case Code::CALL_IC: return CallIC::Clear(address, target); |
390 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target); | 390 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target); |
391 case Code::COMPARE_IC: return CompareIC::Clear(address, target); | 391 case Code::COMPARE_IC: return CompareIC::Clear(address, target); |
392 case Code::COMPARE_NIL_IC: return CompareNilIC::Clear(address, target); | 392 case Code::COMPARE_NIL_IC: return CompareNilIC::Clear(address, target); |
| 393 case Code::UNARY_OP_IC: |
393 case Code::BINARY_OP_IC: | 394 case Code::BINARY_OP_IC: |
394 case Code::TO_BOOLEAN_IC: | 395 case Code::TO_BOOLEAN_IC: |
395 // Clearing these is tricky and does not | 396 // Clearing these is tricky and does not |
396 // make any performance difference. | 397 // make any performance difference. |
397 return; | 398 return; |
398 default: UNREACHABLE(); | 399 default: UNREACHABLE(); |
399 } | 400 } |
400 } | 401 } |
401 | 402 |
402 | 403 |
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 Isolate* isolate) { | 2582 Isolate* isolate) { |
2582 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo; | 2583 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo; |
2583 BinaryOpStub::decode_types_from_minor_key( | 2584 BinaryOpStub::decode_types_from_minor_key( |
2584 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo); | 2585 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo); |
2585 *left = TypeInfoToType(left_typeinfo, isolate); | 2586 *left = TypeInfoToType(left_typeinfo, isolate); |
2586 *right = TypeInfoToType(right_typeinfo, isolate); | 2587 *right = TypeInfoToType(right_typeinfo, isolate); |
2587 *result = TypeInfoToType(result_typeinfo, isolate); | 2588 *result = TypeInfoToType(result_typeinfo, isolate); |
2588 } | 2589 } |
2589 | 2590 |
2590 | 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 |
2591 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value, | 2613 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value, |
2592 Token::Value op) { | 2614 Token::Value op) { |
2593 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value); | 2615 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value); |
2594 if (type.IsSmi()) return BinaryOpIC::SMI; | 2616 if (type.IsSmi()) return BinaryOpIC::SMI; |
2595 if (type.IsInteger32()) { | 2617 if (type.IsInteger32()) { |
2596 if (kSmiValueSize == 32) return BinaryOpIC::SMI; | 2618 if (kSmiValueSize == 32) return BinaryOpIC::SMI; |
2597 return BinaryOpIC::INT32; | 2619 return BinaryOpIC::INT32; |
2598 } | 2620 } |
2599 if (type.IsNumber()) return BinaryOpIC::NUMBER; | 2621 if (type.IsNumber()) return BinaryOpIC::NUMBER; |
2600 if (type.IsString()) return BinaryOpIC::STRING; | 2622 if (type.IsString()) return BinaryOpIC::STRING; |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3106 #undef ADDR | 3128 #undef ADDR |
3107 }; | 3129 }; |
3108 | 3130 |
3109 | 3131 |
3110 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3132 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3111 return IC_utilities[id]; | 3133 return IC_utilities[id]; |
3112 } | 3134 } |
3113 | 3135 |
3114 | 3136 |
3115 } } // namespace v8::internal | 3137 } } // namespace v8::internal |
OLD | NEW |