X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fv8%2Fsrc%2Fobjects.cc;h=889a6f2f2ba07c4bfe1e1d2a4dec46c86b2d8e4a;hb=4e9e197c26c34b7055b2c5de6d4a770d317b468c;hp=b668916a57732d859fbb2e6f821319d6ed188520;hpb=8895f14fc7ca51078edffcf3660d2e91d53ca992;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/v8/src/objects.cc b/src/v8/src/objects.cc index b668916..889a6f2 100644 --- a/src/v8/src/objects.cc +++ b/src/v8/src/objects.cc @@ -1558,6 +1558,21 @@ void HeapObject::HeapObjectShortPrint(OStream& os) { // NOLINT os << '>'; break; } + case FLOAT32x4_TYPE: + os << "Float32x4Print(os); + os << '>'; + break; + case FLOAT64x2_TYPE: + os << "Float64x2Print(os); + os << '>'; + break; + case INT32x4_TYPE: + os << "Int32x4Print(os); + os << '>'; + break; case JS_PROXY_TYPE: os << ""; break; @@ -1656,6 +1671,9 @@ void HeapObject::IterateBody(InstanceType type, int object_size, case JS_GLOBAL_OBJECT_TYPE: case JS_BUILTINS_OBJECT_TYPE: case JS_MESSAGE_OBJECT_TYPE: + case FLOAT32x4_TYPE: + case FLOAT64x2_TYPE: + case INT32x4_TYPE: JSObject::BodyDescriptor::IterateBody(this, object_size, v); break; case JS_FUNCTION_TYPE: @@ -1737,6 +1755,45 @@ void HeapNumber::HeapNumberPrint(OStream& os) { // NOLINT } +void Float32x4::Float32x4Print(OStream& os) { + // The Windows version of vsnprintf can allocate when printing a %g string + // into a buffer that may not be big enough. We don't want random memory + // allocation when producing post-crash stack traces, so we print into a + // buffer that is plenty big enough for any floating point number, then + // print that using vsnprintf (which may truncate but never allocate if + // there is no more space in the buffer). + EmbeddedVector buffer; + SNPrintF(buffer, "%.16g %.16g %.16g %.16g", x(), y(), z(), w()); + os << buffer.start(); +} + + +void Int32x4::Int32x4Print(OStream& os) { + // The Windows version of vsnprintf can allocate when printing a %g string + // into a buffer that may not be big enough. We don't want random memory + // allocation when producing post-crash stack traces, so we print into a + // buffer that is plenty big enough for any floating point number, then + // print that using vsnprintf (which may truncate but never allocate if + // there is no more space in the buffer). + EmbeddedVector buffer; + SNPrintF(buffer, "%u %u %u %u", x(), y(), z(), w()); + os << buffer.start(); +} + + +void Float64x2::Float64x2Print(OStream& os) { + // The Windows version of vsnprintf can allocate when printing a %g string + // into a buffer that may not be big enough. We don't want random memory + // allocation when producing post-crash stack traces, so we print into a + // buffer that is plenty big enough for any floating point number, then + // print that using vsnprintf (which may truncate but never allocate if + // there is no more space in the buffer). + EmbeddedVector buffer; + SNPrintF(buffer, "%.16g %.16g", x(), y()); + os << buffer.start(); +} + + String* JSReceiver::class_name() { if (IsJSFunction() || IsJSFunctionProxy()) { return GetHeap()->function_class_string(); @@ -1982,6 +2039,9 @@ const char* Representation::Mnemonic() const { case kTagged: return "t"; case kSmi: return "s"; case kDouble: return "d"; + case kFloat32x4: return "float32x4"; + case kFloat64x2: return "float64x2"; + case kInt32x4: return "int32x44"; case kInteger32: return "i"; case kHeapObject: return "h"; case kExternal: return "x"; @@ -11270,6 +11330,27 @@ void DeoptimizationInputData::DeoptimizationInputDataPrint( break; } + case Translation::FLOAT32x4_REGISTER: { + int reg_code = iterator.Next(); + os << "{input=" << SIMD128Register::AllocationIndexToString(reg_code) + << "}"; + break; + } + + case Translation::FLOAT64x2_REGISTER: { + int reg_code = iterator.Next(); + os << "{input=" << SIMD128Register::AllocationIndexToString(reg_code) + << "}"; + break; + } + + case Translation::INT32x4_REGISTER: { + int reg_code = iterator.Next(); + os << "{input=" << SIMD128Register::AllocationIndexToString(reg_code) + << "}"; + break; + } + case Translation::STACK_SLOT: { int input_slot_index = iterator.Next(); os << "{input=" << input_slot_index << "}"; @@ -11294,6 +11375,24 @@ void DeoptimizationInputData::DeoptimizationInputDataPrint( break; } + case Translation::FLOAT32x4_STACK_SLOT: { + int input_slot_index = iterator.Next(); + os << "{input=" << input_slot_index << "}"; + break; + } + + case Translation::FLOAT64x2_STACK_SLOT: { + int input_slot_index = iterator.Next(); + os << "{input=" << input_slot_index << "}"; + break; + } + + case Translation::INT32x4_STACK_SLOT: { + int input_slot_index = iterator.Next(); + os << "{input=" << input_slot_index << "}"; + break; + } + case Translation::LITERAL: { unsigned literal_index = iterator.Next(); os << "{literal_id=" << literal_index << "}"; @@ -12826,7 +12925,8 @@ MaybeHandle JSObject::SetElement(Handle object, if (object->HasExternalArrayElements() || object->HasFixedTypedArrayElements()) { - if (!value->IsNumber() && !value->IsUndefined()) { + if (!value->IsNumber() && !value->IsFloat32x4() && !value->IsFloat64x2() && + !value->IsInt32x4() && !value->IsUndefined()) { ASSIGN_RETURN_ON_EXCEPTION( isolate, value, Execution::ToNumber(isolate, value), Object); @@ -15111,6 +15211,71 @@ Handle ExternalFloat64Array::SetValue( } +Handle ExternalFloat32x4Array::SetValue( + Handle array, + uint32_t index, + Handle value) { + float32x4_value_t cast_value; + cast_value.storage[0] = static_cast(base::OS::nan_value()); + cast_value.storage[1] = static_cast(base::OS::nan_value()); + cast_value.storage[2] = static_cast(base::OS::nan_value()); + cast_value.storage[3] = static_cast(base::OS::nan_value()); + if (index < static_cast(array->length())) { + if (value->IsFloat32x4()) { + cast_value = Handle::cast(value)->get(); + } else { + // Clamp undefined to NaN (default). All other types have been + // converted to a number type further up in the call chain. + DCHECK(value->IsUndefined()); + } + array->set(index, cast_value); + } + return array->GetIsolate()->factory()->NewFloat32x4(cast_value); +} + + +Handle ExternalInt32x4Array::SetValue( + Handle array, uint32_t index, Handle value) { + int32x4_value_t cast_value; + cast_value.storage[0] = 0; + cast_value.storage[1] = 0; + cast_value.storage[2] = 0; + cast_value.storage[3] = 0; + if (index < static_cast(array->length())) { + if (value->IsInt32x4()) { + cast_value = Handle::cast(value)->get(); + } else { + // Clamp undefined to zero (default). All other types have been + // converted to a number type further up in the call chain. + DCHECK(value->IsUndefined()); + } + array->set(index, cast_value); + } + return array->GetIsolate()->factory()->NewInt32x4(cast_value); +} + + +Handle ExternalFloat64x2Array::SetValue( + Handle array, + uint32_t index, + Handle value) { + float64x2_value_t cast_value; + cast_value.storage[0] = base::OS::nan_value(); + cast_value.storage[1] = base::OS::nan_value(); + if (index < static_cast(array->length())) { + if (value->IsFloat64x2()) { + cast_value = Handle::cast(value)->get(); + } else { + // Clamp undefined to NaN (default). All other types have been + // converted to a number type further up in the call chain. + DCHECK(value->IsUndefined()); + } + array->set(index, cast_value); + } + return array->GetIsolate()->factory()->NewFloat64x2(cast_value); +} + + PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { DCHECK(!HasFastProperties()); Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry());