#include "src/accessors.h"
#include "src/allocation.h"
#include "src/ast.h"
+#include "src/bailout-reason.h"
#include "src/compiler.h"
#include "src/hydrogen-instructions.h"
#include "src/scopes.h"
class LiveRange;
-class HBasicBlock V8_FINAL : public ZoneObject {
+class HBasicBlock FINAL : public ZoneObject {
public:
explicit HBasicBlock(HGraph* graph);
~HBasicBlock() { }
OStream& operator<<(OStream& os, const HBasicBlock& b);
-class HPredecessorIterator V8_FINAL BASE_EMBEDDED {
+class HPredecessorIterator FINAL BASE_EMBEDDED {
public:
explicit HPredecessorIterator(HBasicBlock* block)
: predecessor_list_(block->predecessors()), current_(0) { }
};
-class HInstructionIterator V8_FINAL BASE_EMBEDDED {
+class HInstructionIterator FINAL BASE_EMBEDDED {
public:
explicit HInstructionIterator(HBasicBlock* block)
: instr_(block->first()) {
};
-class HLoopInformation V8_FINAL : public ZoneObject {
+class HLoopInformation FINAL : public ZoneObject {
public:
HLoopInformation(HBasicBlock* loop_header, Zone* zone)
: back_edges_(4, zone),
class BoundsCheckTable;
class InductionVariableBlocksTable;
-class HGraph V8_FINAL : public ZoneObject {
+class HGraph FINAL : public ZoneObject {
public:
explicit HGraph(CompilationInfo* info);
};
-class HEnvironment V8_FINAL : public ZoneObject {
+class HEnvironment FINAL : public ZoneObject {
public:
HEnvironment(HEnvironment* outer,
Scope* scope,
};
-class EffectContext V8_FINAL : public AstContext {
+class EffectContext FINAL : public AstContext {
public:
explicit EffectContext(HOptimizedGraphBuilder* owner)
: AstContext(owner, Expression::kEffect) {
}
virtual ~EffectContext();
- virtual void ReturnValue(HValue* value) V8_OVERRIDE;
+ virtual void ReturnValue(HValue* value) OVERRIDE;
virtual void ReturnInstruction(HInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnControl(HControlInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnContinuation(HIfContinuation* continuation,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
};
-class ValueContext V8_FINAL : public AstContext {
+class ValueContext FINAL : public AstContext {
public:
ValueContext(HOptimizedGraphBuilder* owner, ArgumentsAllowedFlag flag)
: AstContext(owner, Expression::kValue), flag_(flag) {
}
virtual ~ValueContext();
- virtual void ReturnValue(HValue* value) V8_OVERRIDE;
+ virtual void ReturnValue(HValue* value) OVERRIDE;
virtual void ReturnInstruction(HInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnControl(HControlInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnContinuation(HIfContinuation* continuation,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
bool arguments_allowed() { return flag_ == ARGUMENTS_ALLOWED; }
};
-class TestContext V8_FINAL : public AstContext {
+class TestContext FINAL : public AstContext {
public:
TestContext(HOptimizedGraphBuilder* owner,
Expression* condition,
if_false_(if_false) {
}
- virtual void ReturnValue(HValue* value) V8_OVERRIDE;
+ virtual void ReturnValue(HValue* value) OVERRIDE;
virtual void ReturnInstruction(HInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnControl(HControlInstruction* instr,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
virtual void ReturnContinuation(HIfContinuation* continuation,
- BailoutId ast_id) V8_OVERRIDE;
+ BailoutId ast_id) OVERRIDE;
static TestContext* cast(AstContext* context) {
DCHECK(context->IsTest());
};
-class FunctionState V8_FINAL {
+class FunctionState FINAL {
public:
FunctionState(HOptimizedGraphBuilder* owner,
CompilationInfo* info,
};
-class HIfContinuation V8_FINAL {
+class HIfContinuation FINAL {
public:
HIfContinuation()
: continuation_captured_(false),
};
-class HAllocationMode V8_FINAL BASE_EMBEDDED {
+class HAllocationMode FINAL BASE_EMBEDDED {
public:
explicit HAllocationMode(Handle<AllocationSite> feedback_site)
: current_site_(NULL), feedback_site_(feedback_site),
HValue* current_site() const { return current_site_; }
Handle<AllocationSite> feedback_site() const { return feedback_site_; }
- bool CreateAllocationMementos() const V8_WARN_UNUSED_RESULT {
+ bool CreateAllocationMementos() const WARN_UNUSED_RESULT {
return current_site() != NULL;
}
- PretenureFlag GetPretenureMode() const V8_WARN_UNUSED_RESULT {
+ PretenureFlag GetPretenureMode() const WARN_UNUSED_RESULT {
if (!feedback_site().is_null()) return feedback_site()->GetPretenureMode();
return pretenure_flag_;
}
void AddIncrementCounter(StatsCounter* counter);
- class IfBuilder V8_FINAL {
+ class IfBuilder FINAL {
public:
// If using this constructor, Initialize() must be called explicitly!
IfBuilder();
int deopt_merge_at_join_block_count_;
};
- class LoopBuilder V8_FINAL {
+ class LoopBuilder FINAL {
public:
enum Direction {
kPreIncrement,
bool finished_;
};
- template <class A, class P1>
- void DeoptimizeIf(P1 p1, char* const reason) {
- IfBuilder builder(this);
- builder.If<A>(p1);
- builder.ThenDeopt(reason);
- }
-
- template <class A, class P1, class P2>
- void DeoptimizeIf(P1 p1, P2 p2, const char* reason) {
- IfBuilder builder(this);
- builder.If<A>(p1, p2);
- builder.ThenDeopt(reason);
- }
-
- template <class A, class P1, class P2, class P3>
- void DeoptimizeIf(P1 p1, P2 p2, P3 p3, const char* reason) {
- IfBuilder builder(this);
- builder.If<A>(p1, p2, p3);
- builder.ThenDeopt(reason);
- }
-
HValue* BuildNewElementsCapacity(HValue* old_capacity);
- class JSArrayBuilder V8_FINAL {
+ class JSArrayBuilder FINAL {
public:
JSArrayBuilder(HGraphBuilder* builder,
ElementsKind kind,
// A class encapsulating (lazily-allocated) break and continue blocks for
// a breakable statement. Separated from BreakAndContinueScope so that it
// can have a separate lifetime.
- class BreakAndContinueInfo V8_FINAL BASE_EMBEDDED {
+ class BreakAndContinueInfo FINAL BASE_EMBEDDED {
public:
explicit BreakAndContinueInfo(BreakableStatement* target,
Scope* scope,
// A helper class to maintain a stack of current BreakAndContinueInfo
// structures mirroring BreakableStatement nesting.
- class BreakAndContinueScope V8_FINAL BASE_EMBEDDED {
+ class BreakAndContinueScope FINAL BASE_EMBEDDED {
public:
BreakAndContinueScope(BreakAndContinueInfo* info,
HOptimizedGraphBuilder* owner)
explicit HOptimizedGraphBuilder(CompilationInfo* info);
- virtual bool BuildGraph() V8_OVERRIDE;
+ virtual bool BuildGraph() OVERRIDE;
// Simple accessors.
BreakAndContinueScope* break_scope() const { return break_scope_; }
void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; }
- bool inline_bailout() { return inline_bailout_; }
-
HValue* context() { return environment()->context(); }
HOsrBuilder* osr() const { return osr_; }
void PushArgumentsFromEnvironment(int count);
void SetUpScope(Scope* scope);
- virtual void VisitStatements(ZoneList<Statement*>* statements) V8_OVERRIDE;
+ virtual void VisitStatements(ZoneList<Statement*>* statements) OVERRIDE;
-#define DECLARE_VISIT(type) virtual void Visit##type(type* node) V8_OVERRIDE;
+#define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE;
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
- Type* ToType(Handle<Map> map) { return IC::MapToType<Type>(map, zone()); }
+ Type* ToType(Handle<Map> map);
private:
// Helpers for flow graph construction.
kUseCell,
kUseGeneric
};
- GlobalPropertyAccess LookupGlobalProperty(Variable* var,
- LookupResult* lookup,
+ GlobalPropertyAccess LookupGlobalProperty(Variable* var, LookupIterator* it,
PropertyAccessType access_type);
void EnsureArgumentsArePushedForAccess();
PropertyAccessInfo(HOptimizedGraphBuilder* builder,
PropertyAccessType access_type,
Type* type,
- Handle<String> name,
- InstanceType instance_type)
+ Handle<String> name)
: lookup_(builder->isolate()),
builder_(builder),
access_type_(access_type),
type_(type),
name_(name),
field_type_(HType::Tagged()),
- access_(HObjectAccess::ForMap()),
- instance_type_(instance_type) { }
+ access_(HObjectAccess::ForMap()) { }
// Checkes whether this PropertyAccessInfo can be handled as a monomorphic
// load named. It additionally fills in the fields necessary to generate the
bool has_holder() { return !holder_.is_null(); }
bool IsLoad() const { return access_type_ == LOAD; }
- LookupResult* lookup() { return &lookup_; }
- Handle<String> name() { return name_; }
Handle<JSObject> holder() { return holder_; }
Handle<JSFunction> accessor() { return accessor_; }
Handle<Object> constant() { return constant_; }
HType field_type() const { return field_type_; }
HObjectAccess access() { return access_; }
- bool IsSIMD128PropertyCallback() {
- return (((instance_type_ == Float32x4::kInstanceType ||
- instance_type_ == Int32x4::kInstanceType) &&
- (name_->Equals(isolate()->heap()->signMask()) ||
- name_->Equals(isolate()->heap()->x()) ||
- name_->Equals(isolate()->heap()->y()) ||
- name_->Equals(isolate()->heap()->z()) ||
- name_->Equals(isolate()->heap()->w()))) ||
- (instance_type_ == Int32x4::kInstanceType &&
- (name_->Equals(isolate()->heap()->flagX()) ||
- name_->Equals(isolate()->heap()->flagY()) ||
- name_->Equals(isolate()->heap()->flagZ()) ||
- name_->Equals(isolate()->heap()->flagW()))) ||
- (instance_type_ == Float64x2::kInstanceType &&
- (name_->Equals(isolate()->heap()->signMask()) ||
- name_->Equals(isolate()->heap()->x()) ||
- name_->Equals(isolate()->heap()->y()))));
- }
+ bool IsFound() const { return lookup_.IsFound(); }
+ bool IsProperty() const { return lookup_.IsProperty(); }
+ bool IsField() const { return lookup_.IsField(); }
+ bool IsConstant() const { return lookup_.IsConstant(); }
+ bool IsAccessor() const { return lookup_.IsPropertyCallbacks(); }
+ bool IsTransition() const { return lookup_.IsTransition(); }
+
+ bool IsConfigurable() const { return lookup_.IsConfigurable(); }
+ bool IsReadOnly() const { return lookup_.IsReadOnly(); }
private:
+ Handle<Object> GetAccessorsFromMap(Handle<Map> map) const {
+ return handle(lookup_.GetValueFromMap(*map), isolate());
+ }
+ Handle<Object> GetConstantFromMap(Handle<Map> map) const {
+ return handle(lookup_.GetConstantFromMap(*map), isolate());
+ }
+ Handle<HeapType> GetFieldTypeFromMap(Handle<Map> map) const {
+ return handle(lookup_.GetFieldTypeFromMap(*map), isolate());
+ }
+ Handle<Map> GetFieldOwnerFromMap(Handle<Map> map) const {
+ return handle(lookup_.GetFieldOwnerFromMap(*map));
+ }
+ int GetLocalFieldIndexFromMap(Handle<Map> map) const {
+ return lookup_.GetLocalFieldIndexFromMap(*map);
+ }
+ Representation representation() const { return lookup_.representation(); }
+
Type* ToType(Handle<Map> map) { return builder_->ToType(map); }
Zone* zone() { return builder_->zone(); }
- Isolate* isolate() { return lookup_.isolate(); }
+ Isolate* isolate() const { return lookup_.isolate(); }
CompilationInfo* top_info() { return builder_->top_info(); }
CompilationInfo* current_info() { return builder_->current_info(); }
SmallMapList field_maps_;
HType field_type_;
HObjectAccess access_;
- InstanceType instance_type_;
};
HInstruction* BuildMonomorphicAccess(PropertyAccessInfo* info,
KeyedAccessStoreMode store_mode,
bool* has_side_effects);
- HValue* HandleKeyedElementAccess(HValue* obj,
- HValue* key,
- HValue* val,
- Expression* expr,
+ HValue* HandleKeyedElementAccess(HValue* obj, HValue* key, HValue* val,
+ Expression* expr, BailoutId ast_id,
+ BailoutId return_id,
PropertyAccessType access_type,
bool* has_side_effects);
Zone* AstContext::zone() const { return owner_->zone(); }
-class HStatistics V8_FINAL: public Malloced {
+class HStatistics FINAL: public Malloced {
public:
HStatistics()
: times_(5),
};
-class HTracer V8_FINAL : public Malloced {
+class HTracer FINAL : public Malloced {
public:
explicit HTracer(int isolate_id)
: trace_(&string_allocator_), indent_(0) {
void TraceLiveRanges(const char* name, LAllocator* allocator);
private:
- class Tag V8_FINAL BASE_EMBEDDED {
+ class Tag FINAL BASE_EMBEDDED {
public:
Tag(HTracer* tracer, const char* name) {
name_ = name;
};
-class NoObservableSideEffectsScope V8_FINAL {
+class NoObservableSideEffectsScope FINAL {
public:
explicit NoObservableSideEffectsScope(HGraphBuilder* builder) :
builder_(builder) {