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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 6794050: Revert "[Arguments] Merge (7442,7496] from bleeding_edge." (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/ia32/virtual-frame-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution. 11 // with the distribution.
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 JSFunction* function, 1914 JSFunction* function,
1915 String* name) { 1915 String* name) {
1916 // ----------- S t a t e ------------- 1916 // ----------- S t a t e -------------
1917 // -- ecx : name 1917 // -- ecx : name
1918 // -- esp[0] : return address 1918 // -- esp[0] : return address
1919 // -- esp[(argc - n) * 4] : arg[n] (zero-based) 1919 // -- esp[(argc - n) * 4] : arg[n] (zero-based)
1920 // -- ... 1920 // -- ...
1921 // -- esp[(argc + 1) * 4] : receiver 1921 // -- esp[(argc + 1) * 4] : receiver
1922 // ----------------------------------- 1922 // -----------------------------------
1923 1923
1924 if (!CpuFeatures::IsSupported(SSE2)) { 1924 if (!isolate()->cpu_features()->IsSupported(SSE2)) {
1925 return isolate()->heap()->undefined_value(); 1925 return isolate()->heap()->undefined_value();
1926 } 1926 }
1927 1927
1928 CpuFeatures::Scope use_sse2(SSE2); 1928 CpuFeatures::Scope use_sse2(SSE2);
1929 1929
1930 const int argc = arguments().immediate(); 1930 const int argc = arguments().immediate();
1931 1931
1932 // If the object is not a JSObject or we got an unexpected number of 1932 // If the object is not a JSObject or we got an unexpected number of
1933 // arguments, bail out to the regular call. 1933 // arguments, bail out to the regular call.
1934 if (!object->IsJSObject() || argc != 1) { 1934 if (!object->IsJSObject() || argc != 1) {
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
3285 // depending on the this.x = ...; assignment in the function. 3285 // depending on the this.x = ...; assignment in the function.
3286 SharedFunctionInfo* shared = function->shared(); 3286 SharedFunctionInfo* shared = function->shared();
3287 for (int i = 0; i < shared->this_property_assignments_count(); i++) { 3287 for (int i = 0; i < shared->this_property_assignments_count(); i++) {
3288 if (shared->IsThisPropertyAssignmentArgument(i)) { 3288 if (shared->IsThisPropertyAssignmentArgument(i)) {
3289 // Check if the argument assigned to the property is actually passed. 3289 // Check if the argument assigned to the property is actually passed.
3290 // If argument is not passed the property is set to undefined, 3290 // If argument is not passed the property is set to undefined,
3291 // otherwise find it on the stack. 3291 // otherwise find it on the stack.
3292 int arg_number = shared->GetThisPropertyAssignmentArgument(i); 3292 int arg_number = shared->GetThisPropertyAssignmentArgument(i);
3293 __ mov(ebx, edi); 3293 __ mov(ebx, edi);
3294 __ cmp(eax, arg_number); 3294 __ cmp(eax, arg_number);
3295 if (CpuFeatures::IsSupported(CMOV)) { 3295 if (isolate()->cpu_features()->IsSupported(CMOV)) {
3296 CpuFeatures::Scope use_cmov(CMOV); 3296 CpuFeatures::Scope use_cmov(CMOV);
3297 __ cmov(above, ebx, Operand(ecx, arg_number * -kPointerSize)); 3297 __ cmov(above, ebx, Operand(ecx, arg_number * -kPointerSize));
3298 } else { 3298 } else {
3299 Label not_passed; 3299 Label not_passed;
3300 __ j(below_equal, &not_passed); 3300 __ j(below_equal, &not_passed);
3301 __ mov(ebx, Operand(ecx, arg_number * -kPointerSize)); 3301 __ mov(ebx, Operand(ecx, arg_number * -kPointerSize));
3302 __ bind(&not_passed); 3302 __ bind(&not_passed);
3303 } 3303 }
3304 // Store value in the property. 3304 // Store value in the property.
3305 __ mov(Operand(edx, i * kPointerSize), ebx); 3305 __ mov(Operand(edx, i * kPointerSize), ebx);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3604 __ fstp_s(Operand(edi, ebx, times_4, 0)); 3604 __ fstp_s(Operand(edi, ebx, times_4, 0));
3605 __ ret(0); 3605 __ ret(0);
3606 } else { 3606 } else {
3607 // Perform float-to-int conversion with truncation (round-to-zero) 3607 // Perform float-to-int conversion with truncation (round-to-zero)
3608 // behavior. 3608 // behavior.
3609 3609
3610 // For the moment we make the slow call to the runtime on 3610 // For the moment we make the slow call to the runtime on
3611 // processors that don't support SSE2. The code in IntegerConvert 3611 // processors that don't support SSE2. The code in IntegerConvert
3612 // (code-stubs-ia32.cc) is roughly what is needed here though the 3612 // (code-stubs-ia32.cc) is roughly what is needed here though the
3613 // conversion failure case does not need to be handled. 3613 // conversion failure case does not need to be handled.
3614 if (CpuFeatures::IsSupported(SSE2)) { 3614 if (isolate()->cpu_features()->IsSupported(SSE2)) {
3615 if (array_type != kExternalIntArray && 3615 if (array_type != kExternalIntArray &&
3616 array_type != kExternalUnsignedIntArray) { 3616 array_type != kExternalUnsignedIntArray) {
3617 ASSERT(CpuFeatures::IsSupported(SSE2)); 3617 ASSERT(isolate()->cpu_features()->IsSupported(SSE2));
3618 CpuFeatures::Scope scope(SSE2); 3618 CpuFeatures::Scope scope(SSE2);
3619 __ cvttsd2si(ecx, FieldOperand(eax, HeapNumber::kValueOffset)); 3619 __ cvttsd2si(ecx, FieldOperand(eax, HeapNumber::kValueOffset));
3620 // ecx: untagged integer value 3620 // ecx: untagged integer value
3621 switch (array_type) { 3621 switch (array_type) {
3622 case kExternalPixelArray: 3622 case kExternalPixelArray:
3623 { // Clamp the value to [0..255]. 3623 { // Clamp the value to [0..255].
3624 NearLabel done; 3624 NearLabel done;
3625 __ test(ecx, Immediate(0xFFFFFF00)); 3625 __ test(ecx, Immediate(0xFFFFFF00));
3626 __ j(zero, &done); 3626 __ j(zero, &done);
3627 __ setcc(negative, ecx); // 1 if negative, 0 if positive. 3627 __ setcc(negative, ecx); // 1 if negative, 0 if positive.
3628 __ dec_b(ecx); // 0 if negative, 255 if positive. 3628 __ dec_b(ecx); // 0 if negative, 255 if positive.
3629 __ bind(&done); 3629 __ bind(&done);
3630 } 3630 }
3631 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); 3631 __ mov_b(Operand(edi, ebx, times_1, 0), ecx);
3632 break;
3633 case kExternalByteArray: 3632 case kExternalByteArray:
3634 case kExternalUnsignedByteArray: 3633 case kExternalUnsignedByteArray:
3635 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); 3634 __ mov_b(Operand(edi, ebx, times_1, 0), ecx);
3636 break; 3635 break;
3637 case kExternalShortArray: 3636 case kExternalShortArray:
3638 case kExternalUnsignedShortArray: 3637 case kExternalUnsignedShortArray:
3639 __ mov_w(Operand(edi, ebx, times_2, 0), ecx); 3638 __ mov_w(Operand(edi, ebx, times_2, 0), ecx);
3640 break; 3639 break;
3641 default: 3640 default:
3642 UNREACHABLE(); 3641 UNREACHABLE();
3643 break; 3642 break;
3644 } 3643 }
3645 } else { 3644 } else {
3646 if (CpuFeatures::IsSupported(SSE3)) { 3645 if (isolate()->cpu_features()->IsSupported(SSE3)) {
3647 CpuFeatures::Scope scope(SSE3); 3646 CpuFeatures::Scope scope(SSE3);
3648 // fisttp stores values as signed integers. To represent the 3647 // fisttp stores values as signed integers. To represent the
3649 // entire range of int and unsigned int arrays, store as a 3648 // entire range of int and unsigned int arrays, store as a
3650 // 64-bit int and discard the high 32 bits. 3649 // 64-bit int and discard the high 32 bits.
3651 // If the value is NaN or +/-infinity, the result is 0x80000000, 3650 // If the value is NaN or +/-infinity, the result is 0x80000000,
3652 // which is automatically zero when taken mod 2^n, n < 32. 3651 // which is automatically zero when taken mod 2^n, n < 32.
3653 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); 3652 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset));
3654 __ sub(Operand(esp), Immediate(2 * kPointerSize)); 3653 __ sub(Operand(esp), Immediate(2 * kPointerSize));
3655 __ fisttp_d(Operand(esp, 0)); 3654 __ fisttp_d(Operand(esp, 0));
3656 __ pop(ecx); 3655 __ pop(ecx);
3657 __ add(Operand(esp), Immediate(kPointerSize)); 3656 __ add(Operand(esp), Immediate(kPointerSize));
3658 } else { 3657 } else {
3659 ASSERT(CpuFeatures::IsSupported(SSE2)); 3658 ASSERT(isolate()->cpu_features()->IsSupported(SSE2));
3660 CpuFeatures::Scope scope(SSE2); 3659 CpuFeatures::Scope scope(SSE2);
3661 // We can easily implement the correct rounding behavior for the 3660 // We can easily implement the correct rounding behavior for the
3662 // range [0, 2^31-1]. For the time being, to keep this code simple, 3661 // range [0, 2^31-1]. For the time being, to keep this code simple,
3663 // make the slow runtime call for values outside this range. 3662 // make the slow runtime call for values outside this range.
3664 // Note: we could do better for signed int arrays. 3663 // Note: we could do better for signed int arrays.
3665 __ movd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset)); 3664 __ movd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset));
3666 // We will need the key if we have to make the slow runtime call. 3665 // We will need the key if we have to make the slow runtime call.
3667 __ push(ecx); 3666 __ push(ecx);
3668 __ LoadPowerOf2(xmm1, ecx, 31); 3667 __ LoadPowerOf2(xmm1, ecx, 31);
3669 __ pop(ecx); 3668 __ pop(ecx);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3702 3701
3703 return GetCode(flags); 3702 return GetCode(flags);
3704 } 3703 }
3705 3704
3706 3705
3707 #undef __ 3706 #undef __
3708 3707
3709 } } // namespace v8::internal 3708 } } // namespace v8::internal
3710 3709
3711 #endif // V8_TARGET_ARCH_IA32 3710 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/ia32/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698