Chromium Code Reviews| Index: src/ia32/code-stubs-ia32.cc |
| diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
| index da8e2ae4576796285ee2fcbd769beeb3a3f05e39..93bc77b41287882d7c1d09554a5c3c8bda34b7e7 100644 |
| --- a/src/ia32/code-stubs-ia32.cc |
| +++ b/src/ia32/code-stubs-ia32.cc |
| @@ -40,6 +40,25 @@ |
| namespace v8 { |
| namespace internal { |
| + |
| +CodeStubInterfaceDescriptor* |
| +KeyedLoadFastElementStub::GetInterfaceDescriptor(Isolate* isolate) { |
|
Jakob Kummerow
2012/11/28 16:28:22
nit: indentation please
danno
2012/11/30 16:23:24
Done.
|
| + static bool initialized = false; |
| + static CodeStubInterfaceDescriptor* result; |
|
Jakob Kummerow
2012/11/28 16:28:22
I'd suspect at least one of the common compilers t
danno
2012/11/30 16:23:24
Done.
|
| + if (!initialized) { |
| + Handle<Code> miss = isolate->builtins()->KeyedLoadIC_Miss(); |
| + static Register registers[] = { edx, ecx }; |
| + static CodeStubInterfaceDescriptor info = { |
| + 2, |
| + registers, |
| + miss |
| + }; |
| + result = &info; |
| + } |
| + return result; |
| +} |
| + |
| + |
| #define __ ACCESS_MASM(masm) |
| void ToNumberStub::Generate(MacroAssembler* masm) { |
| @@ -2426,6 +2445,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
| __ bind(&loaded); |
| } else { // UNTAGGED. |
| + CpuFeatures::Scope scope(SSE2); |
| if (CpuFeatures::IsSupported(SSE4_1)) { |
| CpuFeatures::Scope sse4_scope(SSE4_1); |
| __ pextrd(edx, xmm1, 0x1); // copy xmm1[63..32] to edx. |
| @@ -2498,6 +2518,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
| __ fstp(0); |
| __ ret(kPointerSize); |
| } else { // UNTAGGED. |
| + CpuFeatures::Scope scope(SSE2); |
| __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); |
| __ Ret(); |
| } |
| @@ -2510,6 +2531,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
| if (tagged) { |
| __ AllocateHeapNumber(eax, edi, no_reg, &runtime_call_clear_stack); |
| } else { // UNTAGGED. |
| + CpuFeatures::Scope scope(SSE2); |
| __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); |
| __ sub(esp, Immediate(kDoubleSize)); |
| __ movdbl(Operand(esp, 0), xmm1); |
| @@ -2524,6 +2546,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
| if (tagged) { |
| __ ret(kPointerSize); |
| } else { // UNTAGGED. |
| + CpuFeatures::Scope scope(SSE2); |
| __ movdbl(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); |
| __ Ret(); |
| @@ -2556,6 +2579,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
| ExternalReference(RuntimeFunction(), masm->isolate()); |
| __ TailCallExternalReference(runtime, 1, 1); |
| } else { // UNTAGGED. |
| + CpuFeatures::Scope scope(SSE2); |
| __ bind(&runtime_call_clear_stack); |
| __ bind(&runtime_call); |
| __ AllocateHeapNumber(eax, edi, no_reg, &skip_cache); |
| @@ -4808,10 +4832,12 @@ void CodeStub::GenerateStubsAheadOfTime() { |
| void CodeStub::GenerateFPStubs() { |
| - CEntryStub save_doubles(1, kSaveFPRegs); |
| - Handle<Code> code = save_doubles.GetCode(); |
| - code->set_is_pregenerated(true); |
| - code->GetIsolate()->set_fp_stubs_generated(true); |
| + if (CpuFeatures::IsSupported(SSE2)) { |
| + CEntryStub save_doubles(1, kSaveFPRegs); |
| + Handle<Code> code = save_doubles.GetCode(); |
| + code->set_is_pregenerated(true); |
| + code->GetIsolate()->set_fp_stubs_generated(true); |
| + } |
| } |