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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 const Array& args_descriptor = Array::Handle( | 38 const Array& args_descriptor = Array::Handle( |
39 ArgumentsDescriptor::New(kTypeArgsLen, kNumArgs, Object::null_array())); | 39 ArgumentsDescriptor::New(kTypeArgsLen, kNumArgs, Object::null_array())); |
40 const ICData& ic_data = ICData::ZoneHandle( | 40 const ICData& ic_data = ICData::ZoneHandle( |
41 ICData::New(function, target_name, args_descriptor, 15, 1, false)); | 41 ICData::New(function, target_name, args_descriptor, 15, 1, false)); |
42 | 42 |
43 __ LoadObject(ECX, ic_data); | 43 __ LoadObject(ECX, ic_data); |
44 __ Call(*StubCode::OneArgCheckInlineCache_entry()); | 44 __ Call(*StubCode::OneArgCheckInlineCache_entry()); |
45 __ ret(); | 45 __ ret(); |
46 } | 46 } |
47 | 47 |
48 | |
49 ASSEMBLER_TEST_RUN(IcDataAccess, test) { | 48 ASSEMBLER_TEST_RUN(IcDataAccess, test) { |
50 uword return_address = test->entry() + CodePatcher::InstanceCallSizeInBytes(); | 49 uword return_address = test->entry() + CodePatcher::InstanceCallSizeInBytes(); |
51 ICData& ic_data = ICData::Handle(); | 50 ICData& ic_data = ICData::Handle(); |
52 CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data); | 51 CodePatcher::GetInstanceCallAt(return_address, test->code(), &ic_data); |
53 EXPECT_STREQ("targetFunction", | 52 EXPECT_STREQ("targetFunction", |
54 String::Handle(ic_data.target_name()).ToCString()); | 53 String::Handle(ic_data.target_name()).ToCString()); |
55 EXPECT_EQ(1, ic_data.NumArgsTested()); | 54 EXPECT_EQ(1, ic_data.NumArgsTested()); |
56 EXPECT_EQ(0, ic_data.NumberOfChecks()); | 55 EXPECT_EQ(0, ic_data.NumberOfChecks()); |
57 } | 56 } |
58 | 57 |
59 } // namespace dart | 58 } // namespace dart |
60 | 59 |
61 #endif // TARGET_ARCH_IA32 | 60 #endif // TARGET_ARCH_IA32 |
OLD | NEW |