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

Unified Diff: src/ic/ic.cc

Issue 2083283002: Remove element handling from named path (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic.cc
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index c37b251dec86379fcb0dfa8b7a5aa6a5cb6add43..b4f2bb4ba2986cb4c6b4fc07dd05c57874fc3930 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -611,24 +611,6 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<Name> name) {
return TypeError(MessageTemplate::kNonObjectPropertyLoad, object, name);
}
- // Check if the name is trivially convertible to an index and get
- // the element or char if so.
- uint32_t index;
- if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) {
- // Rewrite to the generic keyed load stub.
- if (FLAG_use_ic) {
- DCHECK(UseVector());
- ConfigureVectorState(MEGAMORPHIC, name);
- TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
- TRACE_IC("LoadIC", name);
- }
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
- Object::GetElement(isolate(), object, index),
- Object);
- return result;
- }
-
bool use_ic = MigrateDeprecated(object) ? false : FLAG_use_ic;
if (state() != UNINITIALIZED) {
@@ -1407,7 +1389,10 @@ MaybeHandle<Object> KeyedLoadIC::Load(Handle<Object> object,
// internalized string directly or is representable as a smi.
key = TryConvertKey(key, isolate());
- if (key->IsInternalizedString() || key->IsSymbol()) {
+ uint32_t index;
+ if ((key->IsInternalizedString() &&
+ !String::cast(*key)->AsArrayIndex(&index)) ||
+ key->IsSymbol()) {
ASSIGN_RETURN_ON_EXCEPTION(isolate(), load_handle,
LoadIC::Load(object, Handle<Name>::cast(key)),
Object);
@@ -1506,24 +1491,6 @@ bool StoreIC::LookupForWrite(LookupIterator* it, Handle<Object> value,
MaybeHandle<Object> StoreIC::Store(Handle<Object> object, Handle<Name> name,
Handle<Object> value,
JSReceiver::StoreFromKeyed store_mode) {
- // Check if the name is trivially convertible to an index and set the element.
- uint32_t index;
- if (kind() == Code::KEYED_STORE_IC && name->AsArrayIndex(&index)) {
- // Rewrite to the generic keyed store stub.
- if (FLAG_use_ic) {
- DCHECK(UseVector());
- ConfigureVectorState(MEGAMORPHIC, name);
- TRACE_IC("StoreIC", name);
- TRACE_GENERIC_IC(isolate(), "StoreIC", "name as array index");
- }
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate(), result,
- Object::SetElement(isolate(), object, index, value, language_mode()),
- Object);
- return result;
- }
-
if (object->IsJSGlobalObject() && name->IsString()) {
// Look up in script context table.
Handle<String> str_name = Handle<String>::cast(name);
« 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