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

Unified Diff: src/hydrogen.h

Issue 5964005: Shorten live ranges of argument subexpressions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index 2c9aeac75c2798ade5549075ace1179f4fe12977..4e93f8e6fa43bf64edf4d14877f9e7a823cb127b 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -153,7 +153,10 @@ class HBasicBlock: public ZoneObject {
HGraph* graph_;
ZoneList<HPhi*> phis_;
HInstruction* first_;
- HInstruction* last_; // Last non-control instruction of the block.
+
+ // A cached instruction that is in this block unless it's been deleted.
+ HInstruction* cached_;
+
HControlInstruction* end_;
HLoopInformation* loop_information_;
ZoneList<HBasicBlock*> predecessors_;
@@ -442,12 +445,6 @@ class HEnvironment: public ZoneObject {
return values_[index];
}
- void SetExpressionStackAt(int index_from_top, HValue* value) {
- int index = values_.length() - index_from_top - 1;
- ASSERT(IsExpressionStackIndex(index));
- values_[index] = value;
- }
-
HValue* Pop() {
ASSERT(!IsExpressionStackEmpty());
if (push_count_ > 0) {
@@ -493,7 +490,8 @@ class HEnvironment: public ZoneObject {
HEnvironment* CopyForInlining(Handle<JSFunction> target,
FunctionLiteral* function,
bool is_speculative,
- HConstant* undefined) const;
+ HConstant* undefined,
+ HGlobalReceiver* receiver) const;
void AddIncomingEdge(HBasicBlock* block, HEnvironment* other);
void ClearHistory() {
@@ -663,8 +661,7 @@ class HGraphBuilder: public AstVisitor {
private:
// Type of a member function that generates inline code for a native function.
- typedef void (HGraphBuilder::*InlineFunctionGenerator)(int argument_count,
- int ast_id);
+ typedef void (HGraphBuilder::*InlineFunctionGenerator)(CallRuntime* call);
// Forward declarations for inner scope classes.
class SubgraphScope;
@@ -688,7 +685,7 @@ class HGraphBuilder: public AstVisitor {
// Generators for inline runtime functions.
#define INLINE_FUNCTION_GENERATOR_DECLARATION(Name, argc, ressize) \
- void Generate##Name(int argument_count, int ast_id);
+ void Generate##Name(CallRuntime* call);
INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION)
INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_DECLARATION)
@@ -716,19 +713,18 @@ class HGraphBuilder: public AstVisitor {
HBasicBlock* false_block);
// Visit an argument and wrap it in a PushArgument instruction.
- HValue* VisitArgument(Expression* expr);
+ void VisitArgument(Expression* expr);
void VisitArgumentList(ZoneList<Expression*>* arguments);
+ // The top 'count' elements of the environment are assumed to be
+ // PushArgument instructions. Delete their definitions in the graph
+ // and replace all their uses with their argument values.
+ void ReplaceAndDeleteArguments(HEnvironment* env, int count);
+
void AddPhi(HPhi* phi);
void PushAndAdd(HInstruction* instr);
- void PushArgumentsForStubCall(int argument_count);
-
- // Remove the arguments from the bailout environment and emit instructions
- // to push them as outgoing parameters.
- void ProcessCall(HCall* call);
-
void AssumeRepresentation(HValue* value, Representation r);
static Representation ToRepresentation(TypeInfo info);
@@ -748,7 +744,8 @@ class HGraphBuilder: public AstVisitor {
HSubgraph* CreateLoopHeaderSubgraph(HEnvironment* env);
HSubgraph* CreateInlinedSubgraph(HEnvironment* outer,
Handle<JSFunction> target,
- FunctionLiteral* function);
+ FunctionLiteral* function,
+ HGlobalReceiver* receiver);
// Helpers for flow graph construction.
void LookupGlobalPropertyCell(Variable* var,
@@ -757,7 +754,9 @@ class HGraphBuilder: public AstVisitor {
bool TryArgumentsAccess(Property* expr);
bool TryCallApply(Call* expr);
- bool TryInline(Call* expr);
+
+ bool TryInline(Call* expr, bool is_known_global);
+
bool TryMathFunctionInline(Call* expr);
void TraceInline(Handle<JSFunction> target, bool result);
@@ -834,7 +833,8 @@ class HGraphBuilder: public AstVisitor {
HBasicBlock* BuildTypeSwitch(ZoneMapList* maps,
- ZoneList<HSubgraph*>* subgraphs,
+ ZoneList<HSubgraph*>* body_graphs,
+ HSubgraph* default_graph,
HValue* receiver,
int join_id);
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698