Revision: 2705 Author: [email protected] Date: Tue Aug 18 02:47:45 2009 Log: Fix regression caused by the generation of a shift stub during snapshot creation in a better way.
Encode whether or not the stub should use sse3 instructions in the minor key of the stub. The stubs generated during snapshot creation will have sse3 disabled, but they will not be found when sse3 is enabled. Therefore they will only affect the code generated as part of the snapshot. Review URL: http://codereview.chromium.org/172086 http://code.google.com/p/v8/source/detail?r=2705 Modified: /branches/bleeding_edge/src/ia32/codegen-ia32.cc /branches/bleeding_edge/src/ia32/codegen-ia32.h /branches/bleeding_edge/src/v8natives.js /branches/bleeding_edge/src/x64/codegen-x64.cc /branches/bleeding_edge/src/x64/codegen-x64.h ======================================= --- /branches/bleeding_edge/src/ia32/codegen-ia32.cc Thu Aug 6 07:42:38 2009 +++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Tue Aug 18 02:47:45 2009 @@ -6752,11 +6752,10 @@ // Reserve space for converted numbers. __ sub(Operand(esp), Immediate(2 * kPointerSize)); - bool use_sse3 = CpuFeatures::IsSupported(CpuFeatures::SSE3); - if (use_sse3) { + if (use_sse3_) { // Truncate the operands to 32-bit integers and check for // exceptions in doing so. - CpuFeatures::Scope scope(CpuFeatures::SSE3); + CpuFeatures::Scope scope(CpuFeatures::SSE3); __ fisttp_s(Operand(esp, 0 * kPointerSize)); __ fisttp_s(Operand(esp, 1 * kPointerSize)); __ fnstsw_ax(); @@ -6841,7 +6840,7 @@ // the runtime system. __ bind(&operand_conversion_failure); __ add(Operand(esp), Immediate(2 * kPointerSize)); - if (use_sse3) { + if (use_sse3_) { // If we've used the SSE3 instructions for truncating the // floating point values to integers and it failed, we have a // pending #IA exception. Clear it. ======================================= --- /branches/bleeding_edge/src/ia32/codegen-ia32.h Fri Aug 14 04:05:42 2009 +++ /branches/bleeding_edge/src/ia32/codegen-ia32.h Tue Aug 18 02:47:45 2009 @@ -618,6 +618,7 @@ OverwriteMode mode, GenericBinaryFlags flags) : op_(op), mode_(mode), flags_(flags) { + use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); } @@ -627,6 +628,7 @@ Token::Value op_; OverwriteMode mode_; GenericBinaryFlags flags_; + bool use_sse3_; const char* GetName(); @@ -639,9 +641,10 @@ } #endif - // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. + // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. class ModeBits: public BitField<OverwriteMode, 0, 2> {}; - class OpBits: public BitField<Token::Value, 2, 13> {}; + class OpBits: public BitField<Token::Value, 2, 12> {}; + class SSE3Bits: public BitField<bool, 14, 1> {}; class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; Major MajorKey() { return GenericBinaryOp; } @@ -649,7 +652,8 @@ // Encode the parameters in a unique 16 bit value. return OpBits::encode(op_) | ModeBits::encode(mode_) - | FlagBits::encode(flags_); + | FlagBits::encode(flags_) + | SSE3Bits::encode(use_sse3_); } void Generate(MacroAssembler* masm); }; ======================================= --- /branches/bleeding_edge/src/v8natives.js Tue Aug 18 02:14:19 2009 +++ /branches/bleeding_edge/src/v8natives.js Tue Aug 18 02:47:45 2009 @@ -47,7 +47,7 @@ // Helper function used to install functions on objects. function InstallFunctions(object, attributes, functions) { if (functions.length >= 8) { - %OptimizeObjectForAddingMultipleProperties(object, functions.length / 2); + %OptimizeObjectForAddingMultipleProperties(object, functions.length >> 1); } for (var i = 0; i < functions.length; i += 2) { var key = functions[i]; ======================================= --- /branches/bleeding_edge/src/x64/codegen-x64.cc Mon Aug 17 02:07:40 2009 +++ /branches/bleeding_edge/src/x64/codegen-x64.cc Tue Aug 18 02:47:45 2009 @@ -7529,11 +7529,10 @@ // Reserve space for converted numbers. __ subq(rsp, Immediate(2 * kPointerSize)); - bool use_sse3 = CpuFeatures::IsSupported(CpuFeatures::SSE3); - if (use_sse3) { + if (use_sse3_) { // Truncate the operands to 32-bit integers and check for // exceptions in doing so. - CpuFeatures::Scope scope(CpuFeatures::SSE3); + CpuFeatures::Scope scope(CpuFeatures::SSE3); __ fisttp_s(Operand(rsp, 0 * kPointerSize)); __ fisttp_s(Operand(rsp, 1 * kPointerSize)); __ fnstsw_ax(); @@ -7618,7 +7617,7 @@ // the runtime system. __ bind(&operand_conversion_failure); __ addq(rsp, Immediate(2 * kPointerSize)); - if (use_sse3) { + if (use_sse3_) { // If we've used the SSE3 instructions for truncating the // floating point values to integers and it failed, we have a // pending #IA exception. Clear it. ======================================= --- /branches/bleeding_edge/src/x64/codegen-x64.h Fri Aug 14 04:35:10 2009 +++ /branches/bleeding_edge/src/x64/codegen-x64.h Tue Aug 18 02:47:45 2009 @@ -619,6 +619,7 @@ OverwriteMode mode, GenericBinaryFlags flags) : op_(op), mode_(mode), flags_(flags) { + use_sse3_ = CpuFeatures::IsSupported(CpuFeatures::SSE3); ASSERT(OpBits::is_valid(Token::NUM_TOKENS)); } @@ -628,6 +629,7 @@ Token::Value op_; OverwriteMode mode_; GenericBinaryFlags flags_; + bool use_sse3_; const char* GetName(); @@ -640,17 +642,19 @@ } #endif - // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. + // Minor key encoding in 16 bits FSOOOOOOOOOOOOMM. class ModeBits: public BitField<OverwriteMode, 0, 2> {}; - class OpBits: public BitField<Token::Value, 2, 13> {}; + class OpBits: public BitField<Token::Value, 2, 12> {}; + class SSE3Bits: public BitField<bool, 14, 1> {}; class FlagBits: public BitField<GenericBinaryFlags, 15, 1> {}; Major MajorKey() { return GenericBinaryOp; } int MinorKey() { // Encode the parameters in a unique 16 bit value. return OpBits::encode(op_) - | ModeBits::encode(mode_) - | FlagBits::encode(flags_); + | ModeBits::encode(mode_) + | FlagBits::encode(flags_) + | SSE3Bits::encode(use_sse3_); } void Generate(MacroAssembler* masm); }; --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
