OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 |
(...skipping 4994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5005 ToDoubleRegister(temp)); | 5005 ToDoubleRegister(temp)); |
5006 } else { | 5006 } else { |
5007 X87Register res = ToX87Register(output); | 5007 X87Register res = ToX87Register(output); |
5008 X87PrepareToWrite(res); | 5008 X87PrepareToWrite(res); |
5009 __ LoadUint32NoSSE2(ToRegister(input)); | 5009 __ LoadUint32NoSSE2(ToRegister(input)); |
5010 X87CommitWrite(res); | 5010 X87CommitWrite(res); |
5011 } | 5011 } |
5012 } | 5012 } |
5013 | 5013 |
5014 | 5014 |
| 5015 void LCodeGen::DoUint32ToSmi(LUint32ToSmi* instr) { |
| 5016 Register input = ToRegister(instr->value()); |
| 5017 if (!instr->hydrogen()->value()->HasRange() || |
| 5018 !instr->hydrogen()->value()->range()->IsInSmiRange()) { |
| 5019 __ test(input, Immediate(0xc0000000)); |
| 5020 DeoptimizeIf(not_zero, instr->environment()); |
| 5021 } |
| 5022 __ SmiTag(input); |
| 5023 } |
| 5024 |
| 5025 |
5015 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { | 5026 void LCodeGen::DoNumberTagI(LNumberTagI* instr) { |
5016 class DeferredNumberTagI V8_FINAL : public LDeferredCode { | 5027 class DeferredNumberTagI V8_FINAL : public LDeferredCode { |
5017 public: | 5028 public: |
5018 DeferredNumberTagI(LCodeGen* codegen, | 5029 DeferredNumberTagI(LCodeGen* codegen, |
5019 LNumberTagI* instr, | 5030 LNumberTagI* instr, |
5020 const X87Stack& x87_stack) | 5031 const X87Stack& x87_stack) |
5021 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5032 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5022 virtual void Generate() V8_OVERRIDE { | 5033 virtual void Generate() V8_OVERRIDE { |
5023 codegen()->DoDeferredNumberTagI(instr_, instr_->value(), SIGNED_INT32); | 5034 codegen()->DoDeferredNumberTagI(instr_, instr_->value(), SIGNED_INT32); |
5024 } | 5035 } |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6378 FixedArray::kHeaderSize - kPointerSize)); | 6389 FixedArray::kHeaderSize - kPointerSize)); |
6379 __ bind(&done); | 6390 __ bind(&done); |
6380 } | 6391 } |
6381 | 6392 |
6382 | 6393 |
6383 #undef __ | 6394 #undef __ |
6384 | 6395 |
6385 } } // namespace v8::internal | 6396 } } // namespace v8::internal |
6386 | 6397 |
6387 #endif // V8_TARGET_ARCH_IA32 | 6398 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |