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

Side by Side Diff: vm/code_patcher_ia32_test.cc

Issue 10874072: Use the return value of vm native methods to set the return value, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
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_IA32) 6 #if defined(TARGET_ARCH_IA32)
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"
11 #include "vm/dart_entry.h" 11 #include "vm/dart_entry.h"
12 #include "vm/instructions.h" 12 #include "vm/instructions.h"
13 #include "vm/native_entry.h" 13 #include "vm/native_entry.h"
14 #include "vm/native_entry_test.h" 14 #include "vm/native_entry_test.h"
15 #include "vm/stub_code.h" 15 #include "vm/stub_code.h"
16 #include "vm/symbols.h" 16 #include "vm/symbols.h"
17 #include "vm/unit_test.h" 17 #include "vm/unit_test.h"
18 18
19 namespace dart { 19 namespace dart {
20 20
21 CODEGEN_TEST_GENERATE(NativePatchStaticCall, test) { 21 CODEGEN_TEST_GENERATE(NativePatchStaticCall, test) {
22 SequenceNode* node_seq = test->node_sequence(); 22 SequenceNode* node_seq = test->node_sequence();
23 const int num_params = 0; 23 const int num_params = 0;
24 const bool has_opt_params = false; 24 const bool has_opt_params = false;
25 const String& native_name = 25 const String& native_name =
26 String::ZoneHandle(Symbols::New("TestStaticCallPatching")); 26 String::ZoneHandle(Symbols::New("TestStaticCallPatching"));
27 NativeFunction native_function = reinterpret_cast<NativeFunction>( 27 NativeFunction native_function =
28 NATIVE_ENTRY_FUNCTION(TestStaticCallPatching)); 28 reinterpret_cast<NativeFunction>(TestStaticCallPatching);
29 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex, 29 node_seq->Add(new ReturnNode(Scanner::kDummyTokenIndex,
30 new NativeBodyNode(Scanner::kDummyTokenIndex, 30 new NativeBodyNode(Scanner::kDummyTokenIndex,
31 native_name, 31 native_name,
32 native_function, 32 native_function,
33 num_params, 33 num_params,
34 has_opt_params, 34 has_opt_params,
35 false))); 35 false)));
36 } 36 }
37 37
38 CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) { 38 CODEGEN_TEST2_GENERATE(PatchStaticCall, function, test) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 CodePatcher::GetInstanceCallIcDataAt(return_address)); 77 CodePatcher::GetInstanceCallIcDataAt(return_address));
78 EXPECT_STREQ("targetFunction", 78 EXPECT_STREQ("targetFunction",
79 String::Handle(ic_data.target_name()).ToCString()); 79 String::Handle(ic_data.target_name()).ToCString());
80 EXPECT_EQ(1, ic_data.num_args_tested()); 80 EXPECT_EQ(1, ic_data.num_args_tested());
81 EXPECT_EQ(0, ic_data.NumberOfChecks()); 81 EXPECT_EQ(0, ic_data.NumberOfChecks());
82 } 82 }
83 83
84 } // namespace dart 84 } // namespace dart
85 85
86 #endif // TARGET_ARCH_IA32 86 #endif // TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698