| Index: src/lithium-codegen.h
|
| diff --git a/src/typing.h b/src/lithium-codegen.h
|
| similarity index 50%
|
| copy from src/typing.h
|
| copy to src/lithium-codegen.h
|
| index c942b0063278708d4c4828652ebd7d9365943717..8f2ccd5640011db478bc0b892c69e8c2ae863899 100644
|
| --- a/src/typing.h
|
| +++ b/src/lithium-codegen.h
|
| @@ -25,78 +25,72 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -#ifndef V8_TYPING_H_
|
| -#define V8_TYPING_H_
|
| +#ifndef V8_LITHIUM_CODEGEN_H_
|
| +#define V8_LITHIUM_CODEGEN_H_
|
|
|
| #include "v8.h"
|
|
|
| -#include "allocation.h"
|
| -#include "ast.h"
|
| #include "compiler.h"
|
| -#include "type-info.h"
|
| -#include "types.h"
|
| -#include "effects.h"
|
| -#include "zone.h"
|
| -#include "scopes.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
| +class LInstruction;
|
| +class LPlatformChunk;
|
|
|
| -class AstTyper: public AstVisitor {
|
| +class LCodeGenBase BASE_EMBEDDED {
|
| public:
|
| - static void Run(CompilationInfo* info);
|
| -
|
| - void* operator new(size_t size, Zone* zone) {
|
| - return zone->New(static_cast<int>(size));
|
| - }
|
| - void operator delete(void* pointer, Zone* zone) { }
|
| - void operator delete(void* pointer) { }
|
| -
|
| - DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
|
| -
|
| - private:
|
| - explicit AstTyper(CompilationInfo* info);
|
| -
|
| - static const int kNoVar = INT_MIN;
|
| - typedef v8::internal::Effects<int, kNoVar> Effects;
|
| - typedef v8::internal::NestedEffects<int, kNoVar> Store;
|
| -
|
| - CompilationInfo* info_;
|
| - TypeFeedbackOracle oracle_;
|
| - Store store_;
|
| -
|
| - TypeFeedbackOracle* oracle() { return &oracle_; }
|
| - Zone* zone() const { return info_->zone(); }
|
| -
|
| - void NarrowType(Expression* e, Bounds b) {
|
| - e->set_bounds(Bounds::Both(e->bounds(), b, isolate_));
|
| - }
|
| - void NarrowLowerType(Expression* e, Handle<Type> t) {
|
| - e->set_bounds(Bounds::NarrowLower(e->bounds(), t, isolate_));
|
| - }
|
| -
|
| - Effects EnterEffects() {
|
| - store_ = store_.Push();
|
| - return store_.Top();
|
| - }
|
| - void ExitEffects() { store_ = store_.Pop(); }
|
| -
|
| - int variable_index(Variable* var) {
|
| - return var->IsStackLocal() ? var->index() :
|
| - var->IsParameter() ? -var->index() : kNoVar;
|
| - }
|
| -
|
| - void VisitDeclarations(ZoneList<Declaration*>* declarations);
|
| - void VisitStatements(ZoneList<Statement*>* statements);
|
| -
|
| -#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
|
| - AST_NODE_LIST(DECLARE_VISIT)
|
| -#undef DECLARE_VISIT
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(AstTyper);
|
| + LCodeGenBase(LChunk* chunk,
|
| + MacroAssembler* assembler,
|
| + CompilationInfo* info);
|
| + virtual ~LCodeGenBase() {}
|
| +
|
| + // Simple accessors.
|
| + MacroAssembler* masm() const { return masm_; }
|
| + CompilationInfo* info() const { return info_; }
|
| + Isolate* isolate() const { return info_->isolate(); }
|
| + Factory* factory() const { return isolate()->factory(); }
|
| + Heap* heap() const { return isolate()->heap(); }
|
| + Zone* zone() const { return zone_; }
|
| + LPlatformChunk* chunk() const { return chunk_; }
|
| + HGraph* graph() const;
|
| +
|
| + void FPRINTF_CHECKING Comment(const char* format, ...);
|
| +
|
| + bool GenerateBody();
|
| + virtual void GenerateBodyInstructionPre(LInstruction* instr) {}
|
| + virtual void GenerateBodyInstructionPost(LInstruction* instr) {}
|
| +
|
| + virtual void EnsureSpaceForLazyDeopt(int space_needed) = 0;
|
| + virtual void RecordAndUpdatePosition(int position) = 0;
|
| +
|
| + int GetNextEmittedBlock() const;
|
| +
|
| + protected:
|
| + enum Status {
|
| + UNUSED,
|
| + GENERATING,
|
| + DONE,
|
| + ABORTED
|
| + };
|
| +
|
| + LPlatformChunk* const chunk_;
|
| + MacroAssembler* const masm_;
|
| + CompilationInfo* const info_;
|
| + Zone* zone_;
|
| + Status status_;
|
| + int current_block_;
|
| + int current_instruction_;
|
| + const ZoneList<LInstruction*>* instructions_;
|
| + int last_lazy_deopt_pc_;
|
| +
|
| + bool is_unused() const { return status_ == UNUSED; }
|
| + bool is_generating() const { return status_ == GENERATING; }
|
| + bool is_done() const { return status_ == DONE; }
|
| + bool is_aborted() const { return status_ == ABORTED; }
|
| };
|
|
|
| +
|
| } } // namespace v8::internal
|
|
|
| -#endif // V8_TYPING_H_
|
| +#endif // V8_LITHIUM_CODEGEN_H_
|
|
|