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

Unified Diff: src/hydrogen.cc

Issue 10828066: Inline simple getter calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deactivate accessor inlining by default. Created 8 years, 5 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: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index f61485040a9a5e5f27dd07da33958cf9f1112f24..697956b56b35925539debeb6430809364340e7be 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6352,7 +6352,12 @@ void HGraphBuilder::VisitProperty(Property* expr) {
Handle<AccessorPair> accessors;
Handle<JSObject> holder;
if (LookupAccessorPair(map, name, &accessors, &holder)) {
- instr = BuildCallGetter(Pop(), map, accessors, holder);
+ AddCheckConstantFunction(holder, Top(), map, true);
+ Handle<JSFunction> getter(JSFunction::cast(accessors->getter()));
+ if (FLAG_inline_accessors &&
+ TryInlineGetter(getter, expr->id(), expr->ReturnId())) return;
+ AddInstruction(new(zone()) HPushArgument(Pop()));
+ instr = new(zone()) HCallConstantFunction(getter, 1);
} else {
instr = BuildLoadNamedMonomorphic(Pop(), name, expr, map);
}
@@ -6920,6 +6925,19 @@ bool HGraphBuilder::TryInlineConstruct(CallNew* expr, HValue* receiver) {
}
+bool HGraphBuilder::TryInlineGetter(Handle<JSFunction> getter,
Michael Starzinger 2012/07/30 09:38:43 It might be better to pass the "Property* expr" as
Sven Panne 2012/07/30 10:41:55 Done.
+ int ast_id,
+ int return_id) {
+ return TryInline(CALL_AS_METHOD,
+ getter,
+ 0,
+ NULL,
+ ast_id,
+ return_id,
+ NORMAL_RETURN);
+}
+
+
bool HGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, bool drop_extra) {
if (!expr->target()->shared()->HasBuiltinFunctionId()) return false;
BuiltinFunctionId id = expr->target()->shared()->builtin_function_id();
« src/flag-definitions.h ('K') | « src/hydrogen.h ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698