| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 CODEGEN_TEST2_RUN(PatchStaticCall, NativePatchStaticCall, Instance::null()); | 46 CODEGEN_TEST2_RUN(PatchStaticCall, NativePatchStaticCall, Instance::null()); |
| 47 | 47 |
| 48 #define __ assembler-> | 48 #define __ assembler-> |
| 49 | 49 |
| 50 ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) { | 50 ASSEMBLER_TEST_GENERATE(IcDataAccess, assembler) { |
| 51 const String& function_name = | 51 const String& function_name = |
| 52 String::ZoneHandle(Symbols::New("callerFunction")); | 52 String::ZoneHandle(Symbols::New("callerFunction")); |
| 53 const Function& function = Function::ZoneHandle( | 53 const Function& function = Function::ZoneHandle( |
| 54 Function::New(function_name, RawFunction::kRegularFunction, | 54 Function::New(function_name, RawFunction::kRegularFunction, |
| 55 true, false, false, 0)); | 55 true, false, false, false, 0)); |
| 56 | 56 |
| 57 const String& target_name = String::Handle(String::New("targetFunction")); | 57 const String& target_name = String::Handle(String::New("targetFunction")); |
| 58 ICData& ic_data = ICData::ZoneHandle( | 58 ICData& ic_data = ICData::ZoneHandle( |
| 59 ICData::New(function, target_name, 15, 1)); | 59 ICData::New(function, target_name, 15, 1)); |
| 60 | 60 |
| 61 __ LoadObject(RBX, ic_data); | 61 __ LoadObject(RBX, ic_data); |
| 62 __ LoadObject(R10, DartEntry::ArgumentsDescriptor(1, Array::Handle())); | 62 __ LoadObject(R10, DartEntry::ArgumentsDescriptor(1, Array::Handle())); |
| 63 ExternalLabel target_label( | 63 ExternalLabel target_label( |
| 64 "InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint()); | 64 "InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint()); |
| 65 __ call(&target_label); | 65 __ call(&target_label); |
| 66 __ ret(); | 66 __ ret(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 ASSEMBLER_TEST_RUN(IcDataAccess, entry) { | 70 ASSEMBLER_TEST_RUN(IcDataAccess, entry) { |
| 71 uword return_address = entry + CodePatcher::InstanceCallSizeInBytes(); | 71 uword return_address = entry + CodePatcher::InstanceCallSizeInBytes(); |
| 72 const ICData& ic_data = ICData::Handle( | 72 const ICData& ic_data = ICData::Handle( |
| 73 CodePatcher::GetInstanceCallIcDataAt(return_address)); | 73 CodePatcher::GetInstanceCallIcDataAt(return_address)); |
| 74 EXPECT_STREQ("targetFunction", | 74 EXPECT_STREQ("targetFunction", |
| 75 String::Handle(ic_data.target_name()).ToCString()); | 75 String::Handle(ic_data.target_name()).ToCString()); |
| 76 EXPECT_EQ(1, ic_data.num_args_tested()); | 76 EXPECT_EQ(1, ic_data.num_args_tested()); |
| 77 EXPECT_EQ(0, ic_data.NumberOfChecks()); | 77 EXPECT_EQ(0, ic_data.NumberOfChecks()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace dart | 80 } // namespace dart |
| 81 | 81 |
| 82 #endif // TARGET_ARCH_X64 | 82 #endif // TARGET_ARCH_X64 |
| OLD | NEW |