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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 878263002: Add MEGAMORPHIC state support for KeyedLoadIC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/builtins.cc ('k') | src/ic/arm/ic-arm.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/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/field-index.h" 9 #include "src/field-index.h"
10 #include "src/hydrogen.h" 10 #include "src/hydrogen.h"
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 hash = AddUncasted<HShr>(hash, Add<HConstant>(Name::kHashShift)); 1900 hash = AddUncasted<HShr>(hash, Add<HConstant>(Name::kHashShift));
1901 1901
1902 HValue* value = BuildUncheckedDictionaryElementLoad(receiver, 1902 HValue* value = BuildUncheckedDictionaryElementLoad(receiver,
1903 properties, 1903 properties,
1904 key, 1904 key,
1905 hash); 1905 hash);
1906 Push(value); 1906 Push(value);
1907 } 1907 }
1908 if_dict_properties.Else(); 1908 if_dict_properties.Else();
1909 { 1909 {
1910 // TODO(dcarney): don't use keyed lookup cache, but convert to use
1911 // megamorphic stub cache.
1912 UNREACHABLE();
1910 // Key is string, properties are fast mode 1913 // Key is string, properties are fast mode
1911 HValue* hash = BuildKeyedLookupCacheHash(receiver, key); 1914 HValue* hash = BuildKeyedLookupCacheHash(receiver, key);
1912 1915
1913 ExternalReference cache_keys_ref = 1916 ExternalReference cache_keys_ref =
1914 ExternalReference::keyed_lookup_cache_keys(isolate()); 1917 ExternalReference::keyed_lookup_cache_keys(isolate());
1915 HValue* cache_keys = Add<HConstant>(cache_keys_ref); 1918 HValue* cache_keys = Add<HConstant>(cache_keys_ref);
1916 1919
1917 HValue* map = 1920 HValue* map =
1918 Add<HLoadNamedField>(receiver, nullptr, HObjectAccess::ForMap()); 1921 Add<HLoadNamedField>(receiver, nullptr, HObjectAccess::ForMap());
1919 HValue* base_index = AddUncasted<HMul>(hash, Add<HConstant>(2)); 1922 HValue* base_index = AddUncasted<HMul>(hash, Add<HConstant>(2));
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 array_checker.Else(); 2172 array_checker.Else();
2170 { 2173 {
2171 // Check if the IC is in generic state. 2174 // Check if the IC is in generic state.
2172 IfBuilder generic_checker(this); 2175 IfBuilder generic_checker(this);
2173 HConstant* generic_symbol = 2176 HConstant* generic_symbol =
2174 Add<HConstant>(isolate()->factory()->generic_symbol()); 2177 Add<HConstant>(isolate()->factory()->generic_symbol());
2175 generic_checker.If<HCompareObjectEqAndBranch>(feedback, generic_symbol); 2178 generic_checker.If<HCompareObjectEqAndBranch>(feedback, generic_symbol);
2176 generic_checker.Then(); 2179 generic_checker.Then();
2177 { 2180 {
2178 // Tail-call to the generic KeyedLoadIC, treating it like a handler. 2181 // Tail-call to the generic KeyedLoadIC, treating it like a handler.
2179 Handle<Code> stub = KeyedLoadIC::generic_stub(isolate()); 2182 Handle<Code> stub = KeyedLoadIC::megamorphic_stub(isolate());
2180 HValue* constant_stub = Add<HConstant>(stub); 2183 HValue* constant_stub = Add<HConstant>(stub);
2181 LoadDescriptor descriptor(isolate()); 2184 LoadDescriptor descriptor(isolate());
2182 HValue* op_vals[] = {context(), receiver, name}; 2185 HValue* op_vals[] = {context(), receiver, name};
2183 Add<HCallWithDescriptor>(constant_stub, 0, descriptor, 2186 Add<HCallWithDescriptor>(constant_stub, 0, descriptor,
2184 Vector<HValue*>(op_vals, 3), TAIL_CALL); 2187 Vector<HValue*>(op_vals, 3), TAIL_CALL);
2185 // We never return here, it is a tail call. 2188 // We never return here, it is a tail call.
2186 } 2189 }
2187 generic_checker.End(); 2190 generic_checker.End();
2188 } 2191 }
2189 array_checker.End(); 2192 array_checker.End();
(...skipping 22 matching lines...) Expand all
2212 // megamorphic case is handled as part of the default stub. 2215 // megamorphic case is handled as part of the default stub.
2213 DCHECK(!FLAG_vector_ics); 2216 DCHECK(!FLAG_vector_ics);
2214 2217
2215 // Probe the stub cache. 2218 // Probe the stub cache.
2216 Add<HTailCallThroughMegamorphicCache>(receiver, name); 2219 Add<HTailCallThroughMegamorphicCache>(receiver, name);
2217 2220
2218 // We never continue. 2221 // We never continue.
2219 return graph()->GetConstant0(); 2222 return graph()->GetConstant0();
2220 } 2223 }
2221 } } // namespace v8::internal 2224 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/ic/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698