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 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 Handle<HeapObject> heap_object = Handle<HeapObject>::cast(object); | 1964 Handle<HeapObject> heap_object = Handle<HeapObject>::cast(object); |
1965 if (heap_object->map()->IsMapInArrayPrototypeChain()) use_ic = false; | 1965 if (heap_object->map()->IsMapInArrayPrototypeChain()) use_ic = false; |
1966 } | 1966 } |
1967 | 1967 |
1968 if (use_ic) { | 1968 if (use_ic) { |
1969 ASSERT(!object->IsJSGlobalProxy()); | 1969 ASSERT(!object->IsJSGlobalProxy()); |
1970 | 1970 |
1971 if (miss_mode != MISS_FORCE_GENERIC) { | 1971 if (miss_mode != MISS_FORCE_GENERIC) { |
1972 if (object->IsJSObject()) { | 1972 if (object->IsJSObject()) { |
1973 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1973 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1974 bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure(); | 1974 if (!receiver->map()->DictionaryElementsInPrototypeChain()) { |
1975 if (receiver->elements()->map() == | 1975 bool key_is_smi_like = key->IsSmi() || !key->ToSmi()->IsFailure(); |
1976 isolate()->heap()->non_strict_arguments_elements_map()) { | 1976 if (receiver->elements()->map() == |
1977 stub = non_strict_arguments_stub(); | 1977 isolate()->heap()->non_strict_arguments_elements_map()) { |
1978 } else if (key_is_smi_like && | 1978 stub = non_strict_arguments_stub(); |
1979 (!target().is_identical_to(non_strict_arguments_stub()))) { | 1979 } else if (key_is_smi_like && |
1980 KeyedAccessStoreMode store_mode = | 1980 !target().is_identical_to(non_strict_arguments_stub())) { |
1981 GetStoreMode(receiver, key, value); | 1981 KeyedAccessStoreMode store_mode = |
1982 stub = StoreElementStub(receiver, store_mode); | 1982 GetStoreMode(receiver, key, value); |
| 1983 stub = StoreElementStub(receiver, store_mode); |
| 1984 } |
1983 } | 1985 } |
1984 } | 1986 } |
1985 } | 1987 } |
1986 } | 1988 } |
1987 } | 1989 } |
1988 | 1990 |
1989 if (!is_target_set()) { | 1991 if (!is_target_set()) { |
1990 if (*stub == *generic_stub()) { | 1992 if (*stub == *generic_stub()) { |
1991 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); | 1993 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic"); |
1992 } | 1994 } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2263 ic.UpdateState(receiver, key); | 2265 ic.UpdateState(receiver, key); |
2264 return ic.Store(receiver, key, args.at<Object>(2), MISS_FORCE_GENERIC); | 2266 return ic.Store(receiver, key, args.at<Object>(2), MISS_FORCE_GENERIC); |
2265 } | 2267 } |
2266 | 2268 |
2267 | 2269 |
2268 RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss) { | 2270 RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss) { |
2269 HandleScope scope(isolate); | 2271 HandleScope scope(isolate); |
2270 ASSERT(args.length() == 4); | 2272 ASSERT(args.length() == 4); |
2271 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); | 2273 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate); |
2272 Handle<Object> value = args.at<Object>(0); | 2274 Handle<Object> value = args.at<Object>(0); |
| 2275 Handle<Map> map = args.at<Map>(1); |
2273 Handle<Object> key = args.at<Object>(2); | 2276 Handle<Object> key = args.at<Object>(2); |
2274 Handle<Object> object = args.at<Object>(3); | 2277 Handle<Object> object = args.at<Object>(3); |
2275 StrictModeFlag strict_mode = ic.strict_mode(); | 2278 StrictModeFlag strict_mode = ic.strict_mode(); |
| 2279 if (object->IsJSObject()) { |
| 2280 JSObject::TransitionElementsKind(Handle<JSObject>::cast(object), |
| 2281 map->elements_kind()); |
| 2282 } |
2276 return Runtime::SetObjectProperty(isolate, | 2283 return Runtime::SetObjectProperty(isolate, |
2277 object, | 2284 object, |
2278 key, | 2285 key, |
2279 value, | 2286 value, |
2280 NONE, | 2287 NONE, |
2281 strict_mode); | 2288 strict_mode); |
2282 } | 2289 } |
2283 | 2290 |
2284 | 2291 |
2285 const char* BinaryOpIC::GetName(TypeInfo type_info) { | 2292 const char* BinaryOpIC::GetName(TypeInfo type_info) { |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 #undef ADDR | 2733 #undef ADDR |
2727 }; | 2734 }; |
2728 | 2735 |
2729 | 2736 |
2730 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2737 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2731 return IC_utilities[id]; | 2738 return IC_utilities[id]; |
2732 } | 2739 } |
2733 | 2740 |
2734 | 2741 |
2735 } } // namespace v8::internal | 2742 } } // namespace v8::internal |
OLD | NEW |