Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: src/ic.cc

Issue 13910012: Record the initial Map in the Store IC if it is not the same as the transitioned Map (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 // copying COW arrays and silently ignoring some OOB stores into external 1674 // copying COW arrays and silently ignoring some OOB stores into external
1675 // arrays, but for now use the generic. 1675 // arrays, but for now use the generic.
1676 TRACE_GENERIC_IC(isolate(), "KeyedIC", "COW/OOB external array"); 1676 TRACE_GENERIC_IC(isolate(), "KeyedIC", "COW/OOB external array");
1677 return strict_mode == kStrictMode 1677 return strict_mode == kStrictMode
1678 ? generic_stub_strict() 1678 ? generic_stub_strict()
1679 : generic_stub(); 1679 : generic_stub();
1680 } 1680 }
1681 1681
1682 State ic_state = target()->ic_state(); 1682 State ic_state = target()->ic_state();
1683 Handle<Map> receiver_map(receiver->map(), isolate()); 1683 Handle<Map> receiver_map(receiver->map(), isolate());
1684 MapHandleList target_receiver_maps;
1684 if (ic_state == UNINITIALIZED || ic_state == PREMONOMORPHIC) { 1685 if (ic_state == UNINITIALIZED || ic_state == PREMONOMORPHIC) {
1685 // Optimistically assume that ICs that haven't reached the MONOMORPHIC state 1686 // Optimistically assume that ICs that haven't reached the MONOMORPHIC state
1686 // yet will do so and stay there. 1687 // yet will do so and stay there.
1687 Handle<Map> monomorphic_map = ComputeTransitionedMap(receiver, store_mode); 1688 Handle<Map> monomorphic_map = ComputeTransitionedMap(receiver, store_mode);
1688 store_mode = GetNonTransitioningStoreMode(store_mode); 1689 store_mode = GetNonTransitioningStoreMode(store_mode);
1689 return isolate()->stub_cache()->ComputeKeyedStoreElement( 1690 if (*monomorphic_map != *receiver_map) {
1690 monomorphic_map, strict_mode, store_mode); 1691 target_receiver_maps.Add(receiver_map);
1692 target_receiver_maps.Add(monomorphic_map);
1693 return isolate()->stub_cache()->ComputeStoreElementPolymorphic(
1694 &target_receiver_maps, store_mode, strict_mode);
1695 } else {
1696 return isolate()->stub_cache()->ComputeKeyedStoreElement(
1697 monomorphic_map, strict_mode, store_mode);
1698 }
1691 } 1699 }
1692 1700
1693 MapHandleList target_receiver_maps;
1694 target()->FindAllMaps(&target_receiver_maps); 1701 target()->FindAllMaps(&target_receiver_maps);
1695 if (target_receiver_maps.length() == 0) { 1702 if (target_receiver_maps.length() == 0) {
1696 // In the case that there is a non-map-specific IC is installed (e.g. keyed 1703 // In the case that there is a non-map-specific IC is installed (e.g. keyed
1697 // stores into properties in dictionary mode), then there will be not 1704 // stores into properties in dictionary mode), then there will be not
1698 // receiver maps in the target. 1705 // receiver maps in the target.
1699 return strict_mode == kStrictMode 1706 return strict_mode == kStrictMode
1700 ? generic_stub_strict() 1707 ? generic_stub_strict()
1701 : generic_stub(); 1708 : generic_stub();
1702 } 1709 }
1703 1710
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 #undef ADDR 2805 #undef ADDR
2799 }; 2806 };
2800 2807
2801 2808
2802 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2809 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2803 return IC_utilities[id]; 2810 return IC_utilities[id];
2804 } 2811 }
2805 2812
2806 2813
2807 } } // namespace v8::internal 2814 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698