namespace v8 {
namespace internal {
-AstSentinels::AstSentinels()
- : this_proxy_(Isolate::Current(), true),
- identifier_proxy_(Isolate::Current(), false),
- valid_left_hand_side_sentinel_(Isolate::Current()),
- this_property_(Isolate::Current(), &this_proxy_, NULL, 0),
- call_sentinel_(Isolate::Current(), NULL, NULL, 0) {
-}
-
-
// ----------------------------------------------------------------------------
// All the Accept member functions for each syntax tree node type.
}
-VariableProxy::VariableProxy(Isolate* isolate, bool is_this)
- : Expression(isolate),
- var_(NULL),
- is_this_(is_this),
- inside_with_(false),
- is_trivial_(false) {
-}
-
-
void VariableProxy::BindTo(Variable* var) {
ASSERT(var_ == NULL); // must be bound only once
ASSERT(var != NULL); // must bind
}
-bool ValidLeftHandSideSentinel::IsInlineable() const {
- UNREACHABLE();
- return false;
-}
-
-
bool ForStatement::IsInlineable() const {
return (init() == NULL || init()->IsInlineable())
&& (cond() == NULL || cond()->IsInlineable())
};
-/**
- * A sentinel used during pre parsing that represents some expression
- * that is a valid left hand side without having to actually build
- * the expression.
- */
-class ValidLeftHandSideSentinel: public Expression {
- public:
- explicit ValidLeftHandSideSentinel(Isolate* isolate) : Expression(isolate) {}
- virtual bool IsValidLeftHandSide() { return true; }
- virtual void Accept(AstVisitor* v) { UNREACHABLE(); }
- virtual bool IsInlineable() const;
-};
-
-
class BreakableStatement: public Statement {
public:
enum Type {
bool is_this,
bool inside_with,
int position = RelocInfo::kNoPosition);
- VariableProxy(Isolate* isolate, bool is_this);
friend class Scope;
};
-class VariableProxySentinel: public VariableProxy {
- public:
- virtual bool IsValidLeftHandSide() { return !is_this(); }
-
- private:
- VariableProxySentinel(Isolate* isolate, bool is_this)
- : VariableProxy(isolate, is_this) { }
-
- friend class AstSentinels;
-};
-
-
class Slot: public Expression {
public:
enum Type {
};
-class AstSentinels {
- public:
- ~AstSentinels() { }
-
- // Returns a property singleton property access on 'this'. Used
- // during preparsing.
- Property* this_property() { return &this_property_; }
- VariableProxySentinel* this_proxy() { return &this_proxy_; }
- VariableProxySentinel* identifier_proxy() { return &identifier_proxy_; }
- ValidLeftHandSideSentinel* valid_left_hand_side_sentinel() {
- return &valid_left_hand_side_sentinel_;
- }
- Call* call_sentinel() { return &call_sentinel_; }
- EmptyStatement* empty_statement() { return &empty_statement_; }
-
- private:
- AstSentinels();
- VariableProxySentinel this_proxy_;
- VariableProxySentinel identifier_proxy_;
- ValidLeftHandSideSentinel valid_left_hand_side_sentinel_;
- Property this_property_;
- Call call_sentinel_;
- EmptyStatement empty_statement_;
-
- friend class Isolate;
-
- DISALLOW_COPY_AND_ASSIGN(AstSentinels);
-};
-
-
class CallNew: public Expression {
public:
CallNew(Isolate* isolate,
global_handles_(NULL),
context_switcher_(NULL),
thread_manager_(NULL),
- ast_sentinels_(NULL),
string_tracker_(NULL),
regexp_stack_(NULL),
embedder_data_(NULL) {
delete regexp_stack_;
regexp_stack_ = NULL;
- delete ast_sentinels_;
- ast_sentinels_ = NULL;
-
delete descriptor_lookup_cache_;
descriptor_lookup_cache_ = NULL;
delete context_slot_cache_;
bootstrapper_ = new Bootstrapper();
handle_scope_implementer_ = new HandleScopeImplementer(this);
stub_cache_ = new StubCache(this);
- ast_sentinels_ = new AstSentinels();
regexp_stack_ = new RegExpStack();
regexp_stack_->isolate_ = this;
namespace v8 {
namespace internal {
-class AstSentinels;
class Bootstrapper;
class CodeGenerator;
class CodeRange;
return &objects_string_input_buffer_;
}
- AstSentinels* ast_sentinels() { return ast_sentinels_; }
-
RuntimeState* runtime_state() { return &runtime_state_; }
StaticResource<SafeStringInputBuffer>* compiler_safe_string_input_buffer() {
GlobalHandles* global_handles_;
ContextSwitcher* context_switcher_;
ThreadManager* thread_manager_;
- AstSentinels* ast_sentinels_;
RuntimeState runtime_state_;
StaticResource<SafeStringInputBuffer> compiler_safe_string_input_buffer_;
Builtins builtins_;