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

Unified Diff: src/objects.cc

Issue 11801036: Test fix: missing check for JSArray. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ac2972f0a392fd75ab2baa978ecb982a6d3836f8..733a1f8208d63d8777fad4bcb4489e3f0e021f1a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9861,7 +9861,7 @@ MaybeObject* JSObject::SetFastElement(uint32_t index,
: FAST_DOUBLE_ELEMENTS;
MaybeObject* trans = PossiblyTransitionArrayBoilerplate(to_kind);
- if (trans != NULL && trans->IsFailure()) return trans;
+ if (trans->IsFailure()) return trans;
MaybeObject* maybe =
SetFastDoubleElementsCapacityAndLength(new_capacity, array_length);
@@ -10406,15 +10406,16 @@ Handle<Object> JSObject::TransitionElementsKind(Handle<JSObject> object,
MaybeObject* JSObject::PossiblyTransitionArrayBoilerplate(
ElementsKind to_kind) {
- ASSERT(IsJSArray());
MaybeObject* ret = NULL;
- AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(this);
- if (info != NULL) {
- JSObject* payload = JSObject::cast(info->payload());
- if (payload->GetElementsKind() != to_kind) {
- if (IsMoreGeneralElementsKindTransition(payload->GetElementsKind(),
- to_kind)) {
- ret = payload->TransitionElementsKind(to_kind);
+ if (IsJSArray()) {
+ AllocationSiteInfo* info = AllocationSiteInfo::FindForJSObject(this);
+ if (info != NULL) {
+ JSObject* payload = JSObject::cast(info->payload());
+ if (payload->GetElementsKind() != to_kind) {
+ if (IsMoreGeneralElementsKindTransition(payload->GetElementsKind(),
+ to_kind)) {
+ ret = payload->TransitionElementsKind(to_kind);
+ }
}
}
}
@@ -10433,7 +10434,7 @@ MaybeObject* JSObject::TransitionElementsKind(ElementsKind to_kind) {
if (from_kind == to_kind) return this;
MaybeObject* trans = PossiblyTransitionArrayBoilerplate(to_kind);
- if (trans != NULL && trans->IsFailure()) return trans;
+ if (trans->IsFailure()) return trans;
Isolate* isolate = GetIsolate();
if (elements() == isolate->heap()->empty_fixed_array() ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698