Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 7683) |
+++ src/objects-inl.h (working copy) |
@@ -406,6 +406,13 @@ |
} |
+bool Object::IsExternalDoubleArray() { |
+ return Object::IsHeapObject() && |
+ HeapObject::cast(this)->map()->instance_type() == |
+ EXTERNAL_DOUBLE_ARRAY_TYPE; |
+} |
+ |
+ |
bool MaybeObject::IsFailure() { |
return HAS_FAILURE_TAG(this); |
} |
@@ -1901,6 +1908,7 @@ |
CAST_ACCESSOR(ExternalIntArray) |
CAST_ACCESSOR(ExternalUnsignedIntArray) |
CAST_ACCESSOR(ExternalFloatArray) |
+CAST_ACCESSOR(ExternalDoubleArray) |
CAST_ACCESSOR(ExternalPixelArray) |
CAST_ACCESSOR(Struct) |
@@ -2315,6 +2323,20 @@ |
} |
+double ExternalDoubleArray::get(int index) { |
+ ASSERT((index >= 0) && (index < this->length())); |
+ double* ptr = static_cast<double*>(external_pointer()); |
+ return ptr[index]; |
+} |
+ |
+ |
+void ExternalDoubleArray::set(int index, double value) { |
+ ASSERT((index >= 0) && (index < this->length())); |
+ double* ptr = static_cast<double*>(external_pointer()); |
+ ptr[index] = value; |
+} |
+ |
+ |
int Map::visitor_id() { |
return READ_BYTE_FIELD(this, kVisitorIdOffset); |
} |
@@ -2515,6 +2537,12 @@ |
} |
+FixedArray* Map::unchecked_prototype_transitions() { |
+ return reinterpret_cast<FixedArray*>( |
+ READ_FIELD(this, kPrototypeTransitionsOffset)); |
+} |
+ |
+ |
Code::Flags Code::flags() { |
return static_cast<Flags>(READ_INT_FIELD(this, kFlagsOffset)); |
} |
@@ -2923,6 +2951,7 @@ |
ACCESSORS(Map, instance_descriptors, DescriptorArray, |
kInstanceDescriptorsOffset) |
ACCESSORS(Map, code_cache, Object, kCodeCacheOffset) |
+ACCESSORS(Map, prototype_transitions, FixedArray, kPrototypeTransitionsOffset) |
ACCESSORS(Map, constructor, Object, kConstructorOffset) |
ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
@@ -3638,14 +3667,18 @@ |
return EXTERNAL_INT_ELEMENTS; |
case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
return EXTERNAL_UNSIGNED_INT_ELEMENTS; |
+ case EXTERNAL_FLOAT_ARRAY_TYPE: |
+ return EXTERNAL_FLOAT_ELEMENTS; |
+ case EXTERNAL_DOUBLE_ARRAY_TYPE: |
+ return EXTERNAL_DOUBLE_ELEMENTS; |
case EXTERNAL_PIXEL_ARRAY_TYPE: |
return EXTERNAL_PIXEL_ELEMENTS; |
default: |
break; |
} |
} |
- ASSERT(array->map()->instance_type() == EXTERNAL_FLOAT_ARRAY_TYPE); |
- return EXTERNAL_FLOAT_ELEMENTS; |
+ UNREACHABLE(); |
+ return DICTIONARY_ELEMENTS; |
} |
@@ -3686,6 +3719,8 @@ |
EXTERNAL_UNSIGNED_INT_ARRAY_TYPE) |
EXTERNAL_ELEMENTS_CHECK(Float, |
EXTERNAL_FLOAT_ARRAY_TYPE) |
+EXTERNAL_ELEMENTS_CHECK(Double, |
+ EXTERNAL_DOUBLE_ARRAY_TYPE) |
EXTERNAL_ELEMENTS_CHECK(Pixel, EXTERNAL_PIXEL_ARRAY_TYPE) |