| Index: src/hydrogen.h
|
| ===================================================================
|
| --- src/hydrogen.h (revision 6800)
|
| +++ src/hydrogen.h (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2010 the V8 project authors. All rights reserved.
|
| +// Copyright 2011 the V8 project authors. All rights reserved.
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| // met:
|
| @@ -60,6 +60,8 @@
|
| HGraph* graph() const { return graph_; }
|
| const ZoneList<HPhi*>* phis() const { return &phis_; }
|
| HInstruction* first() const { return first_; }
|
| + HInstruction* last() const { return last_; }
|
| + void set_last(HInstruction* instr) { last_ = instr; }
|
| HInstruction* GetLastInstruction();
|
| HControlInstruction* end() const { return end_; }
|
| HLoopInformation* loop_information() const { return loop_information_; }
|
| @@ -103,16 +105,14 @@
|
| void ClearEnvironment() { last_environment_ = NULL; }
|
| bool HasEnvironment() const { return last_environment_ != NULL; }
|
| void UpdateEnvironment(HEnvironment* env) { last_environment_ = env; }
|
| - HBasicBlock* parent_loop_header() const {
|
| - if (!HasParentLoopHeader()) return NULL;
|
| - return parent_loop_header_.get();
|
| - }
|
| + HBasicBlock* parent_loop_header() const { return parent_loop_header_; }
|
|
|
| void set_parent_loop_header(HBasicBlock* block) {
|
| - parent_loop_header_.set(block);
|
| + ASSERT(parent_loop_header_ == NULL);
|
| + parent_loop_header_ = block;
|
| }
|
|
|
| - bool HasParentLoopHeader() const { return parent_loop_header_.is_set(); }
|
| + bool HasParentLoopHeader() const { return parent_loop_header_ != NULL; }
|
|
|
| void SetJoinId(int id);
|
|
|
| @@ -136,9 +136,6 @@
|
| bool IsInlineReturnTarget() const { return is_inline_return_target_; }
|
| void MarkAsInlineReturnTarget() { is_inline_return_target_ = true; }
|
|
|
| - Handle<Object> cond() { return cond_; }
|
| - void set_cond(Handle<Object> value) { cond_ = value; }
|
| -
|
| #ifdef DEBUG
|
| void Verify();
|
| #endif
|
| @@ -153,7 +150,7 @@
|
| HGraph* graph_;
|
| ZoneList<HPhi*> phis_;
|
| HInstruction* first_;
|
| - HInstruction* last_; // Last non-control instruction of the block.
|
| + HInstruction* last_;
|
| HControlInstruction* end_;
|
| HLoopInformation* loop_information_;
|
| ZoneList<HBasicBlock*> predecessors_;
|
| @@ -166,9 +163,8 @@
|
| int first_instruction_index_;
|
| int last_instruction_index_;
|
| ZoneList<int> deleted_phis_;
|
| - SetOncePointer<HBasicBlock> parent_loop_header_;
|
| + HBasicBlock* parent_loop_header_;
|
| bool is_inline_return_target_;
|
| - Handle<Object> cond_;
|
| };
|
|
|
|
|
| @@ -296,6 +292,9 @@
|
| explicit HGraph(CompilationInfo* info);
|
|
|
| CompilationInfo* info() const { return info_; }
|
| +
|
| + bool AllowCodeMotion() const;
|
| +
|
| const ZoneList<HBasicBlock*>* blocks() const { return &blocks_; }
|
| const ZoneList<HPhi*>* phi_list() const { return phi_list_; }
|
| Handle<String> debug_name() const { return info_->function()->debug_name(); }
|
| @@ -304,6 +303,7 @@
|
| void InitializeInferredTypes();
|
| void InsertTypeConversions();
|
| void InsertRepresentationChanges();
|
| + void ComputeMinusZeroChecks();
|
| bool ProcessArgumentsObject();
|
| void EliminateRedundantPhis();
|
| void Canonicalize();
|
| @@ -702,19 +702,17 @@
|
| HBasicBlock* true_block,
|
| HBasicBlock* false_block);
|
|
|
| - // Visit an argument and wrap it in a PushArgument instruction.
|
| - HValue* VisitArgument(Expression* expr);
|
| + // Visit an argument subexpression.
|
| + void VisitArgument(Expression* expr);
|
| void VisitArgumentList(ZoneList<Expression*>* arguments);
|
|
|
| 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 PreProcessCall(HCall* call);
|
|
|
| void AssumeRepresentation(HValue* value, Representation r);
|
| static Representation ToRepresentation(TypeInfo info);
|
| @@ -745,7 +743,10 @@
|
| bool TryArgumentsAccess(Property* expr);
|
| bool TryCallApply(Call* expr);
|
| bool TryInline(Call* expr);
|
| - bool TryMathFunctionInline(Call* expr);
|
| + bool TryInlineBuiltinFunction(Call* expr,
|
| + HValue* receiver,
|
| + Handle<Map> receiver_map,
|
| + CheckType check_type);
|
| void TraceInline(Handle<JSFunction> target, bool result);
|
|
|
| void HandleGlobalVariableAssignment(Variable* var,
|
| @@ -769,6 +770,8 @@
|
| ZoneMapList* types,
|
| Handle<String> name);
|
|
|
| + HStringCharCodeAt* BuildStringCharCodeAt(HValue* string,
|
| + HValue* index);
|
| HInstruction* BuildBinaryOperation(BinaryOperation* expr,
|
| HValue* left,
|
| HValue* right);
|
| @@ -782,6 +785,9 @@
|
| HInstruction* BuildLoadKeyedFastElement(HValue* object,
|
| HValue* key,
|
| Property* expr);
|
| + HInstruction* BuildLoadKeyedPixelArrayElement(HValue* object,
|
| + HValue* key,
|
| + Property* expr);
|
| HInstruction* BuildLoadKeyedGeneric(HValue* object,
|
| HValue* key);
|
|
|
| @@ -814,15 +820,18 @@
|
| HValue* switch_value,
|
| CaseClause* clause);
|
|
|
| + HValue* BuildContextChainWalk(Variable* var);
|
| +
|
| void AddCheckConstantFunction(Call* expr,
|
| HValue* receiver,
|
| Handle<Map> receiver_map,
|
| bool smi_and_map_check);
|
|
|
|
|
| - HBasicBlock* BuildTypeSwitch(ZoneMapList* maps,
|
| - ZoneList<HSubgraph*>* subgraphs,
|
| - HValue* receiver,
|
| + HBasicBlock* BuildTypeSwitch(HValue* receiver,
|
| + ZoneMapList* maps,
|
| + ZoneList<HSubgraph*>* body_graphs,
|
| + HSubgraph* default_graph,
|
| int join_id);
|
|
|
| TypeFeedbackOracle* oracle_;
|
| @@ -906,7 +915,7 @@
|
| class HStatistics: public Malloced {
|
| public:
|
| void Print();
|
| - void SaveTiming(const char* name, int64_t ticks);
|
| + void SaveTiming(const char* name, int64_t ticks, unsigned size);
|
| static HStatistics* Instance() {
|
| static SetOncePointer<HStatistics> instance;
|
| if (!instance.is_set()) {
|
| @@ -917,11 +926,19 @@
|
|
|
| private:
|
|
|
| - HStatistics() : timing_(5), names_(5), total_(0), full_code_gen_(0) { }
|
| + HStatistics()
|
| + : timing_(5),
|
| + names_(5),
|
| + sizes_(5),
|
| + total_(0),
|
| + total_size_(0),
|
| + full_code_gen_(0) { }
|
|
|
| List<int64_t> timing_;
|
| List<const char*> names_;
|
| + List<unsigned> sizes_;
|
| int64_t total_;
|
| + unsigned total_size_;
|
| int64_t full_code_gen_;
|
| };
|
|
|
| @@ -958,6 +975,7 @@
|
| HGraph* graph_;
|
| LChunk* chunk_;
|
| LAllocator* allocator_;
|
| + unsigned start_allocation_size_;
|
| };
|
|
|
|
|
|
|