Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index 27d28868f393eeb4878750b349d8c7d9941b592b..c6251157f28c373895feecbaba9e609023203ef9 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -3397,6 +3397,9 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub( |
case kExternalFloatArray: |
__ fld_s(Operand(ebx, ecx, times_4, 0)); |
break; |
+ case kExternalDoubleArray: |
+ __ fld_d(Operand(ebx, ecx, times_8, 0)); |
+ break; |
default: |
UNREACHABLE(); |
break; |
@@ -3454,7 +3457,8 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub( |
__ mov(eax, ecx); |
__ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
__ ret(0); |
- } else if (array_type == kExternalFloatArray) { |
+ } else if (array_type == kExternalFloatArray || |
+ array_type == kExternalDoubleArray) { |
// For the floating-point array type, we need to always allocate a |
// HeapNumber. |
__ AllocateHeapNumber(ecx, ebx, edi, &failed_allocation); |
@@ -3569,11 +3573,16 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
__ mov(Operand(edi, ebx, times_4, 0), ecx); |
break; |
case kExternalFloatArray: |
+ case kExternalDoubleArray: |
// Need to perform int-to-float conversion. |
__ push(ecx); |
__ fild_s(Operand(esp, 0)); |
__ pop(ecx); |
- __ fstp_s(Operand(edi, ebx, times_4, 0)); |
+ if (array_type == kExternalFloatArray) { |
+ __ fstp_s(Operand(edi, ebx, times_4, 0)); |
+ } else { // array_type == kExternalDoubleArray. |
+ __ fstp_d(Operand(edi, ebx, times_8, 0)); |
+ } |
break; |
default: |
UNREACHABLE(); |
@@ -3603,6 +3612,10 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
__ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
__ fstp_s(Operand(edi, ebx, times_4, 0)); |
__ ret(0); |
+ } else if (array_type == kExternalDoubleArray) { |
+ __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
+ __ fstp_d(Operand(edi, ebx, times_8, 0)); |
+ __ ret(0); |
} else { |
// Perform float-to-int conversion with truncation (round-to-zero) |
// behavior. |