| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <assert.h> // For assert | 5 #include <assert.h> // For assert |
| 6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 7 | 7 |
| 8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
| 9 | 9 |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 // passed in registers. | 981 // passed in registers. |
| 982 | 982 |
| 983 // ARM has some sanity checks as per below, considering add them for PPC | 983 // ARM has some sanity checks as per below, considering add them for PPC |
| 984 // DCHECK(actual.is_immediate() || actual.reg().is(r3)); | 984 // DCHECK(actual.is_immediate() || actual.reg().is(r3)); |
| 985 // DCHECK(expected.is_immediate() || expected.reg().is(r5)); | 985 // DCHECK(expected.is_immediate() || expected.reg().is(r5)); |
| 986 // DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) | 986 // DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) |
| 987 // || code_reg.is(r6)); | 987 // || code_reg.is(r6)); |
| 988 | 988 |
| 989 if (expected.is_immediate()) { | 989 if (expected.is_immediate()) { |
| 990 DCHECK(actual.is_immediate()); | 990 DCHECK(actual.is_immediate()); |
| 991 mov(r3, Operand(actual.immediate())); |
| 991 if (expected.immediate() == actual.immediate()) { | 992 if (expected.immediate() == actual.immediate()) { |
| 992 definitely_matches = true; | 993 definitely_matches = true; |
| 993 } else { | 994 } else { |
| 994 mov(r3, Operand(actual.immediate())); | |
| 995 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 995 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
| 996 if (expected.immediate() == sentinel) { | 996 if (expected.immediate() == sentinel) { |
| 997 // Don't worry about adapting arguments for builtins that | 997 // Don't worry about adapting arguments for builtins that |
| 998 // don't want that done. Skip adaption code by making it look | 998 // don't want that done. Skip adaption code by making it look |
| 999 // like we have a match between expected and actual number of | 999 // like we have a match between expected and actual number of |
| 1000 // arguments. | 1000 // arguments. |
| 1001 definitely_matches = true; | 1001 definitely_matches = true; |
| 1002 } else { | 1002 } else { |
| 1003 *definitely_mismatches = true; | 1003 *definitely_mismatches = true; |
| 1004 mov(r5, Operand(expected.immediate())); | 1004 mov(r5, Operand(expected.immediate())); |
| 1005 } | 1005 } |
| 1006 } | 1006 } |
| 1007 } else { | 1007 } else { |
| 1008 if (actual.is_immediate()) { | 1008 if (actual.is_immediate()) { |
| 1009 mov(r3, Operand(actual.immediate())); |
| 1009 cmpi(expected.reg(), Operand(actual.immediate())); | 1010 cmpi(expected.reg(), Operand(actual.immediate())); |
| 1010 beq(®ular_invoke); | 1011 beq(®ular_invoke); |
| 1011 mov(r3, Operand(actual.immediate())); | |
| 1012 } else { | 1012 } else { |
| 1013 cmp(expected.reg(), actual.reg()); | 1013 cmp(expected.reg(), actual.reg()); |
| 1014 beq(®ular_invoke); | 1014 beq(®ular_invoke); |
| 1015 } | 1015 } |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 if (!definitely_matches) { | 1018 if (!definitely_matches) { |
| 1019 if (!code_constant.is_null()) { | 1019 if (!code_constant.is_null()) { |
| 1020 mov(r6, Operand(code_constant)); | 1020 mov(r6, Operand(code_constant)); |
| 1021 addi(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1021 addi(r6, r6, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| (...skipping 3387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4409 } | 4409 } |
| 4410 if (mag.shift > 0) srawi(result, result, mag.shift); | 4410 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4411 ExtractBit(r0, dividend, 31); | 4411 ExtractBit(r0, dividend, 31); |
| 4412 add(result, result, r0); | 4412 add(result, result, r0); |
| 4413 } | 4413 } |
| 4414 | 4414 |
| 4415 } // namespace internal | 4415 } // namespace internal |
| 4416 } // namespace v8 | 4416 } // namespace v8 |
| 4417 | 4417 |
| 4418 #endif // V8_TARGET_ARCH_PPC | 4418 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |