| 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 5571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5582 __ Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset)); | 5582 __ Ldr(temp, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 5583 __ Cmp(map, temp); | 5583 __ Cmp(map, temp); |
| 5584 DeoptimizeIf(ne, instr->environment()); | 5584 DeoptimizeIf(ne, instr->environment()); |
| 5585 } | 5585 } |
| 5586 | 5586 |
| 5587 | 5587 |
| 5588 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { | 5588 void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
| 5589 Register receiver = ToRegister(instr->receiver()); | 5589 Register receiver = ToRegister(instr->receiver()); |
| 5590 Register function = ToRegister(instr->function()); | 5590 Register function = ToRegister(instr->function()); |
| 5591 Register result = ToRegister(instr->result()); | 5591 Register result = ToRegister(instr->result()); |
| 5592 Register temp = ToRegister(instr->temp()); | |
| 5593 | 5592 |
| 5594 // If the receiver is null or undefined, we have to pass the global object as | 5593 // If the receiver is null or undefined, we have to pass the global object as |
| 5595 // a receiver to normal functions. Values have to be passed unchanged to | 5594 // a receiver to normal functions. Values have to be passed unchanged to |
| 5596 // builtins and strict-mode functions. | 5595 // builtins and strict-mode functions. |
| 5597 Label global_object, done, deopt; | 5596 Label global_object, done, deopt; |
| 5598 | 5597 |
| 5599 __ Ldr(temp, FieldMemOperand(function, | 5598 __ Ldr(result, FieldMemOperand(function, |
| 5600 JSFunction::kSharedFunctionInfoOffset)); | 5599 JSFunction::kSharedFunctionInfoOffset)); |
| 5601 | 5600 |
| 5602 // CompilerHints is an int32 field. See objects.h. | 5601 // CompilerHints is an int32 field. See objects.h. |
| 5603 __ Ldr(temp.W(), | 5602 __ Ldr(result.W(), |
| 5604 FieldMemOperand(temp, SharedFunctionInfo::kCompilerHintsOffset)); | 5603 FieldMemOperand(result, SharedFunctionInfo::kCompilerHintsOffset)); |
| 5605 | 5604 |
| 5606 // Do not transform the receiver to object for strict mode functions. | 5605 // Do not transform the receiver to object for strict mode functions. |
| 5607 __ Tbnz(temp, SharedFunctionInfo::kStrictModeFunction, &done); | 5606 __ Tbnz(result, SharedFunctionInfo::kStrictModeFunction, &done); |
| 5608 | 5607 |
| 5609 // Do not transform the receiver to object for builtins. | 5608 // Do not transform the receiver to object for builtins. |
| 5610 __ Tbnz(temp, SharedFunctionInfo::kNative, &done); | 5609 __ Tbnz(result, SharedFunctionInfo::kNative, &done); |
| 5611 | 5610 |
| 5612 // Normal function. Replace undefined or null with global receiver. | 5611 // Normal function. Replace undefined or null with global receiver. |
| 5613 __ JumpIfRoot(receiver, Heap::kNullValueRootIndex, &global_object); | 5612 __ JumpIfRoot(receiver, Heap::kNullValueRootIndex, &global_object); |
| 5614 __ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex, &global_object); | 5613 __ JumpIfRoot(receiver, Heap::kUndefinedValueRootIndex, &global_object); |
| 5615 | 5614 |
| 5616 // Deoptimize if the receiver is not a JS object. | 5615 // Deoptimize if the receiver is not a JS object. |
| 5617 __ JumpIfSmi(receiver, &deopt); | 5616 __ JumpIfSmi(receiver, &deopt); |
| 5618 __ CompareObjectType(receiver, temp, temp, FIRST_SPEC_OBJECT_TYPE); | 5617 __ CompareObjectType(receiver, result, result, FIRST_SPEC_OBJECT_TYPE); |
| 5619 __ B(ge, &done); | 5618 __ B(ge, &done); |
| 5620 // Otherwise, fall through to deopt. | 5619 // Otherwise, fall through to deopt. |
| 5621 | 5620 |
| 5622 __ Bind(&deopt); | 5621 __ Bind(&deopt); |
| 5623 Deoptimize(instr->environment()); | 5622 Deoptimize(instr->environment()); |
| 5624 | 5623 |
| 5625 __ Bind(&global_object); | 5624 __ Bind(&global_object); |
| 5626 // We could load directly into the result register here, but the additional | 5625 // We could load directly into the result register here, but the additional |
| 5627 // branches required are likely to be more time consuming than one additional | 5626 // branches required are likely to be more time consuming than one additional |
| 5628 // move. | 5627 // move. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 5658 __ Bind(&out_of_object); | 5657 __ Bind(&out_of_object); |
| 5659 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5658 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5660 // Index is equal to negated out of object property index plus 1. | 5659 // Index is equal to negated out of object property index plus 1. |
| 5661 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5660 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5662 __ Ldr(result, FieldMemOperand(result, | 5661 __ Ldr(result, FieldMemOperand(result, |
| 5663 FixedArray::kHeaderSize - kPointerSize)); | 5662 FixedArray::kHeaderSize - kPointerSize)); |
| 5664 __ Bind(&done); | 5663 __ Bind(&done); |
| 5665 } | 5664 } |
| 5666 | 5665 |
| 5667 } } // namespace v8::internal | 5666 } } // namespace v8::internal |
| OLD | NEW |