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

Unified Diff: src/ic/ic-compiler.cc

Issue 2538693002: Revert of [ic] Use validity cells to protect keyed element stores against object's prototype chain… (Closed)
Patch Set: Created 4 years, 1 month 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/ic-compiler.h ('k') | src/ic/ic-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-compiler.cc
diff --git a/src/ic/ic-compiler.cc b/src/ic/ic-compiler.cc
index 1d71b57ef3f58b31ccb6c0f7b54e914f4972f3e1..750c88daa9dfd0c3f4919ab9aba0168a16d5e83d 100644
--- a/src/ic/ic-compiler.cc
+++ b/src/ic/ic-compiler.cc
@@ -10,7 +10,7 @@
namespace v8 {
namespace internal {
-Handle<Object> PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler(
+Handle<Code> PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler(
Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) {
Isolate* isolate = receiver_map->GetIsolate();
@@ -20,14 +20,14 @@
store_mode == STORE_NO_TRANSITION_HANDLE_COW);
PropertyICCompiler compiler(isolate);
- Handle<Object> handler =
+ Handle<Code> code =
compiler.CompileKeyedStoreMonomorphicHandler(receiver_map, store_mode);
- return handler;
+ return code;
}
void PropertyICCompiler::ComputeKeyedStorePolymorphicHandlers(
MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
- List<Handle<Object>>* handlers, KeyedAccessStoreMode store_mode) {
+ CodeHandleList* handlers, KeyedAccessStoreMode store_mode) {
Isolate* isolate = receiver_maps->at(0)->GetIsolate();
DCHECK(store_mode == STANDARD_STORE ||
store_mode == STORE_AND_GROW_NO_TRANSITION ||
@@ -38,12 +38,13 @@
receiver_maps, transitioned_maps, handlers, store_mode);
}
+
void PropertyICCompiler::CompileKeyedStorePolymorphicHandlers(
MapHandleList* receiver_maps, MapHandleList* transitioned_maps,
- List<Handle<Object>>* handlers, KeyedAccessStoreMode store_mode) {
+ CodeHandleList* handlers, KeyedAccessStoreMode store_mode) {
for (int i = 0; i < receiver_maps->length(); ++i) {
Handle<Map> receiver_map(receiver_maps->at(i));
- Handle<Object> handler;
+ Handle<Code> cached_stub;
Handle<Map> transitioned_map;
{
Map* tmap = receiver_map->FindElementsKindTransitionedMap(receiver_maps);
@@ -60,25 +61,21 @@
ElementsKind elements_kind = receiver_map->elements_kind();
TRACE_HANDLER_STATS(isolate(),
KeyedStoreIC_ElementsTransitionAndStoreStub);
- Handle<Code> stub =
+ cached_stub =
ElementsTransitionAndStoreStub(isolate(), elements_kind,
transitioned_map->elements_kind(),
- is_js_array, store_mode)
- .GetCode();
- Handle<Object> validity_cell =
- Map::GetOrCreatePrototypeChainValidityCell(receiver_map, isolate());
- handler = isolate()->factory()->NewTuple2(validity_cell, stub);
-
+ is_js_array, store_mode).GetCode();
} else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) {
// TODO(mvstanton): Consider embedding store_mode in the state of the slow
// keyed store ic for uniformity.
TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_SlowStub);
- handler = isolate()->builtins()->KeyedStoreIC_Slow();
+ cached_stub = isolate()->builtins()->KeyedStoreIC_Slow();
} else {
- handler = CompileKeyedStoreMonomorphicHandler(receiver_map, store_mode);
+ cached_stub =
+ CompileKeyedStoreMonomorphicHandler(receiver_map, store_mode);
}
- DCHECK(!handler.is_null());
- handlers->Add(handler);
+ DCHECK(!cached_stub.is_null());
+ handlers->Add(cached_stub);
transitioned_maps->Add(transitioned_map);
}
}
@@ -86,7 +83,8 @@
#define __ ACCESS_MASM(masm())
-Handle<Object> PropertyICCompiler::CompileKeyedStoreMonomorphicHandler(
+
+Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphicHandler(
Handle<Map> receiver_map, KeyedAccessStoreMode store_mode) {
ElementsKind elements_kind = receiver_map->elements_kind();
bool is_jsarray = receiver_map->instance_type() == JS_ARRAY_TYPE;
@@ -103,10 +101,7 @@
TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_StoreElementStub);
stub = StoreElementStub(isolate(), elements_kind, store_mode).GetCode();
}
- Handle<Object> validity_cell =
- Map::GetOrCreatePrototypeChainValidityCell(receiver_map, isolate());
- Handle<Tuple2> handler = isolate()->factory()->NewTuple2(validity_cell, stub);
- return handler;
+ return stub;
}
« no previous file with comments | « src/ic/ic-compiler.h ('k') | src/ic/ic-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698