| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
| 6 | 6 |
| 7 #include "vm/assembler_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/code_patcher.h" | 8 #include "vm/code_patcher.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 if (class_ids[k] != Class::Handle(args[k]->clazz()).id()) { | 949 if (class_ids[k] != Class::Handle(args[k]->clazz()).id()) { |
| 950 matches = false; | 950 matches = false; |
| 951 break; | 951 break; |
| 952 } | 952 } |
| 953 } | 953 } |
| 954 // Do not add an entry twice! | 954 // Do not add an entry twice! |
| 955 ASSERT(!matches); | 955 ASSERT(!matches); |
| 956 } | 956 } |
| 957 #endif // DEBUG | 957 #endif // DEBUG |
| 958 | 958 |
| 959 GrowableArray<intptr_t> class_ids; | 959 if (args.length() == 1) { |
| 960 ASSERT(ic_data.num_args_tested() == args.length()); | 960 ic_data.AddReceiverCheck(Class::Handle(args[0]->clazz()).id(), |
| 961 for (intptr_t i = 0; i < args.length(); i++) { | 961 target_function); |
| 962 class_ids.Add(Class::Handle(args[i]->clazz()).id()); | 962 } else { |
| 963 GrowableArray<intptr_t> class_ids; |
| 964 ASSERT(ic_data.num_args_tested() == args.length()); |
| 965 for (intptr_t i = 0; i < args.length(); i++) { |
| 966 class_ids.Add(Class::Handle(args[i]->clazz()).id()); |
| 967 } |
| 968 ic_data.AddCheck(class_ids, target_function); |
| 963 } | 969 } |
| 964 ic_data.AddCheck(class_ids, target_function); | |
| 965 if (FLAG_trace_ic) { | 970 if (FLAG_trace_ic) { |
| 966 OS::Print("InlineCacheMissHandler %d call at 0x%x' " | 971 OS::Print("InlineCacheMissHandler %d call at 0x%x' " |
| 967 "adding <%s> id:%d -> <%s>\n", | 972 "adding <%s> id:%d -> <%s>\n", |
| 968 args.length(), | 973 args.length(), |
| 969 caller_frame->pc(), | 974 caller_frame->pc(), |
| 970 Class::Handle(receiver.clazz()).ToCString(), | 975 Class::Handle(receiver.clazz()).ToCString(), |
| 971 Class::Handle(receiver.clazz()).id(), | 976 Class::Handle(receiver.clazz()).id(), |
| 972 target_function.ToCString()); | 977 target_function.ToCString()); |
| 973 } | 978 } |
| 974 return target_function.raw(); | 979 return target_function.raw(); |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 // Adds a pointer to the store buffer. | 1593 // Adds a pointer to the store buffer. |
| 1589 // Arg0: the address of a field being stored into | 1594 // Arg0: the address of a field being stored into |
| 1590 DEFINE_LEAF_RUNTIME_ENTRY(StoreBuffer, 1) { | 1595 DEFINE_LEAF_RUNTIME_ENTRY(StoreBuffer, 1) { |
| 1591 ASSERT(args.Count() == kStoreBufferRuntimeEntry.argument_count()); | 1596 ASSERT(args.Count() == kStoreBufferRuntimeEntry.argument_count()); |
| 1592 uword ptr = reinterpret_cast<uword>(args.At(0)); | 1597 uword ptr = reinterpret_cast<uword>(args.At(0)); |
| 1593 isolate->store_buffer()->AddPointer(ptr); | 1598 isolate->store_buffer()->AddPointer(ptr); |
| 1594 return Smi::New(0); // Just an arbitrary RawObject* value. | 1599 return Smi::New(0); // Just an arbitrary RawObject* value. |
| 1595 } | 1600 } |
| 1596 | 1601 |
| 1597 } // namespace dart | 1602 } // namespace dart |
| OLD | NEW |