Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1922 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 1922 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
| 1923 if (FLAG_use_jscre) { | 1923 if (FLAG_use_jscre) { |
| 1924 return; | 1924 return; |
| 1925 } | 1925 } |
| 1926 static const intptr_t kRegExpParamOffset = 3 * kWordSize; | 1926 static const intptr_t kRegExpParamOffset = 3 * kWordSize; |
| 1927 static const intptr_t kStringParamOffset = 2 * kWordSize; | 1927 static const intptr_t kStringParamOffset = 2 * kWordSize; |
| 1928 // start_index smi is located at offset 1. | 1928 // start_index smi is located at offset 1. |
| 1929 | 1929 |
| 1930 // Incoming registers: | 1930 // Incoming registers: |
| 1931 // RAX: Function. (Will be loaded with the specialized matcher function.) | 1931 // RAX: Function. (Will be loaded with the specialized matcher function.) |
| 1932 // RCX: IC-Data. (Will be preserved.) | 1932 // RCX: Unknown. (Must be GC safe on tail call.) |
| 1933 // R10: Arguments descriptor. (Will be preserved.) | 1933 // R10: Arguments descriptor. (Will be preserved.) |
| 1934 | 1934 |
| 1935 // Load the specialized function pointer into RAX. Leverage the fact the | 1935 // Load the specialized function pointer into RAX. Leverage the fact the |
| 1936 // string CIDs as well as stored function pointers are in sequence. | 1936 // string CIDs as well as stored function pointers are in sequence. |
| 1937 __ movq(RBX, Address(RSP, kRegExpParamOffset)); | 1937 __ movq(RBX, Address(RSP, kRegExpParamOffset)); |
| 1938 __ movq(RDI, Address(RSP, kStringParamOffset)); | 1938 __ movq(RDI, Address(RSP, kStringParamOffset)); |
| 1939 __ LoadClassId(RDI, RDI); | 1939 __ LoadClassId(RDI, RDI); |
| 1940 __ SubImmediate(RDI, Immediate(kOneByteStringCid), PP); | 1940 __ SubImmediate(RDI, Immediate(kOneByteStringCid), PP); |
| 1941 __ movq(RAX, FieldAddress(RBX, RDI, TIMES_8, | 1941 __ movq(RAX, FieldAddress(RBX, RDI, TIMES_8, |
| 1942 JSRegExp::function_offset(kOneByteStringCid))); | 1942 JSRegExp::function_offset(kOneByteStringCid))); |
| 1943 | 1943 |
| 1944 // Registers are now set up for the lazy compile stub. It expects the function | 1944 // Registers are now set up for the lazy compile stub. It expects the function |
| 1945 // in RAX, the argument descriptor in R10, and IC-Data in RCX. | 1945 // in RAX, the argument descriptor in R10, and IC-Data in RCX. |
| 1946 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; | 1946 static const intptr_t arg_count = RegExpMacroAssembler::kParamCount; |
| 1947 __ LoadObject(R10, Array::Handle(ArgumentsDescriptor::New(arg_count)), PP); | 1947 __ LoadObject(R10, Array::Handle(ArgumentsDescriptor::New(arg_count)), PP); |
| 1948 __ xorl(RCX, RCX); | |
|
Vyacheslav Egorov (Google)
2014/11/26 14:26:17
xor*q*
zerny-google
2014/11/26 14:33:55
Thanks!
| |
| 1948 | 1949 |
| 1949 // Tail-call the function. | 1950 // Tail-call the function. |
| 1950 __ movq(RDI, FieldAddress(RAX, Function::instructions_offset())); | 1951 __ movq(RDI, FieldAddress(RAX, Function::instructions_offset())); |
| 1951 __ addq(RDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 1952 __ addq(RDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 1952 __ jmp(RDI); | 1953 __ jmp(RDI); |
| 1953 } | 1954 } |
| 1954 | 1955 |
| 1955 | 1956 |
| 1956 // On stack: user tag (+1), return-address (+0). | 1957 // On stack: user tag (+1), return-address (+0). |
| 1957 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { | 1958 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1996 // Set return value to Isolate::current_tag_. | 1997 // Set return value to Isolate::current_tag_. |
| 1997 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1998 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1998 __ ret(); | 1999 __ ret(); |
| 1999 } | 2000 } |
| 2000 | 2001 |
| 2001 #undef __ | 2002 #undef __ |
| 2002 | 2003 |
| 2003 } // namespace dart | 2004 } // namespace dart |
| 2004 | 2005 |
| 2005 #endif // defined TARGET_ARCH_X64 | 2006 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |