Commit 19c354b7 authored by dslomov@chromium.org's avatar dslomov@chromium.org

Support typed arrays in IsMoreGeneralElementsKindTransition.

R=verwaest@chromium.org
BUG=357054
LOG=Y

Review URL: https://codereview.chromium.org/220403004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20410 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 64901004
...@@ -172,8 +172,27 @@ ElementsKind GetNextMoreGeneralFastElementsKind(ElementsKind elements_kind, ...@@ -172,8 +172,27 @@ ElementsKind GetNextMoreGeneralFastElementsKind(ElementsKind elements_kind,
} }
static bool IsTypedArrayElementsKind(ElementsKind elements_kind) {
return IsFixedTypedArrayElementsKind(elements_kind) ||
IsExternalArrayElementsKind(elements_kind);
}
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
ElementsKind to_kind) { ElementsKind to_kind) {
if (IsTypedArrayElementsKind(from_kind) ||
IsTypedArrayElementsKind(to_kind)) {
switch (from_kind) {
#define FIXED_TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
case TYPE##_ELEMENTS: \
return to_kind == EXTERNAL_##TYPE##_ELEMENTS;
TYPED_ARRAYS(FIXED_TYPED_ARRAY_CASE);
#undef FIXED_TYPED_ARRAY_CASE
default:
return false;
}
}
switch (from_kind) { switch (from_kind) {
case FAST_SMI_ELEMENTS: case FAST_SMI_ELEMENTS:
return to_kind != FAST_SMI_ELEMENTS; return to_kind != FAST_SMI_ELEMENTS;
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[].__defineSetter__(0, function() { });
function f(a,i,v) { a[i] = v; }
a = [0,0,0];
f(a,0,5);
a = new Float32Array(5);
f(a,2,5.5);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment