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 5350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5361 | 5361 |
5362 virtual LInstruction* instr() { return instr_; } | 5362 virtual LInstruction* instr() { return instr_; } |
5363 private: | 5363 private: |
5364 LTaggedToI* instr_; | 5364 LTaggedToI* instr_; |
5365 }; | 5365 }; |
5366 | 5366 |
5367 Register input = ToRegister(instr->value()); | 5367 Register input = ToRegister(instr->value()); |
5368 Register output = ToRegister(instr->result()); | 5368 Register output = ToRegister(instr->result()); |
5369 | 5369 |
5370 if (instr->hydrogen()->value()->representation().IsSmi()) { | 5370 if (instr->hydrogen()->value()->representation().IsSmi()) { |
5371 __ SmiUntag(input); | 5371 __ SmiUntag(output, input); |
5372 } else { | 5372 } else { |
5373 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); | 5373 DeferredTaggedToI* deferred = new(zone()) DeferredTaggedToI(this, instr); |
5374 | 5374 |
5375 // TODO(jbramley): We can't use JumpIfNotSmi here because the tbz it uses | 5375 __ JumpIfNotSmi(input, deferred->entry()); |
5376 // doesn't always have enough range. Consider making a variant of it, or a | |
5377 // TestIsSmi helper. | |
5378 STATIC_ASSERT(kSmiTag == 0); | |
5379 __ Tst(input, kSmiTagMask); | |
5380 __ B(ne, deferred->entry()); | |
5381 | |
5382 __ SmiUntag(output, input); | 5376 __ SmiUntag(output, input); |
5383 __ Bind(deferred->exit()); | 5377 __ Bind(deferred->exit()); |
5384 } | 5378 } |
5385 } | 5379 } |
5386 | 5380 |
5387 | 5381 |
5388 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 5382 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
5389 Register result = ToRegister(instr->result()); | 5383 Register result = ToRegister(instr->result()); |
5390 __ Ldr(result, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 5384 __ Ldr(result, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
5391 } | 5385 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5690 __ Bind(&out_of_object); | 5684 __ Bind(&out_of_object); |
5691 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5685 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
5692 // Index is equal to negated out of object property index plus 1. | 5686 // Index is equal to negated out of object property index plus 1. |
5693 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5687 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
5694 __ Ldr(result, FieldMemOperand(result, | 5688 __ Ldr(result, FieldMemOperand(result, |
5695 FixedArray::kHeaderSize - kPointerSize)); | 5689 FixedArray::kHeaderSize - kPointerSize)); |
5696 __ Bind(&done); | 5690 __ Bind(&done); |
5697 } | 5691 } |
5698 | 5692 |
5699 } } // namespace v8::internal | 5693 } } // namespace v8::internal |
OLD | NEW |