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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 } else if (object->IsJSObject()) { | 1113 } else if (object->IsJSObject()) { |
1114 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1114 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1115 if (receiver->elements()->map() == | 1115 if (receiver->elements()->map() == |
1116 isolate()->heap()->non_strict_arguments_elements_map()) { | 1116 isolate()->heap()->non_strict_arguments_elements_map()) { |
1117 stub = non_strict_arguments_stub(); | 1117 stub = non_strict_arguments_stub(); |
1118 } else if (receiver->HasIndexedInterceptor()) { | 1118 } else if (receiver->HasIndexedInterceptor()) { |
1119 stub = indexed_interceptor_stub(); | 1119 stub = indexed_interceptor_stub(); |
1120 } else if (key->IsSmi() && (target() != *non_strict_arguments_stub())) { | 1120 } else if (key->IsSmi() && (target() != *non_strict_arguments_stub())) { |
1121 stub = ComputeStub(receiver, LOAD, kNonStrictMode, stub); | 1121 stub = ComputeStub(receiver, LOAD, kNonStrictMode, stub); |
1122 } | 1122 } |
| 1123 // If the IC is being replaced by the generic stub, loads from |
| 1124 // FAST_DOUBLE_ELEMENTS arrays will cause unboxing in Crankshafted |
| 1125 // code. To prevent these expensive allocations, proactively promote |
| 1126 // arrays to FAST_ELEMENTS ElementKinds. |
| 1127 if (*stub == *generic_stub()) { |
| 1128 if (receiver->HasFastDoubleElements()) { |
| 1129 MaybeObject* maybe_object = |
| 1130 receiver->TransitionElementsKind(FAST_ELEMENTS); |
| 1131 if (maybe_object->IsFailure()) return maybe_object; |
| 1132 } |
| 1133 } |
1123 } | 1134 } |
1124 } else { | 1135 } else { |
1125 TRACE_GENERIC_IC("KeyedLoadIC", "force generic"); | 1136 TRACE_GENERIC_IC("KeyedLoadIC", "force generic"); |
1126 } | 1137 } |
1127 if (!stub.is_null()) set_target(*stub); | 1138 if (!stub.is_null()) set_target(*stub); |
1128 } | 1139 } |
1129 | 1140 |
1130 TRACE_IC("KeyedLoadIC", key, state, target()); | 1141 TRACE_IC("KeyedLoadIC", key, state, target()); |
1131 | 1142 |
1132 // Get the property. | 1143 // Get the property. |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 #undef ADDR | 2438 #undef ADDR |
2428 }; | 2439 }; |
2429 | 2440 |
2430 | 2441 |
2431 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2442 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2432 return IC_utilities[id]; | 2443 return IC_utilities[id]; |
2433 } | 2444 } |
2434 | 2445 |
2435 | 2446 |
2436 } } // namespace v8::internal | 2447 } } // namespace v8::internal |
OLD | NEW |