| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (!preliminary_checks) return false; | 121 if (!preliminary_checks) return false; |
| 122 Map* map = code->FindFirstMap(); | 122 Map* map = code->FindFirstMap(); |
| 123 if (map == NULL) return false; | 123 if (map == NULL) return false; |
| 124 map = map->CurrentMapForDeprecated(); | 124 map = map->CurrentMapForDeprecated(); |
| 125 return map != NULL && !CanRetainOtherContext(map, *native_context_); | 125 return map != NULL && !CanRetainOtherContext(map, *native_context_); |
| 126 } | 126 } |
| 127 return false; | 127 return false; |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 bool TypeFeedbackOracle::LoadIsPreMonomorphic(Property* expr) { | |
| 132 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); | |
| 133 if (map_or_code->IsCode()) { | |
| 134 Handle<Code> code = Handle<Code>::cast(map_or_code); | |
| 135 return code->ic_state() == PREMONOMORPHIC; | |
| 136 } | |
| 137 return false; | |
| 138 } | |
| 139 | |
| 140 | |
| 141 bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) { | 131 bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) { |
| 142 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); | 132 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
| 143 if (map_or_code->IsCode()) { | 133 if (map_or_code->IsCode()) { |
| 144 Handle<Code> code = Handle<Code>::cast(map_or_code); | 134 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 145 return code->is_keyed_load_stub() && code->ic_state() == POLYMORPHIC; | 135 return code->is_keyed_load_stub() && code->ic_state() == POLYMORPHIC; |
| 146 } | 136 } |
| 147 return false; | 137 return false; |
| 148 } | 138 } |
| 149 | 139 |
| 150 | 140 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 169 if (!preliminary_checks) return false; | 159 if (!preliminary_checks) return false; |
| 170 Map* map = code->FindFirstMap(); | 160 Map* map = code->FindFirstMap(); |
| 171 if (map == NULL) return false; | 161 if (map == NULL) return false; |
| 172 map = map->CurrentMapForDeprecated(); | 162 map = map->CurrentMapForDeprecated(); |
| 173 return map != NULL && !CanRetainOtherContext(map, *native_context_); | 163 return map != NULL && !CanRetainOtherContext(map, *native_context_); |
| 174 } | 164 } |
| 175 return false; | 165 return false; |
| 176 } | 166 } |
| 177 | 167 |
| 178 | 168 |
| 179 bool TypeFeedbackOracle::StoreIsPreMonomorphic(TypeFeedbackId ast_id) { | |
| 180 Handle<Object> map_or_code = GetInfo(ast_id); | |
| 181 if (map_or_code->IsCode()) { | |
| 182 Handle<Code> code = Handle<Code>::cast(map_or_code); | |
| 183 return code->ic_state() == PREMONOMORPHIC; | |
| 184 } | |
| 185 return false; | |
| 186 } | |
| 187 | |
| 188 | |
| 189 bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) { | 169 bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) { |
| 190 Handle<Object> map_or_code = GetInfo(ast_id); | 170 Handle<Object> map_or_code = GetInfo(ast_id); |
| 191 if (map_or_code->IsCode()) { | 171 if (map_or_code->IsCode()) { |
| 192 Handle<Code> code = Handle<Code>::cast(map_or_code); | 172 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 193 return code->is_keyed_store_stub() && | 173 return code->is_keyed_store_stub() && |
| 194 code->ic_state() == POLYMORPHIC; | 174 code->ic_state() == POLYMORPHIC; |
| 195 } | 175 } |
| 196 return false; | 176 return false; |
| 197 } | 177 } |
| 198 | 178 |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 if (feedback != NULL) SetInfo(ast_id, feedback); | 615 if (feedback != NULL) SetInfo(ast_id, feedback); |
| 636 } | 616 } |
| 637 } | 617 } |
| 638 } else { | 618 } else { |
| 639 SetInfo(ast_id, target); | 619 SetInfo(ast_id, target); |
| 640 } | 620 } |
| 641 break; | 621 break; |
| 642 | 622 |
| 643 case Code::KEYED_LOAD_IC: | 623 case Code::KEYED_LOAD_IC: |
| 644 case Code::KEYED_STORE_IC: | 624 case Code::KEYED_STORE_IC: |
| 625 if (target->ic_state() == MONOMORPHIC || |
| 626 target->ic_state() == POLYMORPHIC) { |
| 627 SetInfo(ast_id, target); |
| 628 } |
| 629 break; |
| 630 |
| 645 case Code::BINARY_OP_IC: | 631 case Code::BINARY_OP_IC: |
| 646 case Code::COMPARE_IC: | 632 case Code::COMPARE_IC: |
| 647 case Code::TO_BOOLEAN_IC: | 633 case Code::TO_BOOLEAN_IC: |
| 648 case Code::COMPARE_NIL_IC: | 634 case Code::COMPARE_NIL_IC: |
| 649 SetInfo(ast_id, target); | 635 SetInfo(ast_id, target); |
| 650 break; | 636 break; |
| 651 | 637 |
| 652 default: | 638 default: |
| 653 break; | 639 break; |
| 654 } | 640 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 if (info.IsUninitialized()) return Representation::None(); | 680 if (info.IsUninitialized()) return Representation::None(); |
| 695 if (info.IsSmi()) return Representation::Smi(); | 681 if (info.IsSmi()) return Representation::Smi(); |
| 696 if (info.IsInteger32()) return Representation::Integer32(); | 682 if (info.IsInteger32()) return Representation::Integer32(); |
| 697 if (info.IsDouble()) return Representation::Double(); | 683 if (info.IsDouble()) return Representation::Double(); |
| 698 if (info.IsNumber()) return Representation::Double(); | 684 if (info.IsNumber()) return Representation::Double(); |
| 699 return Representation::Tagged(); | 685 return Representation::Tagged(); |
| 700 } | 686 } |
| 701 | 687 |
| 702 | 688 |
| 703 } } // namespace v8::internal | 689 } } // namespace v8::internal |
| OLD | NEW |