Commit 48f411a2 authored by danno@chromium.org's avatar danno@chromium.org

Change JSObject elements to be of type FixedArrayBase

R=kmillikin@chromium.org
BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7617010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8927 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 91553bba
......@@ -1343,14 +1343,14 @@ int HeapNumber::get_sign() {
ACCESSORS(JSObject, properties, FixedArray, kPropertiesOffset)
HeapObject* JSObject::elements() {
FixedArrayBase* JSObject::elements() {
Object* array = READ_FIELD(this, kElementsOffset);
ASSERT(array->HasValidElements());
return reinterpret_cast<HeapObject*>(array);
return static_cast<FixedArrayBase*>(array);
}
void JSObject::set_elements(HeapObject* value, WriteBarrierMode mode) {
void JSObject::set_elements(FixedArrayBase* value, WriteBarrierMode mode) {
ASSERT(map()->has_fast_elements() ==
(value->map() == GetHeap()->fixed_array_map() ||
value->map() == GetHeap()->fixed_cow_array_map()));
......
......@@ -8407,14 +8407,14 @@ MaybeObject* JSObject::SetDictionaryElement(uint32_t index,
return isolate->Throw(*error);
}
}
Object* new_dictionary;
FixedArrayBase* new_dictionary;
MaybeObject* maybe = dictionary->AtNumberPut(index, value);
if (!maybe->ToObject(&new_dictionary)) return maybe;
if (!maybe->To<FixedArrayBase>(&new_dictionary)) return maybe;
if (dictionary != NumberDictionary::cast(new_dictionary)) {
if (is_arguments) {
elements->set(1, new_dictionary);
} else {
set_elements(HeapObject::cast(new_dictionary));
set_elements(new_dictionary);
}
dictionary = NumberDictionary::cast(new_dictionary);
}
......
......@@ -635,10 +635,11 @@ enum CompareResult {
WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
class DictionaryElementsAccessor;
class ElementsAccessor;
class StringStream;
class FixedArrayBase;
class ObjectVisitor;
class DictionaryElementsAccessor;
class StringStream;
struct ValueInfo : public Malloced {
ValueInfo() : type(FIRST_TYPE), ptr(NULL), str(NULL), number(0) { }
......@@ -1493,7 +1494,7 @@ class JSObject: public JSReceiver {
// In the slow mode the elements is either a NumberDictionary, an
// ExternalArray, or a FixedArray parameter map for a (non-strict)
// arguments object.
DECL_ACCESSORS(elements, HeapObject)
DECL_ACCESSORS(elements, FixedArrayBase)
inline void initialize_elements();
MUST_USE_RESULT inline MaybeObject* ResetElements();
inline ElementsKind GetElementsKind();
......
......@@ -9680,7 +9680,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) {
ASSERT(args.length() == 2);
CONVERT_CHECKED(JSArray, from, args[0]);
CONVERT_CHECKED(JSArray, to, args[1]);
HeapObject* new_elements = from->elements();
FixedArrayBase* new_elements = from->elements();
MaybeObject* maybe_new_map;
if (new_elements->map() == isolate->heap()->fixed_array_map() ||
new_elements->map() == isolate->heap()->fixed_cow_array_map()) {
......
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