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

Side by Side Diff: src/ic/ic.cc

Issue 1254623002: Remove ExternalArray, derived types, and element kinds (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 4 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
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/ic-compiler.cc » ('j') | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1946 return megamorphic_stub(); 1946 return megamorphic_stub();
1947 } 1947 }
1948 } 1948 }
1949 1949
1950 // If the store mode isn't the standard mode, make sure that all polymorphic 1950 // If the store mode isn't the standard mode, make sure that all polymorphic
1951 // receivers are either external arrays, or all "normal" arrays. Otherwise, 1951 // receivers are either external arrays, or all "normal" arrays. Otherwise,
1952 // use the megamorphic stub. 1952 // use the megamorphic stub.
1953 if (store_mode != STANDARD_STORE) { 1953 if (store_mode != STANDARD_STORE) {
1954 int external_arrays = 0; 1954 int external_arrays = 0;
1955 for (int i = 0; i < target_receiver_maps.length(); ++i) { 1955 for (int i = 0; i < target_receiver_maps.length(); ++i) {
1956 if (target_receiver_maps[i]->has_external_array_elements() || 1956 if (target_receiver_maps[i]->has_fixed_typed_array_elements()) {
1957 target_receiver_maps[i]->has_fixed_typed_array_elements()) {
1958 external_arrays++; 1957 external_arrays++;
1959 } 1958 }
1960 } 1959 }
1961 if (external_arrays != 0 && 1960 if (external_arrays != 0 &&
1962 external_arrays != target_receiver_maps.length()) { 1961 external_arrays != target_receiver_maps.length()) {
1963 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", 1962 TRACE_GENERIC_IC(isolate(), "KeyedStoreIC",
1964 "unsupported combination of external and normal arrays"); 1963 "unsupported combination of external and normal arrays");
1965 return megamorphic_stub(); 1964 return megamorphic_stub();
1966 } 1965 }
1967 } 1966 }
(...skipping 16 matching lines...) Expand all
1984 return Map::TransitionElementsTo(map, FAST_DOUBLE_ELEMENTS); 1983 return Map::TransitionElementsTo(map, FAST_DOUBLE_ELEMENTS);
1985 case STORE_TRANSITION_HOLEY_SMI_TO_OBJECT: 1984 case STORE_TRANSITION_HOLEY_SMI_TO_OBJECT:
1986 case STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT: 1985 case STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT:
1987 case STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT: 1986 case STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT:
1988 case STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT: 1987 case STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT:
1989 return Map::TransitionElementsTo(map, FAST_HOLEY_ELEMENTS); 1988 return Map::TransitionElementsTo(map, FAST_HOLEY_ELEMENTS);
1990 case STORE_TRANSITION_HOLEY_SMI_TO_DOUBLE: 1989 case STORE_TRANSITION_HOLEY_SMI_TO_DOUBLE:
1991 case STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE: 1990 case STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE:
1992 return Map::TransitionElementsTo(map, FAST_HOLEY_DOUBLE_ELEMENTS); 1991 return Map::TransitionElementsTo(map, FAST_HOLEY_DOUBLE_ELEMENTS);
1993 case STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS: 1992 case STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS:
1994 DCHECK(map->has_external_array_elements()); 1993 DCHECK(map->has_fixed_typed_array_elements());
1995 // Fall through 1994 // Fall through
1996 case STORE_NO_TRANSITION_HANDLE_COW: 1995 case STORE_NO_TRANSITION_HANDLE_COW:
1997 case STANDARD_STORE: 1996 case STANDARD_STORE:
1998 case STORE_AND_GROW_NO_TRANSITION: 1997 case STORE_AND_GROW_NO_TRANSITION:
1999 return map; 1998 return map;
2000 } 1999 }
2001 UNREACHABLE(); 2000 UNREACHABLE();
2002 return MaybeHandle<Map>().ToHandleChecked(); 2001 return MaybeHandle<Map>().ToHandleChecked();
2003 } 2002 }
2004 2003
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 } else if (receiver->HasFastDoubleElements()) { 2066 } else if (receiver->HasFastDoubleElements()) {
2068 if (!value->IsSmi() && !value->IsHeapNumber()) { 2067 if (!value->IsSmi() && !value->IsHeapNumber()) {
2069 if (receiver->HasFastHoleyElements()) { 2068 if (receiver->HasFastHoleyElements()) {
2070 return STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT; 2069 return STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT;
2071 } else { 2070 } else {
2072 return STORE_TRANSITION_DOUBLE_TO_OBJECT; 2071 return STORE_TRANSITION_DOUBLE_TO_OBJECT;
2073 } 2072 }
2074 } 2073 }
2075 } 2074 }
2076 if (!FLAG_trace_external_array_abuse && 2075 if (!FLAG_trace_external_array_abuse &&
2077 receiver->map()->has_external_array_elements() && oob_access) { 2076 receiver->map()->has_fixed_typed_array_elements() && oob_access) {
2078 return STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS; 2077 return STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS;
2079 } 2078 }
2080 Heap* heap = receiver->GetHeap(); 2079 Heap* heap = receiver->GetHeap();
2081 if (receiver->elements()->map() == heap->fixed_cow_array_map()) { 2080 if (receiver->elements()->map() == heap->fixed_cow_array_map()) {
2082 return STORE_NO_TRANSITION_HANDLE_COW; 2081 return STORE_NO_TRANSITION_HANDLE_COW;
2083 } else { 2082 } else {
2084 return STANDARD_STORE; 2083 return STANDARD_STORE;
2085 } 2084 }
2086 } 2085 }
2087 } 2086 }
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
3087 KeyedLoadICNexus nexus(vector, vector_slot); 3086 KeyedLoadICNexus nexus(vector, vector_slot);
3088 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); 3087 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus);
3089 ic.UpdateState(receiver, key); 3088 ic.UpdateState(receiver, key);
3090 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); 3089 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key));
3091 } 3090 }
3092 3091
3093 return *result; 3092 return *result;
3094 } 3093 }
3095 } // namespace internal 3094 } // namespace internal
3096 } // namespace v8 3095 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/ic-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698