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 2012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 mov(ip, Operand(map)); | 2023 mov(ip, Operand(map)); |
2024 cmp(scratch, ip); | 2024 cmp(scratch, ip); |
2025 Jump(success, RelocInfo::CODE_TARGET, eq); | 2025 Jump(success, RelocInfo::CODE_TARGET, eq); |
2026 bind(&fail); | 2026 bind(&fail); |
2027 } | 2027 } |
2028 | 2028 |
2029 | 2029 |
2030 void MacroAssembler::TryGetFunctionPrototype(Register function, | 2030 void MacroAssembler::TryGetFunctionPrototype(Register function, |
2031 Register result, | 2031 Register result, |
2032 Register scratch, | 2032 Register scratch, |
2033 Label* miss) { | 2033 Label* miss, |
| 2034 bool miss_on_bound_function) { |
2034 // Check that the receiver isn't a smi. | 2035 // Check that the receiver isn't a smi. |
2035 JumpIfSmi(function, miss); | 2036 JumpIfSmi(function, miss); |
2036 | 2037 |
2037 // Check that the function really is a function. Load map into result reg. | 2038 // Check that the function really is a function. Load map into result reg. |
2038 CompareObjectType(function, result, scratch, JS_FUNCTION_TYPE); | 2039 CompareObjectType(function, result, scratch, JS_FUNCTION_TYPE); |
2039 b(ne, miss); | 2040 b(ne, miss); |
2040 | 2041 |
| 2042 if (miss_on_bound_function) { |
| 2043 ldr(scratch, |
| 2044 FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
| 2045 ldr(scratch, |
| 2046 FieldMemOperand(scratch, SharedFunctionInfo::kCompilerHintsOffset)); |
| 2047 tst(scratch, Operand(1 << SharedFunctionInfo::kBoundFunction)); |
| 2048 b(ne, miss); |
| 2049 } |
| 2050 |
2041 // Make sure that the function has an instance prototype. | 2051 // Make sure that the function has an instance prototype. |
2042 Label non_instance; | 2052 Label non_instance; |
2043 ldrb(scratch, FieldMemOperand(result, Map::kBitFieldOffset)); | 2053 ldrb(scratch, FieldMemOperand(result, Map::kBitFieldOffset)); |
2044 tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); | 2054 tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); |
2045 b(ne, &non_instance); | 2055 b(ne, &non_instance); |
2046 | 2056 |
2047 // Get the prototype or initial map from the function. | 2057 // Get the prototype or initial map from the function. |
2048 ldr(result, | 2058 ldr(result, |
2049 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | 2059 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); |
2050 | 2060 |
(...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 void CodePatcher::EmitCondition(Condition cond) { | 3661 void CodePatcher::EmitCondition(Condition cond) { |
3652 Instr instr = Assembler::instr_at(masm_.pc_); | 3662 Instr instr = Assembler::instr_at(masm_.pc_); |
3653 instr = (instr & ~kCondMask) | cond; | 3663 instr = (instr & ~kCondMask) | cond; |
3654 masm_.emit(instr); | 3664 masm_.emit(instr); |
3655 } | 3665 } |
3656 | 3666 |
3657 | 3667 |
3658 } } // namespace v8::internal | 3668 } } // namespace v8::internal |
3659 | 3669 |
3660 #endif // V8_TARGET_ARCH_ARM | 3670 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |