Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: src/ia32/stub-cache-ia32.cc

Issue 6879009: Support Float64Arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698