| 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 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 break; | 2142 break; |
| 2143 } | 2143 } |
| 2144 } | 2144 } |
| 2145 | 2145 |
| 2146 | 2146 |
| 2147 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { | 2147 void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
| 2148 ASSERT(ToRegister(instr->left()).is(r1)); | 2148 ASSERT(ToRegister(instr->left()).is(r1)); |
| 2149 ASSERT(ToRegister(instr->right()).is(r0)); | 2149 ASSERT(ToRegister(instr->right()).is(r0)); |
| 2150 ASSERT(ToRegister(instr->result()).is(r0)); | 2150 ASSERT(ToRegister(instr->result()).is(r0)); |
| 2151 | 2151 |
| 2152 BinaryOpStub stub(instr->op(), NO_OVERWRITE); | 2152 BinaryOpStub stub(instr->op()); |
| 2153 // Block literal pool emission to ensure nop indicating no inlined smi code | 2153 // Block literal pool emission to ensure nop indicating no inlined smi code |
| 2154 // is in the correct position. | 2154 // is in the correct position. |
| 2155 Assembler::BlockConstPoolScope block_const_pool(masm()); | 2155 Assembler::BlockConstPoolScope block_const_pool(masm()); |
| 2156 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 2156 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 2157 __ nop(); // Signals no inlined code. | 2157 __ nop(); // Signals no inlined code. |
| 2158 } | 2158 } |
| 2159 | 2159 |
| 2160 | 2160 |
| 2161 int LCodeGen::GetNextEmittedBlock() const { | 2161 int LCodeGen::GetNextEmittedBlock() const { |
| 2162 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { | 2162 for (int i = current_block_ + 1; i < graph()->blocks()->length(); ++i) { |
| (...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4980 private: | 4980 private: |
| 4981 LTaggedToI* instr_; | 4981 LTaggedToI* instr_; |
| 4982 }; | 4982 }; |
| 4983 | 4983 |
| 4984 LOperand* input = instr->value(); | 4984 LOperand* input = instr->value(); |
| 4985 ASSERT(input->IsRegister()); | 4985 ASSERT(input->IsRegister()); |
| 4986 ASSERT(input->Equals(instr->result())); | 4986 ASSERT(input->Equals(instr->result())); |
| 4987 | 4987 |
| 4988 Register input_reg = ToRegister(input); | 4988 Register input_reg = ToRegister(input); |
| 4989 | 4989 |
| 4990 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); | 4990 if (instr->hydrogen()->value()->representation().IsSmi()) { |
| 4991 __ SmiUntag(input_reg); |
| 4992 } else { |
| 4993 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
| 4991 | 4994 |
| 4992 // Optimistically untag the input. | 4995 // Optimistically untag the input. |
| 4993 // If the input is a HeapObject, SmiUntag will set the carry flag. | 4996 // If the input is a HeapObject, SmiUntag will set the carry flag. |
| 4994 __ SmiUntag(input_reg, SetCC); | 4997 __ SmiUntag(input_reg, SetCC); |
| 4995 // Branch to deferred code if the input was tagged. | 4998 // Branch to deferred code if the input was tagged. |
| 4996 // The deferred code will take care of restoring the tag. | 4999 // The deferred code will take care of restoring the tag. |
| 4997 __ b(cs, deferred->entry()); | 5000 __ b(cs, deferred->entry()); |
| 4998 __ bind(deferred->exit()); | 5001 __ bind(deferred->exit()); |
| 5002 } |
| 4999 } | 5003 } |
| 5000 | 5004 |
| 5001 | 5005 |
| 5002 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { | 5006 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
| 5003 LOperand* input = instr->value(); | 5007 LOperand* input = instr->value(); |
| 5004 ASSERT(input->IsRegister()); | 5008 ASSERT(input->IsRegister()); |
| 5005 LOperand* result = instr->result(); | 5009 LOperand* result = instr->result(); |
| 5006 ASSERT(result->IsDoubleRegister()); | 5010 ASSERT(result->IsDoubleRegister()); |
| 5007 | 5011 |
| 5008 Register input_reg = ToRegister(input); | 5012 Register input_reg = ToRegister(input); |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5777 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5781 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5778 __ ldr(result, FieldMemOperand(scratch, | 5782 __ ldr(result, FieldMemOperand(scratch, |
| 5779 FixedArray::kHeaderSize - kPointerSize)); | 5783 FixedArray::kHeaderSize - kPointerSize)); |
| 5780 __ bind(&done); | 5784 __ bind(&done); |
| 5781 } | 5785 } |
| 5782 | 5786 |
| 5783 | 5787 |
| 5784 #undef __ | 5788 #undef __ |
| 5785 | 5789 |
| 5786 } } // namespace v8::internal | 5790 } } // namespace v8::internal |
| OLD | NEW |