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

Unified Diff: src/ic/ic.cc

Issue 965723002: Ensure we can reliably check the cell for validity of global property (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | 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 fad3adb5591208eb2d0e8473431d50e1d0643293..8625542c3ca7be0e62468c2a9c73d217c8fdf3a6 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -1243,8 +1243,7 @@ Handle<Code> LoadIC::CompileHandler(LookupIterator* lookup,
NamedLoadHandlerCompiler compiler(isolate(), map, holder,
cache_holder);
Handle<PropertyCell> cell = lookup->GetPropertyCell();
- Handle<Code> code = compiler.CompileLoadGlobal(
- cell, lookup->name(), lookup->IsConfigurable());
+ Handle<Code> code = compiler.CompileLoadGlobal(cell, lookup->name());
// TODO(verwaest): Move caching of these NORMAL stubs outside as well.
CacheHolderFlag flag;
Handle<Map> stub_holder_map =
@@ -1667,13 +1666,15 @@ void StoreIC::UpdateCaches(LookupIterator* lookup, Handle<Object> value,
}
-static Handle<Code> PropertyCellStoreHandler(
- Isolate* isolate, Handle<JSObject> receiver, Handle<GlobalObject> holder,
- Handle<Name> name, Handle<PropertyCell> cell, Handle<Object> value) {
+static Handle<Code> PropertyCellStoreHandler(Isolate* isolate,
+ Handle<JSObject> receiver,
+ Handle<Name> name,
+ Handle<PropertyCell> cell,
+ Handle<Object> value) {
auto union_type = PropertyCell::UpdatedType(cell, value);
StoreGlobalStub stub(isolate, union_type->IsConstant(),
receiver->IsJSGlobalProxy());
- auto code = stub.GetCodeCopyFromTemplate(holder, cell);
+ auto code = stub.GetCodeCopyFromTemplate(cell);
// TODO(verwaest): Move caching of these NORMAL stubs outside as well.
HeapObject::UpdateMapCodeCache(receiver, name, code);
return code;
@@ -1695,9 +1696,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
auto store_target = lookup->GetStoreTarget();
if (store_target->IsGlobalObject()) {
auto cell = lookup->GetTransitionPropertyCell();
- return PropertyCellStoreHandler(
- isolate(), store_target, Handle<GlobalObject>::cast(store_target),
- lookup->name(), cell, value);
+ return PropertyCellStoreHandler(isolate(), receiver, lookup->name(),
+ cell, value);
}
Handle<Map> transition = lookup->transition_map();
// Currently not handled by CompileStoreTransition.
@@ -1768,9 +1768,8 @@ Handle<Code> StoreIC::CompileHandler(LookupIterator* lookup,
DCHECK(holder.is_identical_to(receiver) ||
receiver->map()->prototype() == *holder);
auto cell = lookup->GetPropertyCell();
- return PropertyCellStoreHandler(isolate(), receiver,
- Handle<GlobalObject>::cast(holder),
- lookup->name(), cell, value);
+ return PropertyCellStoreHandler(isolate(), receiver, lookup->name(),
+ cell, value);
}
DCHECK(holder.is_identical_to(receiver));
return isolate()->builtins()->StoreIC_Normal();
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips/handler-compiler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698