| Index: runtime/vm/flow_graph_compiler_shared.h
|
| ===================================================================
|
| --- runtime/vm/flow_graph_compiler_shared.h (revision 0)
|
| +++ runtime/vm/flow_graph_compiler_shared.h (revision 0)
|
| @@ -0,0 +1,68 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_
|
| +#define VM_FLOW_GRAPH_COMPILER_SHARED_H_
|
| +
|
| +#include "vm/allocation.h"
|
| +#include "vm/assembler.h"
|
| +#include "vm/code_descriptors.h"
|
| +#include "vm/growable_array.h"
|
| +
|
| +namespace dart {
|
| +
|
| +class BlockEntryInstr;
|
| +class ExceptionHandlerList;
|
| +class ParsedFunction;
|
| +
|
| +class FlowGraphCompilerShared : public ValueObject {
|
| + public:
|
| + explicit FlowGraphCompilerShared(const ParsedFunction& parsed_function,
|
| + intptr_t num_blocks);
|
| +
|
| + virtual ~FlowGraphCompilerShared();
|
| +
|
| + // Constructor is lighweight, major initialization work should occur here.
|
| + // This makes it easier to measure time spent in the compiler.
|
| + void InitCompiler();
|
| +
|
| + const ParsedFunction& parsed_function() const { return parsed_function_; }
|
| + DescriptorList* pc_descriptors_list() const {
|
| + return pc_descriptors_list_;
|
| + }
|
| +
|
| + // Returns assembler label associated with the given block entry.
|
| + Label* GetBlockLabel(BlockEntryInstr* block_entry) const;
|
| + void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset);
|
| +
|
| + void FinalizeExceptionHandlers(const Code& code);
|
| + void FinalizePcDescriptors(const Code& code);
|
| + void FinalizeStackmaps(const Code& code);
|
| + void FinalizeVarDescriptors(const Code& code);
|
| +
|
| + struct BlockInfo : public ZoneAllocated {
|
| + public:
|
| + BlockInfo() : label() { }
|
| +
|
| + Label label;
|
| + };
|
| +
|
| + const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
|
| +
|
| + private:
|
| + const ParsedFunction& parsed_function_;
|
| + ExceptionHandlerList* exception_handlers_list_;
|
| + DescriptorList* pc_descriptors_list_;
|
| + StackmapBuilder* stackmap_builder_;
|
| + const intptr_t num_blocks_;
|
| + GrowableArray<BlockInfo*> block_info_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared);
|
| +};
|
| +
|
| +
|
| +} // namespace dart
|
| +
|
| +
|
| +#endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_
|
|
|