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

Unified Diff: src/ic.cc

Issue 279773002: Fix Array.prototype.push and Array.prototype.unshift for read-only length. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 6 years, 7 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
« src/builtins.cc ('K') | « src/hydrogen.cc ('k') | src/objects.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 3897f884500146c025e595c7451a46f262d8e7b9..ef786ff13483ba4eca6ae1380a3c82c5c79ad6b4 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1794,6 +1794,17 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
}
}
+ Handle<Object> result;
+
+ if (store_handle.is_null()) {
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate(),
+ result,
Michael Starzinger 2014/05/21 12:34:36 nit: We should be able to assign to store_handle h
ulan 2014/05/21 14:52:22 Done.
+ Runtime::SetObjectProperty(
+ isolate(), object, key, value, NONE, strict_mode()),
Michael Starzinger 2014/05/21 12:34:36 nit: Only one white-space in front of NONE here.
ulan 2014/05/21 14:52:22 Done.
+ Object);
+ }
+
if (!is_target_set()) {
if (*stub == *generic_stub()) {
TRACE_GENERIC_IC(isolate(), "KeyedStoreIC", "set generic");
@@ -1803,15 +1814,7 @@ MaybeHandle<Object> KeyedStoreIC::Store(Handle<Object> object,
TRACE_IC("StoreIC", key);
}
- if (!store_handle.is_null()) return store_handle;
- Handle<Object> result;
- ASSIGN_RETURN_ON_EXCEPTION(
- isolate(),
- result,
- Runtime::SetObjectProperty(
- isolate(), object, key, value, NONE, strict_mode()),
- Object);
- return result;
+ return store_handle.is_null() ? result : store_handle;
}
« src/builtins.cc ('K') | « src/hydrogen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698