| 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" |
| 11 #include "vm/dart_entry.h" | 11 #include "vm/dart_entry.h" |
| 12 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 13 #include "vm/instructions.h" | 13 #include "vm/instructions.h" |
| 14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
| 15 #include "vm/regexp_assembler.h" | 15 #include "vm/regexp_assembler.h" |
| 16 #include "vm/symbols.h" | 16 #include "vm/symbols.h" |
| 17 | 17 |
| 18 namespace dart { | 18 namespace dart { |
| 19 | 19 |
| 20 DECLARE_FLAG(bool, interpret_irregexp); |
| 21 |
| 20 // When entering intrinsics code: | 22 // When entering intrinsics code: |
| 21 // RBX: IC Data | 23 // RBX: IC Data |
| 22 // R10: Arguments descriptor | 24 // R10: Arguments descriptor |
| 23 // TOS: Return address | 25 // TOS: Return address |
| 24 // The RBX, R10 registers can be destroyed only if there is no slow-path, i.e. | 26 // The RBX, R10 registers can be destroyed only if there is no slow-path, i.e. |
| 25 // if the intrinsified method always executes a return. | 27 // if the intrinsified method always executes a return. |
| 26 // The RBP register should not be modified, because it is used by the profiler. | 28 // The RBP register should not be modified, because it is used by the profiler. |
| 27 | 29 |
| 28 #define __ assembler-> | 30 #define __ assembler-> |
| 29 | 31 |
| (...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1904 StringEquality(assembler, kOneByteStringCid); | 1906 StringEquality(assembler, kOneByteStringCid); |
| 1905 } | 1907 } |
| 1906 | 1908 |
| 1907 | 1909 |
| 1908 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { | 1910 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { |
| 1909 StringEquality(assembler, kTwoByteStringCid); | 1911 StringEquality(assembler, kTwoByteStringCid); |
| 1910 } | 1912 } |
| 1911 | 1913 |
| 1912 | 1914 |
| 1913 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { | 1915 void Intrinsifier::JSRegExp_ExecuteMatch(Assembler* assembler) { |
| 1916 if (FLAG_interpret_irregexp) return; |
| 1917 |
| 1914 static const intptr_t kRegExpParamOffset = 3 * kWordSize; | 1918 static const intptr_t kRegExpParamOffset = 3 * kWordSize; |
| 1915 static const intptr_t kStringParamOffset = 2 * kWordSize; | 1919 static const intptr_t kStringParamOffset = 2 * kWordSize; |
| 1916 // start_index smi is located at offset 1. | 1920 // start_index smi is located at offset 1. |
| 1917 | 1921 |
| 1918 // Incoming registers: | 1922 // Incoming registers: |
| 1919 // RAX: Function. (Will be loaded with the specialized matcher function.) | 1923 // RAX: Function. (Will be loaded with the specialized matcher function.) |
| 1920 // RCX: Unknown. (Must be GC safe on tail call.) | 1924 // RCX: Unknown. (Must be GC safe on tail call.) |
| 1921 // R10: Arguments descriptor. (Will be preserved.) | 1925 // R10: Arguments descriptor. (Will be preserved.) |
| 1922 | 1926 |
| 1923 // Load the specialized function pointer into RAX. Leverage the fact the | 1927 // Load the specialized function pointer into RAX. Leverage the fact the |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 // Set return value to Isolate::current_tag_. | 1989 // Set return value to Isolate::current_tag_. |
| 1986 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1990 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1987 __ ret(); | 1991 __ ret(); |
| 1988 } | 1992 } |
| 1989 | 1993 |
| 1990 #undef __ | 1994 #undef __ |
| 1991 | 1995 |
| 1992 } // namespace dart | 1996 } // namespace dart |
| 1993 | 1997 |
| 1994 #endif // defined TARGET_ARCH_X64 | 1998 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |