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 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 bool is_transition_stub = IsTransitionStubKind(stub_kind); | 1595 bool is_transition_stub = IsTransitionStubKind(stub_kind); |
1596 Handle<Map> receiver_map(receiver->map()); | 1596 Handle<Map> receiver_map(receiver->map()); |
1597 Handle<Map> monomorphic_map = receiver_map; | 1597 Handle<Map> monomorphic_map = receiver_map; |
1598 MapHandleList target_receiver_maps; | 1598 MapHandleList target_receiver_maps; |
1599 if (ic_state == UNINITIALIZED || ic_state == PREMONOMORPHIC) { | 1599 if (ic_state == UNINITIALIZED || ic_state == PREMONOMORPHIC) { |
1600 // Optimistically assume that ICs that haven't reached the MONOMORPHIC state | 1600 // Optimistically assume that ICs that haven't reached the MONOMORPHIC state |
1601 // yet will do so and stay there. | 1601 // yet will do so and stay there. |
1602 monomorphic = true; | 1602 monomorphic = true; |
1603 } else { | 1603 } else { |
1604 GetReceiverMapsForStub(Handle<Code>(target()), &target_receiver_maps); | 1604 GetReceiverMapsForStub(Handle<Code>(target()), &target_receiver_maps); |
1605 if (ic_state == MONOMORPHIC && is_transition_stub) { | 1605 if (ic_state == MONOMORPHIC && (is_transition_stub || stub_kind == LOAD)) { |
1606 // The first time a receiver is seen that is a transitioned version of the | 1606 // The first time a receiver is seen that is a transitioned version of the |
1607 // previous monomorphic receiver type, assume the new ElementsKind is the | 1607 // previous monomorphic receiver type, assume the new ElementsKind is the |
1608 // monomorphic type. This benefits global arrays that only transition | 1608 // monomorphic type. This benefits global arrays that only transition |
1609 // once, and all call sites accessing them are faster if they remain | 1609 // once, and all call sites accessing them are faster if they remain |
1610 // monomorphic. If this optimistic assumption is not true, the IC will | 1610 // monomorphic. If this optimistic assumption is not true, the IC will |
1611 // miss again and it will become polymorphic and support both the | 1611 // miss again and it will become polymorphic and support both the |
1612 // untransitioned and transitioned maps. | 1612 // untransitioned and transitioned maps. |
1613 monomorphic = IsMoreGeneralElementsKindTransition( | 1613 monomorphic = IsMoreGeneralElementsKindTransition( |
1614 target_receiver_maps.at(0)->elements_kind(), | 1614 target_receiver_maps.at(0)->elements_kind(), |
1615 receiver->GetElementsKind()); | 1615 receiver->GetElementsKind()); |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 #undef ADDR | 2672 #undef ADDR |
2673 }; | 2673 }; |
2674 | 2674 |
2675 | 2675 |
2676 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2676 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2677 return IC_utilities[id]; | 2677 return IC_utilities[id]; |
2678 } | 2678 } |
2679 | 2679 |
2680 | 2680 |
2681 } } // namespace v8::internal | 2681 } } // namespace v8::internal |
OLD | NEW |