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

Unified Diff: runtime/vm/object.cc

Issue 135913003: Optimize getField by caching a closure generated from a specialized function kind. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6158a02500f739b5527248a257a37994bdacf38a..b7139ab91bb38fa949bc45382c1993dd59a347fa 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -4743,6 +4743,12 @@ const char* Function::KindToCString(RawFunction::Kind kind) {
case RawFunction::kInvokeFieldDispatcher:
return "kInvokeFieldDispatcher";
break;
+ case RawFunction::kGetFieldClosure:
+ return "kGetFieldClosure";
+ break;
+ case RawFunction::kSetFieldClosure:
+ return "kSetFieldClosure";
+ break;
default:
UNREACHABLE();
return NULL;
@@ -5035,6 +5041,8 @@ intptr_t Function::NumImplicitParameters() const {
}
}
if ((kind() == RawFunction::kClosureFunction) ||
+ (kind() == RawFunction::kGetFieldClosure) ||
+ (kind() == RawFunction::kSetFieldClosure) ||
(kind() == RawFunction::kSignatureFunction)) {
return 1; // Closure object.
}
@@ -5043,6 +5051,8 @@ intptr_t Function::NumImplicitParameters() const {
// marked as non-static, but they do not have a receiver.
// Closures are handled above.
ASSERT((kind() != RawFunction::kClosureFunction) &&
+ (kind() != RawFunction::kGetFieldClosure) &&
+ (kind() != RawFunction::kSetFieldClosure) &&
(kind() != RawFunction::kSignatureFunction));
return 1; // Receiver.
}
@@ -5505,7 +5515,9 @@ RawFunction* Function::New(const String& name,
result.set_optimized_call_site_count(0);
result.set_is_optimizable(is_native ? false : true);
result.set_is_inlinable(true);
- if (kind == RawFunction::kClosureFunction) {
+ if ((kind == RawFunction::kClosureFunction) ||
+ (kind == RawFunction::kGetFieldClosure) ||
+ (kind == RawFunction::kSetFieldClosure) ) {
const ClosureData& data = ClosureData::Handle(ClosureData::New());
result.set_data(data);
}
@@ -5988,6 +6000,12 @@ const char* Function::ToCString() const {
case RawFunction::kInvokeFieldDispatcher:
kind_str = "invoke-field-dispatcher";
break;
+ case RawFunction::kGetFieldClosure:
+ kind_str = "get-field-closure";
+ break;
+ case RawFunction::kSetFieldClosure:
+ kind_str = "set-field-closure";
+ break;
default:
UNREACHABLE();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698