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

Side by Side Diff: src/ia32/macro-assembler-ia32.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/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-codegen-mips.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 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1916 Label* done, 1916 Label* done,
1917 bool* definitely_mismatches, 1917 bool* definitely_mismatches,
1918 InvokeFlag flag, 1918 InvokeFlag flag,
1919 Label::Distance done_near, 1919 Label::Distance done_near,
1920 const CallWrapper& call_wrapper) { 1920 const CallWrapper& call_wrapper) {
1921 bool definitely_matches = false; 1921 bool definitely_matches = false;
1922 *definitely_mismatches = false; 1922 *definitely_mismatches = false;
1923 Label invoke; 1923 Label invoke;
1924 if (expected.is_immediate()) { 1924 if (expected.is_immediate()) {
1925 DCHECK(actual.is_immediate()); 1925 DCHECK(actual.is_immediate());
1926 mov(eax, actual.immediate());
1926 if (expected.immediate() == actual.immediate()) { 1927 if (expected.immediate() == actual.immediate()) {
1927 definitely_matches = true; 1928 definitely_matches = true;
1928 } else { 1929 } else {
1929 mov(eax, actual.immediate());
1930 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel; 1930 const int sentinel = SharedFunctionInfo::kDontAdaptArgumentsSentinel;
1931 if (expected.immediate() == sentinel) { 1931 if (expected.immediate() == sentinel) {
1932 // Don't worry about adapting arguments for builtins that 1932 // Don't worry about adapting arguments for builtins that
1933 // don't want that done. Skip adaption code by making it look 1933 // don't want that done. Skip adaption code by making it look
1934 // like we have a match between expected and actual number of 1934 // like we have a match between expected and actual number of
1935 // arguments. 1935 // arguments.
1936 definitely_matches = true; 1936 definitely_matches = true;
1937 } else { 1937 } else {
1938 *definitely_mismatches = true; 1938 *definitely_mismatches = true;
1939 mov(ebx, expected.immediate()); 1939 mov(ebx, expected.immediate());
1940 } 1940 }
1941 } 1941 }
1942 } else { 1942 } else {
1943 if (actual.is_immediate()) { 1943 if (actual.is_immediate()) {
1944 // Expected is in register, actual is immediate. This is the 1944 // Expected is in register, actual is immediate. This is the
1945 // case when we invoke function values without going through the 1945 // case when we invoke function values without going through the
1946 // IC mechanism. 1946 // IC mechanism.
1947 mov(eax, actual.immediate());
1947 cmp(expected.reg(), actual.immediate()); 1948 cmp(expected.reg(), actual.immediate());
1948 j(equal, &invoke); 1949 j(equal, &invoke);
1949 DCHECK(expected.reg().is(ebx)); 1950 DCHECK(expected.reg().is(ebx));
1950 mov(eax, actual.immediate());
1951 } else if (!expected.reg().is(actual.reg())) { 1951 } else if (!expected.reg().is(actual.reg())) {
1952 // Both expected and actual are in (different) registers. This 1952 // Both expected and actual are in (different) registers. This
1953 // is the case when we invoke functions using call and apply. 1953 // is the case when we invoke functions using call and apply.
1954 cmp(expected.reg(), actual.reg()); 1954 cmp(expected.reg(), actual.reg());
1955 j(equal, &invoke); 1955 j(equal, &invoke);
1956 DCHECK(actual.reg().is(eax)); 1956 DCHECK(actual.reg().is(eax));
1957 DCHECK(expected.reg().is(ebx)); 1957 DCHECK(expected.reg().is(ebx));
1958 } else {
1959 Move(eax, actual.reg());
1958 } 1960 }
1959 } 1961 }
1960 1962
1961 if (!definitely_matches) { 1963 if (!definitely_matches) {
1962 Handle<Code> adaptor = 1964 Handle<Code> adaptor =
1963 isolate()->builtins()->ArgumentsAdaptorTrampoline(); 1965 isolate()->builtins()->ArgumentsAdaptorTrampoline();
1964 if (!code_constant.is_null()) { 1966 if (!code_constant.is_null()) {
1965 mov(edx, Immediate(code_constant)); 1967 mov(edx, Immediate(code_constant));
1966 add(edx, Immediate(Code::kHeaderSize - kHeapObjectTag)); 1968 add(edx, Immediate(Code::kHeaderSize - kHeapObjectTag));
1967 } else if (!code_operand.is_reg(edx)) { 1969 } else if (!code_operand.is_reg(edx)) {
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3187 mov(eax, dividend); 3189 mov(eax, dividend);
3188 shr(eax, 31); 3190 shr(eax, 31);
3189 add(edx, eax); 3191 add(edx, eax);
3190 } 3192 }
3191 3193
3192 3194
3193 } // namespace internal 3195 } // namespace internal
3194 } // namespace v8 3196 } // namespace v8
3195 3197
3196 #endif // V8_TARGET_ARCH_IA32 3198 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698