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

Unified Diff: runtime/vm/resolver.cc

Issue 1709273003: Make function lookup in classes thread-safe: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: d Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/resolver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/resolver.cc
diff --git a/runtime/vm/resolver.cc b/runtime/vm/resolver.cc
index 23e387381c4c83f591db27409ebfebfd221bddde..a1c7b1ad832c5a2c8c35310239b178a3d744ed6a 100644
--- a/runtime/vm/resolver.cc
+++ b/runtime/vm/resolver.cc
@@ -35,10 +35,11 @@ RawFunction* Resolver::ResolveDynamic(const Instance& receiver,
RawFunction* Resolver::ResolveDynamicForReceiverClass(
const Class& receiver_class,
const String& function_name,
- const ArgumentsDescriptor& args_desc) {
+ const ArgumentsDescriptor& args_desc,
+ bool allow_add) {
- Function& function =
- Function::Handle(ResolveDynamicAnyArgs(receiver_class, function_name));
+ Function& function = Function::Handle(
+ ResolveDynamicAnyArgs(receiver_class, function_name, allow_add));
if (function.IsNull() ||
!function.AreValidArguments(args_desc, NULL)) {
@@ -63,7 +64,8 @@ RawFunction* Resolver::ResolveDynamicForReceiverClass(
RawFunction* Resolver::ResolveDynamicAnyArgs(
const Class& receiver_class,
- const String& function_name) {
+ const String& function_name,
+ bool allow_add) {
Class& cls = Class::Handle(receiver_class.raw());
if (FLAG_trace_resolving) {
THR_Print("ResolveDynamic '%s' for class %s\n",
@@ -126,7 +128,7 @@ RawFunction* Resolver::ResolveDynamicAnyArgs(
if (FLAG_lazy_dispatchers) {
if (is_getter && function.IsNull()) {
function ^= cls.LookupDynamicFunction(field_name);
- if (!function.IsNull()) {
+ if (!function.IsNull() && allow_add) {
// We were looking for the getter but found a method with the same
// name. Create a method extractor and return it.
// The extractor does not exist yet, so using GetMethodExtractor is
« no previous file with comments | « runtime/vm/resolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698