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

Unified Diff: src/ic.cc

Issue 260083011: Return MaybeHandle from Object::ToSmi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/elements.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 7df25a0b104df009df77d13d913f4526403bf761..fc5b494e23d4e9805bd2fdc65aee3bc742770062 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1629,9 +1629,8 @@ bool IsOutOfBoundsAccess(Handle<JSObject> receiver,
KeyedAccessStoreMode KeyedStoreIC::GetStoreMode(Handle<JSObject> receiver,
Handle<Object> key,
Handle<Object> value) {
- Handle<Object> smi_key = Object::ToSmi(isolate(), key);
- ASSERT(!smi_key.is_null() && smi_key->IsSmi());
- int index = Handle<Smi>::cast(smi_key)->value();
+ Handle<Smi> smi_key = Object::ToSmi(isolate(), key).ToHandleChecked();
+ int index = smi_key->value();
bool oob_access = IsOutOfBoundsAccess(receiver, index);
// Don't consider this a growing store if the store would send the receiver to
// dictionary mode.
« no previous file with comments | « src/elements.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698