diff options
Diffstat (limited to 'deps/v8/src/lithium.h')
-rw-r--r-- | deps/v8/src/lithium.h | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/deps/v8/src/lithium.h b/deps/v8/src/lithium.h index 8ae5b879d..650bae692 100644 --- a/deps/v8/src/lithium.h +++ b/deps/v8/src/lithium.h @@ -1,36 +1,16 @@ // Copyright 2012 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: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #ifndef V8_LITHIUM_H_ #define V8_LITHIUM_H_ +#include <set> + #include "allocation.h" #include "hydrogen.h" #include "safepoint-table.h" +#include "zone-allocator.h" namespace v8 { namespace internal { @@ -101,6 +81,7 @@ class LUnallocated : public LOperand { FIXED_REGISTER, FIXED_DOUBLE_REGISTER, MUST_HAVE_REGISTER, + MUST_HAVE_DOUBLE_REGISTER, WRITABLE_REGISTER, SAME_AS_FIRST_INPUT }; @@ -210,6 +191,10 @@ class LUnallocated : public LOperand { extended_policy() == WRITABLE_REGISTER || extended_policy() == MUST_HAVE_REGISTER); } + bool HasDoubleRegisterPolicy() const { + return basic_policy() == EXTENDED_POLICY && + extended_policy() == MUST_HAVE_DOUBLE_REGISTER; + } bool HasSameAsInputPolicy() const { return basic_policy() == EXTENDED_POLICY && extended_policy() == SAME_AS_FIRST_INPUT; @@ -426,7 +411,8 @@ class LEnvironment V8_FINAL : public ZoneObject { object_mapping_(0, zone), outer_(outer), entry_(entry), - zone_(zone) { } + zone_(zone), + has_been_used_(false) { } Handle<JSFunction> closure() const { return closure_; } FrameType frame_type() const { return frame_type_; } @@ -442,6 +428,9 @@ class LEnvironment V8_FINAL : public ZoneObject { HEnterInlined* entry() { return entry_; } Zone* zone() const { return zone_; } + bool has_been_used() const { return has_been_used_; } + void set_has_been_used() { has_been_used_ = true; } + void AddValue(LOperand* operand, Representation representation, bool is_uint32) { @@ -541,6 +530,7 @@ class LEnvironment V8_FINAL : public ZoneObject { LEnvironment* outer_; HEnterInlined* entry_; Zone* zone_; + bool has_been_used_; }; @@ -660,6 +650,20 @@ class LChunk : public ZoneObject { inlined_closures_.Add(closure, zone()); } + void AddDeprecationDependency(Handle<Map> map) { + ASSERT(!map->is_deprecated()); + if (!map->CanBeDeprecated()) return; + ASSERT(!info_->IsStub()); + deprecation_dependencies_.insert(map); + } + + void AddStabilityDependency(Handle<Map> map) { + ASSERT(map->is_stable()); + if (!map->CanTransition()) return; + ASSERT(!info_->IsStub()); + stability_dependencies_.insert(map); + } + Zone* zone() const { return info_->zone(); } Handle<Code> Codegen(); @@ -675,12 +679,20 @@ class LChunk : public ZoneObject { int spill_slot_count_; private: + typedef std::less<Handle<Map> > MapLess; + typedef zone_allocator<Handle<Map> > MapAllocator; + typedef std::set<Handle<Map>, MapLess, MapAllocator> MapSet; + + void CommitDependencies(Handle<Code> code) const; + CompilationInfo* info_; HGraph* const graph_; BitVector* allocated_double_registers_; ZoneList<LInstruction*> instructions_; ZoneList<LPointerMap*> pointer_maps_; ZoneList<Handle<JSFunction> > inlined_closures_; + MapSet deprecation_dependencies_; + MapSet stability_dependencies_; }; |