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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 return code->is_keyed_store_stub() && | 193 return code->is_keyed_store_stub() && |
194 code->ic_state() == POLYMORPHIC; | 194 code->ic_state() == POLYMORPHIC; |
195 } | 195 } |
196 return false; | 196 return false; |
197 } | 197 } |
198 | 198 |
199 | 199 |
200 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { | 200 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { |
201 Handle<Object> value = GetInfo(expr->CallFeedbackId()); | 201 Handle<Object> value = GetInfo(expr->CallFeedbackId()); |
202 return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() || | 202 return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() || |
203 value->IsSmi() || | 203 value->IsSmi(); |
204 (value->IsCode() && Handle<Code>::cast(value)->ic_state() == MONOMORPHIC); | |
205 } | 204 } |
206 | 205 |
207 | 206 |
208 bool TypeFeedbackOracle::KeyedArrayCallIsHoley(Call* expr) { | |
209 Handle<Object> value = GetInfo(expr->CallFeedbackId()); | |
210 Handle<Code> code = Handle<Code>::cast(value); | |
211 return KeyedArrayCallStub::IsHoley(code); | |
212 } | |
213 | |
214 | |
215 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { | 207 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { |
216 Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); | 208 Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); |
217 return info->IsAllocationSite() || info->IsJSFunction(); | 209 return info->IsAllocationSite() || info->IsJSFunction(); |
218 } | 210 } |
219 | 211 |
220 | 212 |
221 bool TypeFeedbackOracle::ObjectLiteralStoreIsMonomorphic( | 213 bool TypeFeedbackOracle::ObjectLiteralStoreIsMonomorphic( |
222 ObjectLiteral::Property* prop) { | 214 ObjectLiteral::Property* prop) { |
223 Handle<Object> map_or_code = GetInfo(prop->key()->LiteralFeedbackId()); | 215 Handle<Object> map_or_code = GetInfo(prop->key()->LiteralFeedbackId()); |
224 return map_or_code->IsMap(); | 216 return map_or_code->IsMap(); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 for (int i = 0; i < infos->length(); i++) { | 613 for (int i = 0; i < infos->length(); i++) { |
622 RelocInfo reloc_entry = (*infos)[i]; | 614 RelocInfo reloc_entry = (*infos)[i]; |
623 Address target_address = reloc_entry.target_address(); | 615 Address target_address = reloc_entry.target_address(); |
624 TypeFeedbackId ast_id = | 616 TypeFeedbackId ast_id = |
625 TypeFeedbackId(static_cast<unsigned>((*infos)[i].data())); | 617 TypeFeedbackId(static_cast<unsigned>((*infos)[i].data())); |
626 Code* target = Code::GetCodeFromTargetAddress(target_address); | 618 Code* target = Code::GetCodeFromTargetAddress(target_address); |
627 switch (target->kind()) { | 619 switch (target->kind()) { |
628 case Code::LOAD_IC: | 620 case Code::LOAD_IC: |
629 case Code::STORE_IC: | 621 case Code::STORE_IC: |
630 case Code::CALL_IC: | 622 case Code::CALL_IC: |
| 623 case Code::KEYED_CALL_IC: |
631 if (target->ic_state() == MONOMORPHIC) { | 624 if (target->ic_state() == MONOMORPHIC) { |
632 if (target->kind() == Code::CALL_IC && | 625 if (target->kind() == Code::CALL_IC && |
633 target->check_type() != RECEIVER_MAP_CHECK) { | 626 target->check_type() != RECEIVER_MAP_CHECK) { |
634 SetInfo(ast_id, Smi::FromInt(target->check_type())); | 627 SetInfo(ast_id, Smi::FromInt(target->check_type())); |
635 } else { | 628 } else { |
636 Object* map = target->FindFirstMap(); | 629 Object* map = target->FindFirstMap(); |
637 if (map == NULL) { | 630 if (map == NULL) { |
638 SetInfo(ast_id, static_cast<Object*>(target)); | 631 SetInfo(ast_id, static_cast<Object*>(target)); |
639 } else if (!CanRetainOtherContext(Map::cast(map), | 632 } else if (!CanRetainOtherContext(Map::cast(map), |
640 *native_context_)) { | 633 *native_context_)) { |
641 Map* feedback = Map::cast(map)->CurrentMapForDeprecated(); | 634 Map* feedback = Map::cast(map)->CurrentMapForDeprecated(); |
642 if (feedback != NULL) SetInfo(ast_id, feedback); | 635 if (feedback != NULL) SetInfo(ast_id, feedback); |
643 } | 636 } |
644 } | 637 } |
645 } else { | 638 } else { |
646 SetInfo(ast_id, target); | 639 SetInfo(ast_id, target); |
647 } | 640 } |
648 break; | 641 break; |
649 | 642 |
650 case Code::KEYED_CALL_IC: | |
651 case Code::KEYED_LOAD_IC: | 643 case Code::KEYED_LOAD_IC: |
652 case Code::KEYED_STORE_IC: | 644 case Code::KEYED_STORE_IC: |
653 case Code::BINARY_OP_IC: | 645 case Code::BINARY_OP_IC: |
654 case Code::COMPARE_IC: | 646 case Code::COMPARE_IC: |
655 case Code::TO_BOOLEAN_IC: | 647 case Code::TO_BOOLEAN_IC: |
656 case Code::COMPARE_NIL_IC: | 648 case Code::COMPARE_NIL_IC: |
657 SetInfo(ast_id, target); | 649 SetInfo(ast_id, target); |
658 break; | 650 break; |
659 | 651 |
660 default: | 652 default: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 if (info.IsUninitialized()) return Representation::None(); | 694 if (info.IsUninitialized()) return Representation::None(); |
703 if (info.IsSmi()) return Representation::Smi(); | 695 if (info.IsSmi()) return Representation::Smi(); |
704 if (info.IsInteger32()) return Representation::Integer32(); | 696 if (info.IsInteger32()) return Representation::Integer32(); |
705 if (info.IsDouble()) return Representation::Double(); | 697 if (info.IsDouble()) return Representation::Double(); |
706 if (info.IsNumber()) return Representation::Double(); | 698 if (info.IsNumber()) return Representation::Double(); |
707 return Representation::Tagged(); | 699 return Representation::Tagged(); |
708 } | 700 } |
709 | 701 |
710 | 702 |
711 } } // namespace v8::internal | 703 } } // namespace v8::internal |
OLD | NEW |