| Index: src/allocation-site-scopes.h
|
| diff --git a/src/hydrogen-osr.h b/src/allocation-site-scopes.h
|
| similarity index 56%
|
| copy from src/hydrogen-osr.h
|
| copy to src/allocation-site-scopes.h
|
| index ae72ce650c59d198056c5b13db48c258f90109f4..7158317dc967a90bde1b2de5528291ce07c87d17 100644
|
| --- a/src/hydrogen-osr.h
|
| +++ b/src/allocation-site-scopes.h
|
| @@ -25,53 +25,60 @@
|
| // (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_HYDROGEN_OSR_H_
|
| -#define V8_HYDROGEN_OSR_H_
|
| +#ifndef V8_ALLOCATION_SITE_SCOPES_H_
|
| +#define V8_ALLOCATION_SITE_SCOPES_H_
|
|
|
| -#include "hydrogen.h"
|
| #include "ast.h"
|
| #include "zone.h"
|
| +#include "objects.h"
|
| +#include "handles.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
| -// Responsible for building graph parts related to OSR and otherwise
|
| -// setting up the graph to do an OSR compile.
|
| -class HOsrBuilder : public ZoneObject {
|
| +
|
| +class AllocationSiteContext {
|
| public:
|
| - explicit HOsrBuilder(HOptimizedGraphBuilder* builder)
|
| - : unoptimized_frame_slots_(0),
|
| - builder_(builder),
|
| - osr_entry_(NULL),
|
| - osr_loop_entry_(NULL),
|
| - osr_values_(NULL) { }
|
| + AllocationSiteContext(Isolate* isolate, bool activated) {
|
| + isolate_ = isolate;
|
| + activated_ = activated;
|
| + };
|
| + Handle<AllocationSite> top() { return top_; }
|
| + Handle<AllocationSite> current() { return current_; }
|
| + // If activated, then recursively create sites/mementos
|
| + bool activated() const { return activated_; }
|
|
|
| - // Creates the loop entry block for the given statement, setting up OSR
|
| - // entries as necessary, and sets the current block to the new block.
|
| - HBasicBlock* BuildOsrLoopEntry(IterationStatement* statement);
|
| + private:
|
| + friend class AllocationSiteCreationScope;
|
| + friend class AllocationSiteUsageScope;
|
|
|
| - // Process the hydrogen graph after it has been completed, performing
|
| - // any OSR-specific cleanups or changes.
|
| - void FinishGraph();
|
| + Isolate* isolate_;
|
| + Handle<AllocationSite> top_;
|
| + Handle<AllocationSite> current_;
|
| + bool activated_;
|
| +};
|
|
|
| - // Process the OSR values and phis after initial graph optimization.
|
| - void FinishOsrValues();
|
|
|
| - // Return the number of slots in the unoptimized frame at the entry to OSR.
|
| - int UnoptimizedFrameSlots() const {
|
| - return unoptimized_frame_slots_;
|
| - }
|
| +class AllocationSiteCreationScope {
|
| + public:
|
| + explicit AllocationSiteCreationScope(AllocationSiteContext* context);
|
| + Handle<Object> RecordTransitionInfo(Handle<Object> transition_info);
|
| + private:
|
| + AllocationSiteContext* site_context_;
|
| + Handle<AllocationSite> current_;
|
| +};
|
|
|
| - bool HasOsrEntryAt(IterationStatement* statement);
|
|
|
| - private:
|
| - int unoptimized_frame_slots_;
|
| - HOptimizedGraphBuilder* builder_;
|
| - HBasicBlock* osr_entry_;
|
| - HBasicBlock* osr_loop_entry_;
|
| - ZoneList<HUnknownOSRValue*>* osr_values_;
|
| +class AllocationSiteUsageScope {
|
| + public:
|
| + AllocationSiteUsageScope(AllocationSiteContext* context,
|
| + Handle<Object> expected_transition_info);
|
| + AllocationSiteUsageScope(AllocationSiteContext* context,
|
| + Handle<AllocationSite> top,
|
| + Handle<Object> expected_transition_info);
|
| };
|
|
|
| +
|
| } } // namespace v8::internal
|
|
|
| -#endif // V8_HYDROGEN_OSR_H_
|
| +#endif // V8_ALLOCATION_SITE_SCOPES_H_
|
|
|