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

Unified Diff: runtime/vm/object.cc

Issue 1255063005: Constructor tear-off closures (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Skip tearoff test in analyzer and dart2js Created 5 years, 4 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index a32e04a22b474d74e1dc322555b9821675ae5786..138f2442735ef56cfe036386c3c8c36946d02edd 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6196,6 +6196,12 @@ bool Function::IsImplicitStaticClosureFunction(RawFunction* func) {
}
+bool Function::IsConstructorClosureFunction() const {
+ return IsClosureFunction() &&
+ String::Handle(name()).StartsWith(Symbols::ConstructorClosurePrefix());
+}
+
+
RawFunction* Function::New() {
ASSERT(Object::function_class() != Class::null());
RawObject* raw = Object::Allocate(Function::kClassId,
@@ -6503,8 +6509,8 @@ RawInstance* Function::ImplicitStaticClosure() const {
if (implicit_static_closure() == Instance::null()) {
Isolate* isolate = Isolate::Current();
ObjectStore* object_store = isolate->object_store();
- const Context& context = Context::Handle(isolate,
- object_store->empty_context());
+ const Context& context =
+ Context::Handle(isolate, object_store->empty_context());
Instance& closure =
Instance::Handle(isolate, Closure::New(*this, context, Heap::kOld));
const char* error_str = NULL;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698