| 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 4989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5000 private: | 5000 private: |
| 5001 LTaggedToI* instr_; | 5001 LTaggedToI* instr_; |
| 5002 }; | 5002 }; |
| 5003 | 5003 |
| 5004 LOperand* input = instr->value(); | 5004 LOperand* input = instr->value(); |
| 5005 ASSERT(input->IsRegister()); | 5005 ASSERT(input->IsRegister()); |
| 5006 ASSERT(input->Equals(instr->result())); | 5006 ASSERT(input->Equals(instr->result())); |
| 5007 | 5007 |
| 5008 Register input_reg = ToRegister(input); | 5008 Register input_reg = ToRegister(input); |
| 5009 | 5009 |
| 5010 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); | 5010 if (instr->hydrogen()->value()->representation().IsSmi()) { |
| 5011 __ SmiUntag(input_reg); |
| 5012 } else { |
| 5013 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
| 5011 | 5014 |
| 5012 // Optimistically untag the input. | 5015 // Optimistically untag the input. |
| 5013 // If the input is a HeapObject, SmiUntag will set the carry flag. | 5016 // If the input is a HeapObject, SmiUntag will set the carry flag. |
| 5014 __ SmiUntag(input_reg, SetCC); | 5017 __ SmiUntag(input_reg, SetCC); |
| 5015 // Branch to deferred code if the input was tagged. | 5018 // Branch to deferred code if the input was tagged. |
| 5016 // The deferred code will take care of restoring the tag. | 5019 // The deferred code will take care of restoring the tag. |
| 5017 __ b(cs, deferred->entry()); | 5020 __ b(cs, deferred->entry()); |
| 5018 __ bind(deferred->exit()); | 5021 __ bind(deferred->exit()); |
| 5022 } |
| 5019 } | 5023 } |
| 5020 | 5024 |
| 5021 | 5025 |
| 5022 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { | 5026 void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) { |
| 5023 LOperand* input = instr->value(); | 5027 LOperand* input = instr->value(); |
| 5024 ASSERT(input->IsRegister()); | 5028 ASSERT(input->IsRegister()); |
| 5025 LOperand* result = instr->result(); | 5029 LOperand* result = instr->result(); |
| 5026 ASSERT(result->IsDoubleRegister()); | 5030 ASSERT(result->IsDoubleRegister()); |
| 5027 | 5031 |
| 5028 Register input_reg = ToRegister(input); | 5032 Register input_reg = ToRegister(input); |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5797 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5801 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5798 __ ldr(result, FieldMemOperand(scratch, | 5802 __ ldr(result, FieldMemOperand(scratch, |
| 5799 FixedArray::kHeaderSize - kPointerSize)); | 5803 FixedArray::kHeaderSize - kPointerSize)); |
| 5800 __ bind(&done); | 5804 __ bind(&done); |
| 5801 } | 5805 } |
| 5802 | 5806 |
| 5803 | 5807 |
| 5804 #undef __ | 5808 #undef __ |
| 5805 | 5809 |
| 5806 } } // namespace v8::internal | 5810 } } // namespace v8::internal |
| OLD | NEW |