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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2793033005: Keep types in signatures of function types properly instantiated as the function (Closed)
Patch Set: added comment and sync Created 3 years, 8 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 public: 117 public:
118 explicit CheckFunctionTypesVisitor(Thread* thread) 118 explicit CheckFunctionTypesVisitor(Thread* thread)
119 : classHandle_(Class::Handle(thread->zone())), 119 : classHandle_(Class::Handle(thread->zone())),
120 funcHandle_(Function::Handle(thread->zone())), 120 funcHandle_(Function::Handle(thread->zone())),
121 typeHandle_(AbstractType::Handle(thread->zone())) {} 121 typeHandle_(AbstractType::Handle(thread->zone())) {}
122 122
123 void VisitObject(RawObject* obj) { 123 void VisitObject(RawObject* obj) {
124 if (obj->IsFunction()) { 124 if (obj->IsFunction()) {
125 funcHandle_ ^= obj; 125 funcHandle_ ^= obj;
126 classHandle_ ^= funcHandle_.Owner(); 126 classHandle_ ^= funcHandle_.Owner();
127 // Signature functions get created, but not canonicalized, when function
128 // types get instantiated during run time type tests.
129 if (funcHandle_.IsSignatureFunction()) {
130 return;
131 }
127 // Verify that the result type of a function is canonical or a 132 // Verify that the result type of a function is canonical or a
128 // TypeParameter. 133 // TypeParameter.
129 typeHandle_ ^= funcHandle_.result_type(); 134 typeHandle_ ^= funcHandle_.result_type();
130 ASSERT(typeHandle_.IsMalformed() || !typeHandle_.IsResolved() || 135 ASSERT(typeHandle_.IsMalformed() || !typeHandle_.IsResolved() ||
131 typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical()); 136 typeHandle_.IsTypeParameter() || typeHandle_.IsCanonical());
132 // Verify that the types in the function signature are all canonical or 137 // Verify that the types in the function signature are all canonical or
133 // a TypeParameter. 138 // a TypeParameter.
134 const intptr_t num_parameters = funcHandle_.NumParameters(); 139 const intptr_t num_parameters = funcHandle_.NumParameters();
135 for (intptr_t i = 0; i < num_parameters; i++) { 140 for (intptr_t i = 0; i < num_parameters; i++) {
136 typeHandle_ = funcHandle_.ParameterTypeAt(i); 141 typeHandle_ = funcHandle_.ParameterTypeAt(i);
(...skipping 6695 matching lines...) Expand 10 before | Expand all | Expand 10 after
6832 } 6837 }
6833 6838
6834 6839
6835 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6840 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6836 #ifndef PRODUCT 6841 #ifndef PRODUCT
6837 Profiler::DumpStackTrace(context); 6842 Profiler::DumpStackTrace(context);
6838 #endif 6843 #endif
6839 } 6844 }
6840 6845
6841 } // namespace dart 6846 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698