OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3667 } | 3667 } |
3668 | 3668 |
3669 | 3669 |
3670 // --------------------------------------------------------------------------- | 3670 // --------------------------------------------------------------------------- |
3671 // Support functions. | 3671 // Support functions. |
3672 | 3672 |
3673 | 3673 |
3674 void MacroAssembler::TryGetFunctionPrototype(Register function, | 3674 void MacroAssembler::TryGetFunctionPrototype(Register function, |
3675 Register result, | 3675 Register result, |
3676 Register scratch, | 3676 Register scratch, |
3677 Label* miss) { | 3677 Label* miss, |
| 3678 bool miss_on_bound_function) { |
3678 // Check that the receiver isn't a smi. | 3679 // Check that the receiver isn't a smi. |
3679 JumpIfSmi(function, miss); | 3680 JumpIfSmi(function, miss); |
3680 | 3681 |
3681 // Check that the function really is a function. Load map into result reg. | 3682 // Check that the function really is a function. Load map into result reg. |
3682 GetObjectType(function, result, scratch); | 3683 GetObjectType(function, result, scratch); |
3683 Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE)); | 3684 Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE)); |
3684 | 3685 |
| 3686 if (miss_on_bound_function) { |
| 3687 lw(scratch, |
| 3688 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 3689 lw(scratch, |
| 3690 FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); |
| 3691 And(scratch, scratch, |
| 3692 Operand(Smi::FromInt(1 << SharedFunctionInfo::kBoundFunction))); |
| 3693 Branch(miss, ne, scratch, Operand(zero_reg)); |
| 3694 } |
| 3695 |
3685 // Make sure that the function has an instance prototype. | 3696 // Make sure that the function has an instance prototype. |
3686 Label non_instance; | 3697 Label non_instance; |
3687 lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset)); | 3698 lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset)); |
3688 And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype)); | 3699 And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype)); |
3689 Branch(&non_instance, ne, scratch, Operand(zero_reg)); | 3700 Branch(&non_instance, ne, scratch, Operand(zero_reg)); |
3690 | 3701 |
3691 // Get the prototype or initial map from the function. | 3702 // Get the prototype or initial map from the function. |
3692 lw(result, | 3703 lw(result, |
3693 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 3704 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
3694 | 3705 |
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5124 opcode == BGTZL); | 5135 opcode == BGTZL); |
5125 opcode = (cond == eq) ? BEQ : BNE; | 5136 opcode = (cond == eq) ? BEQ : BNE; |
5126 instr = (instr & ~kOpcodeMask) | opcode; | 5137 instr = (instr & ~kOpcodeMask) | opcode; |
5127 masm_.emit(instr); | 5138 masm_.emit(instr); |
5128 } | 5139 } |
5129 | 5140 |
5130 | 5141 |
5131 } } // namespace v8::internal | 5142 } } // namespace v8::internal |
5132 | 5143 |
5133 #endif // V8_TARGET_ARCH_MIPS | 5144 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |