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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 } | 1644 } |
1645 | 1645 |
1646 // Observed objects are always modified through the runtime. | 1646 // Observed objects are always modified through the runtime. |
1647 if (FLAG_harmony_observation && receiver->map()->is_observed()) { | 1647 if (FLAG_harmony_observation && receiver->map()->is_observed()) { |
1648 return JSReceiver::SetPropertyOrFail( | 1648 return JSReceiver::SetPropertyOrFail( |
1649 receiver, name, value, NONE, strict_mode, store_mode); | 1649 receiver, name, value, NONE, strict_mode, store_mode); |
1650 } | 1650 } |
1651 | 1651 |
1652 // Use specialized code for setting the length of arrays with fast | 1652 // Use specialized code for setting the length of arrays with fast |
1653 // properties. Slow properties might indicate redefinition of the length | 1653 // properties. Slow properties might indicate redefinition of the length |
1654 // property. | 1654 // property. Note that when redefined using Object.freeze, it's possible |
| 1655 // to have fast properties but a read-only length. |
1655 if (FLAG_use_ic && | 1656 if (FLAG_use_ic && |
1656 receiver->IsJSArray() && | 1657 receiver->IsJSArray() && |
1657 name->Equals(isolate()->heap()->length_string()) && | 1658 name->Equals(isolate()->heap()->length_string()) && |
1658 Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() && | 1659 Handle<JSArray>::cast(receiver)->AllowsSetElementsLength() && |
1659 receiver->HasFastProperties()) { | 1660 receiver->HasFastProperties() && |
| 1661 !receiver->map()->is_frozen()) { |
1660 Handle<Code> stub = | 1662 Handle<Code> stub = |
1661 StoreArrayLengthStub(kind(), strict_mode).GetCode(isolate()); | 1663 StoreArrayLengthStub(kind(), strict_mode).GetCode(isolate()); |
1662 set_target(*stub); | 1664 set_target(*stub); |
1663 TRACE_IC("StoreIC", name, state, *stub); | 1665 TRACE_IC("StoreIC", name, state, *stub); |
1664 return JSReceiver::SetPropertyOrFail( | 1666 return JSReceiver::SetPropertyOrFail( |
1665 receiver, name, value, NONE, strict_mode, store_mode); | 1667 receiver, name, value, NONE, strict_mode, store_mode); |
1666 } | 1668 } |
1667 | 1669 |
1668 if (receiver->IsJSGlobalProxy()) { | 1670 if (receiver->IsJSGlobalProxy()) { |
1669 if (FLAG_use_ic && kind() != Code::KEYED_STORE_IC) { | 1671 if (FLAG_use_ic && kind() != Code::KEYED_STORE_IC) { |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3081 #undef ADDR | 3083 #undef ADDR |
3082 }; | 3084 }; |
3083 | 3085 |
3084 | 3086 |
3085 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3087 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3086 return IC_utilities[id]; | 3088 return IC_utilities[id]; |
3087 } | 3089 } |
3088 | 3090 |
3089 | 3091 |
3090 } } // namespace v8::internal | 3092 } } // namespace v8::internal |
OLD | NEW |