OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 const bool has_opt_params = false; | 23 const bool has_opt_params = false; |
24 const String& native_name = | 24 const String& native_name = |
25 String::ZoneHandle(String::NewSymbol("TestStaticCallPatching")); | 25 String::ZoneHandle(String::NewSymbol("TestStaticCallPatching")); |
26 NativeFunction native_function = reinterpret_cast<NativeFunction>( | 26 NativeFunction native_function = reinterpret_cast<NativeFunction>( |
27 NATIVE_ENTRY_FUNCTION(TestStaticCallPatching)); | 27 NATIVE_ENTRY_FUNCTION(TestStaticCallPatching)); |
28 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex, | 28 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex, |
29 new NativeBodyNode(Scanner::kDummyTokenIndex, | 29 new NativeBodyNode(Scanner::kDummyTokenIndex, |
30 native_name, | 30 native_name, |
31 native_function, | 31 native_function, |
32 num_params, | 32 num_params, |
33 has_opt_params))); | 33 has_opt_params, |
| 34 false))); |
34 } | 35 } |
35 | 36 |
36 CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) { | 37 CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) { |
37 SequenceNode* node_seq = test->node_sequence(); | 38 SequenceNode* node_seq = test->node_sequence(); |
38 ArgumentListNode* arguments = new ArgumentListNode(Scanner::kDummyTokenIndex); | 39 ArgumentListNode* arguments = new ArgumentListNode(Scanner::kDummyTokenIndex); |
39 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex, | 40 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex, |
40 new StaticCallNode(Scanner::kDummyTokenIndex, | 41 new StaticCallNode(Scanner::kDummyTokenIndex, |
41 function, arguments))); | 42 function, arguments))); |
42 } | 43 } |
43 | 44 |
(...skipping 26 matching lines...) Expand all Loading... |
70 CodePatcher::GetInstanceCallIcDataAt(return_address)); | 71 CodePatcher::GetInstanceCallIcDataAt(return_address)); |
71 EXPECT_STREQ("targetFunction", | 72 EXPECT_STREQ("targetFunction", |
72 String::Handle(ic_data.target_name()).ToCString()); | 73 String::Handle(ic_data.target_name()).ToCString()); |
73 EXPECT_EQ(1, ic_data.num_args_tested()); | 74 EXPECT_EQ(1, ic_data.num_args_tested()); |
74 EXPECT_EQ(0, ic_data.NumberOfChecks()); | 75 EXPECT_EQ(0, ic_data.NumberOfChecks()); |
75 } | 76 } |
76 | 77 |
77 } // namespace dart | 78 } // namespace dart |
78 | 79 |
79 #endif // TARGET_ARCH_X64 | 80 #endif // TARGET_ARCH_X64 |
OLD | NEW |