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

Unified Diff: src/ic.cc

Issue 7112010: Plumbing changes to merge various element kind implementaions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 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 | « src/ic.h ('k') | src/lithium.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index 64a085056d17d0cd96ea192f830136a17c2be51c..906734da47975587f329eccbd97c0068c3a6bbc8 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1070,10 +1070,10 @@ void LoadIC::UpdateCaches(LookupResult* lookup,
String* KeyedLoadIC::GetStubNameForCache(IC::State ic_state) {
if (ic_state == MONOMORPHIC) {
- return isolate()->heap()->KeyedLoadSpecializedMonomorphic_symbol();
+ return isolate()->heap()->KeyedLoadElementMonomorphic_symbol();
} else {
ASSERT(ic_state == MEGAMORPHIC);
- return isolate()->heap()->KeyedLoadSpecializedPolymorphic_symbol();
+ return isolate()->heap()->KeyedLoadElementPolymorphic_symbol();
}
}
@@ -1085,8 +1085,8 @@ MaybeObject* KeyedLoadIC::GetFastElementStubWithoutMapCheck(
MaybeObject* KeyedLoadIC::GetExternalArrayStubWithoutMapCheck(
- ExternalArrayType array_type) {
- return KeyedLoadExternalArrayStub(array_type).TryGetCode();
+ JSObject::ElementsKind elements_kind) {
+ return KeyedLoadExternalArrayStub(elements_kind).TryGetCode();
}
@@ -1697,8 +1697,8 @@ MaybeObject* KeyedIC::ComputeMonomorphicStubWithoutMapCheck(
return generic_stub;
}
Code* default_stub = Code::cast(maybe_default_stub);
- return GetExternalArrayStubWithoutMapCheck(
- default_stub->external_array_type());
+ Map* first_map = default_stub->FindFirstMap();
+ return GetExternalArrayStubWithoutMapCheck(first_map->elements_kind());
} else if (receiver_map->has_fast_elements()) {
bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE;
return GetFastElementStubWithoutMapCheck(is_js_array);
@@ -1713,14 +1713,10 @@ MaybeObject* KeyedIC::ComputeMonomorphicStub(JSObject* receiver,
StrictModeFlag strict_mode,
Code* generic_stub) {
Code* result = NULL;
- if (receiver->HasExternalArrayElements()) {
+ if (receiver->HasFastElements() ||
+ receiver->HasExternalArrayElements()) {
MaybeObject* maybe_stub =
- isolate()->stub_cache()->ComputeKeyedLoadOrStoreExternalArray(
- receiver, is_store, strict_mode);
- if (!maybe_stub->To(&result)) return maybe_stub;
- } else if (receiver->map()->has_fast_elements()) {
- MaybeObject* maybe_stub =
- isolate()->stub_cache()->ComputeKeyedLoadOrStoreFastElement(
+ isolate()->stub_cache()->ComputeKeyedLoadOrStoreElement(
receiver, is_store, strict_mode);
if (!maybe_stub->To(&result)) return maybe_stub;
} else {
@@ -1732,10 +1728,10 @@ MaybeObject* KeyedIC::ComputeMonomorphicStub(JSObject* receiver,
String* KeyedStoreIC::GetStubNameForCache(IC::State ic_state) {
if (ic_state == MONOMORPHIC) {
- return isolate()->heap()->KeyedStoreSpecializedMonomorphic_symbol();
+ return isolate()->heap()->KeyedStoreElementMonomorphic_symbol();
} else {
ASSERT(ic_state == MEGAMORPHIC);
- return isolate()->heap()->KeyedStoreSpecializedPolymorphic_symbol();
+ return isolate()->heap()->KeyedStoreElementPolymorphic_symbol();
}
}
@@ -1747,8 +1743,8 @@ MaybeObject* KeyedStoreIC::GetFastElementStubWithoutMapCheck(
MaybeObject* KeyedStoreIC::GetExternalArrayStubWithoutMapCheck(
- ExternalArrayType array_type) {
- return KeyedStoreExternalArrayStub(array_type).TryGetCode();
+ JSObject::ElementsKind elements_kind) {
+ return KeyedStoreExternalArrayStub(elements_kind).TryGetCode();
}
« no previous file with comments | « src/ic.h ('k') | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698