Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 1330033002: [calls] Consistent call protocol for calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add arm64, mips and mips64 ports. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Copyright 2012 the V8 project authors. All rights reserved. 2 // Copyright 2012 the V8 project authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
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_MIPS 8 #if V8_TARGET_ARCH_MIPS
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 4074
4075 // The code below is made a lot easier because the calling code already sets 4075 // The code below is made a lot easier because the calling code already sets
4076 // up actual and expected registers according to the contract if values are 4076 // up actual and expected registers according to the contract if values are
4077 // passed in registers. 4077 // passed in registers.
4078 DCHECK(actual.is_immediate() || actual.reg().is(a0)); 4078 DCHECK(actual.is_immediate() || actual.reg().is(a0));
4079 DCHECK(expected.is_immediate() || expected.reg().is(a2)); 4079 DCHECK(expected.is_immediate() || expected.reg().is(a2));
4080 DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(a3)); 4080 DCHECK((!code_constant.is_null() && code_reg.is(no_reg)) || code_reg.is(a3));
4081 4081
4082 if (expected.is_immediate()) { 4082 if (expected.is_immediate()) {
4083 DCHECK(actual.is_immediate()); 4083 DCHECK(actual.is_immediate());
4084 li(a0, Operand(actual.immediate()));
4084 if (expected.immediate() == actual.immediate()) { 4085 if (expected.immediate() == actual.immediate()) {
4085 definitely_matches = true; 4086 definitely_matches = true;
4086 } else { 4087 } else {
4087 li(a0, Operand(actual.immediate()));
4088 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; 4088 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
4089 if (expected.immediate() == sentinel) { 4089 if (expected.immediate() == sentinel) {
4090 // Don't worry about adapting arguments for builtins that 4090 // Don't worry about adapting arguments for builtins that
4091 // don't want that done. Skip adaption code by making it look 4091 // don't want that done. Skip adaption code by making it look
4092 // like we have a match between expected and actual number of 4092 // like we have a match between expected and actual number of
4093 // arguments. 4093 // arguments.
4094 definitely_matches = true; 4094 definitely_matches = true;
4095 } else { 4095 } else {
4096 *definitely_mismatches = true; 4096 *definitely_mismatches = true;
4097 li(a2, Operand(expected.immediate())); 4097 li(a2, Operand(expected.immediate()));
4098 } 4098 }
4099 } 4099 }
4100 } else if (actual.is_immediate()) { 4100 } else if (actual.is_immediate()) {
4101 Branch(&regular_invoke, eq, expected.reg(), Operand(actual.immediate()));
4102 li(a0, Operand(actual.immediate())); 4101 li(a0, Operand(actual.immediate()));
4102 Branch(&regular_invoke, eq, expected.reg(), Operand(a0));
4103 } else { 4103 } else {
4104 Branch(&regular_invoke, eq, expected.reg(), Operand(actual.reg())); 4104 Branch(&regular_invoke, eq, expected.reg(), Operand(actual.reg()));
4105 } 4105 }
4106 4106
4107 if (!definitely_matches) { 4107 if (!definitely_matches) {
4108 if (!code_constant.is_null()) { 4108 if (!code_constant.is_null()) {
4109 li(a3, Operand(code_constant)); 4109 li(a3, Operand(code_constant));
4110 addiu(a3, a3, Code::kHeaderSize - kHeapObjectTag); 4110 addiu(a3, a3, Code::kHeaderSize - kHeapObjectTag);
4111 } 4111 }
4112 4112
(...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after
6013 if (mag.shift > 0) sra(result, result, mag.shift); 6013 if (mag.shift > 0) sra(result, result, mag.shift);
6014 srl(at, dividend, 31); 6014 srl(at, dividend, 31);
6015 Addu(result, result, Operand(at)); 6015 Addu(result, result, Operand(at));
6016 } 6016 }
6017 6017
6018 6018
6019 } // namespace internal 6019 } // namespace internal
6020 } // namespace v8 6020 } // namespace v8
6021 6021
6022 #endif // V8_TARGET_ARCH_MIPS 6022 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698