| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5051 | 5051 |
| 5052 // smi | 5052 // smi |
| 5053 __ bind(&is_smi); | 5053 __ bind(&is_smi); |
| 5054 __ SmiToInteger32(input_reg, input_reg); | 5054 __ SmiToInteger32(input_reg, input_reg); |
| 5055 __ ClampUint8(input_reg); | 5055 __ ClampUint8(input_reg); |
| 5056 | 5056 |
| 5057 __ bind(&done); | 5057 __ bind(&done); |
| 5058 } | 5058 } |
| 5059 | 5059 |
| 5060 | 5060 |
| 5061 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { | |
| 5062 XMMRegister value_reg = ToDoubleRegister(instr->value()); | |
| 5063 Register result_reg = ToRegister(instr->result()); | |
| 5064 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | |
| 5065 __ movq(result_reg, value_reg); | |
| 5066 __ shr(result_reg, Immediate(32)); | |
| 5067 } else { | |
| 5068 __ movd(result_reg, value_reg); | |
| 5069 } | |
| 5070 } | |
| 5071 | |
| 5072 | |
| 5073 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | |
| 5074 Register hi_reg = ToRegister(instr->hi()); | |
| 5075 Register lo_reg = ToRegister(instr->lo()); | |
| 5076 XMMRegister result_reg = ToDoubleRegister(instr->result()); | |
| 5077 XMMRegister xmm_scratch = double_scratch0(); | |
| 5078 __ movd(result_reg, hi_reg); | |
| 5079 __ psllq(result_reg, 32); | |
| 5080 __ movd(xmm_scratch, lo_reg); | |
| 5081 __ orps(result_reg, xmm_scratch); | |
| 5082 } | |
| 5083 | |
| 5084 | |
| 5085 void LCodeGen::DoAllocate(LAllocate* instr) { | 5061 void LCodeGen::DoAllocate(LAllocate* instr) { |
| 5086 class DeferredAllocate V8_FINAL : public LDeferredCode { | 5062 class DeferredAllocate V8_FINAL : public LDeferredCode { |
| 5087 public: | 5063 public: |
| 5088 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5064 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
| 5089 : LDeferredCode(codegen), instr_(instr) { } | 5065 : LDeferredCode(codegen), instr_(instr) { } |
| 5090 virtual void Generate() V8_OVERRIDE { | 5066 virtual void Generate() V8_OVERRIDE { |
| 5091 codegen()->DoDeferredAllocate(instr_); | 5067 codegen()->DoDeferredAllocate(instr_); |
| 5092 } | 5068 } |
| 5093 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5069 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } |
| 5094 private: | 5070 private: |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5611 FixedArray::kHeaderSize - kPointerSize)); | 5587 FixedArray::kHeaderSize - kPointerSize)); |
| 5612 __ bind(&done); | 5588 __ bind(&done); |
| 5613 } | 5589 } |
| 5614 | 5590 |
| 5615 | 5591 |
| 5616 #undef __ | 5592 #undef __ |
| 5617 | 5593 |
| 5618 } } // namespace v8::internal | 5594 } } // namespace v8::internal |
| 5619 | 5595 |
| 5620 #endif // V8_TARGET_ARCH_X64 | 5596 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |