Reviewers: Sven Panne,
Description:
Remove kDontInline and simplify compiler hints.
[email protected]
Please review this at https://codereview.chromium.org/359733004/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+8, -24 lines):
M src/ast.h
M src/ast.cc
M src/compiler.cc
M src/hydrogen.cc
M src/objects.h
M src/objects-inl.h
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index
edea0f5f7e342457164cde6f43a304275f478a35..9cce1da71df71fa3c11854a9a15a4a4f87593fa8
100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -1028,7 +1028,6 @@ CaseClause::CaseClause(Zone* zone,
void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
increase_node_count(); \
set_dont_optimize_reason(k##NodeType); \
- add_flag(kDontInline); \
add_flag(kDontSelfOptimize); \
}
#define DONT_SELFOPTIMIZE_NODE(NodeType) \
@@ -1046,7 +1045,6 @@ CaseClause::CaseClause(Zone* zone,
void AstConstructionVisitor::Visit##NodeType(NodeType* node) { \
increase_node_count(); \
set_dont_optimize_reason(k##NodeType); \
- add_flag(kDontInline); \
add_flag(kDontSelfOptimize); \
add_flag(kDontCache); \
}
@@ -1079,7 +1077,8 @@ REGULAR_NODE(ThisFunction)
REGULAR_NODE_WITH_FEEDBACK_SLOTS(Call)
REGULAR_NODE_WITH_FEEDBACK_SLOTS(CallNew)
// In theory, for VariableProxy we'd have to add:
-// if (node->var()->IsLookupSlot()) add_flag(kDontInline);
+// if (node->var()->IsLookupSlot())
+//
set_dont_optimize_reason(kReferenceToAVariableWhichRequiresDynamicLookup);
// But node->var() is usually not bound yet at VariableProxy creation
time, and
// LOOKUP variables only result from constructs that cannot be inlined
anyway.
REGULAR_NODE(VariableProxy)
@@ -1111,9 +1110,8 @@ DONT_CACHE_NODE(ModuleLiteral)
void AstConstructionVisitor::VisitCallRuntime(CallRuntime* node) {
increase_node_count();
if (node->is_jsruntime()) {
- // Don't try to inline JS runtime calls because we don't (currently)
even
- // optimize them.
- add_flag(kDontInline);
+ // Don't try to optimize JS runtime calls because we bailout on them.
+ set_dont_optimize_reason(kCallToAJavaScriptRuntimeFunction);
}
}
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index
1396bf4aaabfa28dec0d90bacbcdd7b533e2147f..aecee37b602f922f8629e21dd5cbeb2d9837b608
100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -149,7 +149,6 @@ typedef ZoneList<Handle<Object> > ZoneObjectList;
enum AstPropertiesFlag {
- kDontInline,
kDontSelfOptimize,
kDontSoftInline,
kDontCache
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index
9ae887edb8b871511262737e5eb9f82a9ba50764..7df2fdf1043ec7d3fcb1fa4b7e9353f39d596995
100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -579,8 +579,7 @@ static void UpdateSharedFunctionInfo(CompilationInfo*
info) {
// Check the function has compiled code.
ASSERT(shared->is_compiled());
- shared->set_dont_optimize_reason(lit->dont_optimize_reason());
- shared->set_dont_inline(lit->flags()->Contains(kDontInline));
+ shared->set_bailout_reason(lit->dont_optimize_reason());
shared->set_ast_node_count(lit->ast_node_count());
shared->set_strict_mode(lit->strict_mode());
}
@@ -612,8 +611,7 @@ static void SetFunctionInfo(Handle<SharedFunctionInfo>
function_info,
function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
function_info->set_ast_node_count(lit->ast_node_count());
function_info->set_is_function(lit->is_function());
- function_info->set_dont_optimize_reason(lit->dont_optimize_reason());
- function_info->set_dont_inline(lit->flags()->Contains(kDontInline));
+ function_info->set_bailout_reason(lit->dont_optimize_reason());
function_info->set_dont_cache(lit->flags()->Contains(kDontCache));
function_info->set_is_generator(lit->is_generator());
}
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
89f61decba5c833f9bafc5e94a829fc3b2216ee1..8ca2ee619458a980b5765ff4448ee1da39da11f8
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -7566,7 +7566,7 @@ int
HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) {
TraceInline(target, caller, "target not inlineable");
return kNotInlinable;
}
- if (target_shared->dont_inline()) {
+ if (target_shared->DisableOptimizationReason() != kNoReason) {
TraceInline(target, caller, "target contains unsupported syntax
[early]");
return kNotInlinable;
}
@@ -7653,8 +7653,7 @@ bool
HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
TraceInline(target, caller, "target AST is too large [late]");
return false;
}
- AstProperties::Flags* flags(function->flags());
- if (flags->Contains(kDontInline) || function->dont_optimize()) {
+ if (function->dont_optimize()) {
TraceInline(target, caller, "target contains unsupported syntax
[late]");
return false;
}
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index
812bc184b1d0fc013754c53f96616a455602e464..16d0acd6e3caf045cb3bc470b71f7b3b841b18fa
100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5447,7 +5447,6 @@ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous,
kIsAnonymous)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function,
kIsFunction)
-BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_inline,
kDontInline)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator,
kIsGenerator)
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
50499db3edb064e34c9499ea6d45944becd8d2fb..a494778a989c3c3963f8ba288b18ec5fa5359b58
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7223,9 +7223,6 @@ class SharedFunctionInfo: public HeapObject {
// Is this a function or top-level/eval code.
DECL_BOOLEAN_ACCESSORS(is_function)
- // Indicates that the function cannot be inlined.
- DECL_BOOLEAN_ACCESSORS(dont_inline)
-
// Indicates that code for this function cannot be cached.
DECL_BOOLEAN_ACCESSORS(dont_cache)
@@ -7287,11 +7284,6 @@ class SharedFunctionInfo: public HeapObject {
reason));
}
- void set_dont_optimize_reason(BailoutReason reason) {
- set_bailout_reason(reason);
- set_dont_inline(reason != kNoReason);
- }
-
// Check whether or not this function is inlineable.
bool IsInlineable();
@@ -7434,7 +7426,6 @@ class SharedFunctionInfo: public HeapObject {
kIsAnonymous,
kNameShouldPrintAsAnonymous,
kIsFunction,
- kDontInline,
kDontCache,
kDontFlush,
kIsGenerator,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.