//
// Core register
struct Register {
- bool is_valid() const { return 0 <= code_ && code_ < 16; }
- bool is(Register reg) const { return code_ == reg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
+ bool is(Register reg) const { return code_ == reg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
// Single word VFP register.
struct SwVfpRegister {
- bool is_valid() const { return 0 <= code_ && code_ < 32; }
- bool is(SwVfpRegister reg) const { return code_ == reg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 32; }
+ bool is(SwVfpRegister reg) const { return code_ == reg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
- void split_code(int* vm, int* m) const {
+ void split_code(int* vm, int* m) const {
ASSERT(is_valid());
*m = code_ & 0x1;
*vm = code_ >> 1;
// Double word VFP register.
struct DwVfpRegister {
// Supporting d0 to d15, can be later extended to d31.
- bool is_valid() const { return 0 <= code_ && code_ < 16; }
- bool is(DwVfpRegister reg) const { return code_ == reg.code_; }
- SwVfpRegister low() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
+ bool is(DwVfpRegister reg) const { return code_ == reg.code_; }
+ SwVfpRegister low() const {
SwVfpRegister reg;
reg.code_ = code_ * 2;
ASSERT(reg.is_valid());
return reg;
}
- SwVfpRegister high() const {
+ SwVfpRegister high() const {
SwVfpRegister reg;
reg.code_ = (code_ * 2) + 1;
ASSERT(reg.is_valid());
return reg;
}
- int code() const {
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
- void split_code(int* vm, int* m) const {
+ void split_code(int* vm, int* m) const {
ASSERT(is_valid());
*m = (code_ & 0x10) >> 4;
*vm = code_ & 0x0F;
// Coprocessor register
struct CRegister {
- bool is_valid() const { return 0 <= code_ && code_ < 16; }
- bool is(CRegister creg) const { return code_ == creg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
+ bool is(CRegister creg) const { return code_ == creg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
int NumberOfSlot(Slot* slot);
// State
- bool has_cc() const { return cc_reg_ != al; }
- JumpTarget* true_target() const { return state_->true_target(); }
- JumpTarget* false_target() const { return state_->false_target(); }
+ bool has_cc() const { return cc_reg_ != al; }
+ JumpTarget* true_target() const { return state_->true_target(); }
+ JumpTarget* false_target() const { return state_->false_target(); }
// Track loop nesting level.
int loop_nesting() const { return loop_nesting_; }
INLINE(void Unuse()) { pos_ = 0; }
- INLINE(bool is_bound() const) { return pos_ < 0; }
+ INLINE(bool is_bound() const) { return pos_ < 0; }
INLINE(bool is_unused() const) { return pos_ == 0; }
INLINE(bool is_linked() const) { return pos_ > 0; }
static inline int ModeMask(Mode mode) { return 1 << mode; }
// Accessors
- byte* pc() const { return pc_; }
+ byte* pc() const { return pc_; }
void set_pc(byte* pc) { pc_ = pc; }
Mode rmode() const { return rmode_; }
- intptr_t data() const { return data_; }
+ intptr_t data() const { return data_; }
// Apply a relocation by delta bytes
INLINE(void apply(intptr_t delta));
explicit RelocIterator(const CodeDesc& desc, int mode_mask = -1);
// Iteration
- bool done() const { return done_; }
+ bool done() const { return done_; }
void next();
// Return pointer valid until next next().
void AddStatement(Statement* statement) { statements_.Add(statement); }
ZoneList<Statement*>* statements() { return &statements_; }
- bool is_initializer_block() const { return is_initializer_block_; }
+ bool is_initializer_block() const { return is_initializer_block_; }
private:
ZoneList<Statement*> statements_;
virtual void Accept(AstVisitor* v);
- VariableProxy* proxy() const { return proxy_; }
- Variable::Mode mode() const { return mode_; }
- FunctionLiteral* fun() const { return fun_; } // may be NULL
+ VariableProxy* proxy() const { return proxy_; }
+ Variable::Mode mode() const { return mode_; }
+ FunctionLiteral* fun() const { return fun_; } // may be NULL
private:
VariableProxy* proxy_;
virtual void Accept(AstVisitor* v);
- Statement* init() const { return init_; }
+ Statement* init() const { return init_; }
void set_init(Statement* stmt) { init_ = stmt; }
- Expression* cond() const { return cond_; }
+ Expression* cond() const { return cond_; }
void set_cond(Expression* expr) { cond_ = expr; }
- Statement* next() const { return next_; }
+ Statement* next() const { return next_; }
void set_next(Statement* stmt) { next_ = stmt; }
bool may_have_function_literal() const {
virtual void Accept(AstVisitor* v);
- IterationStatement* target() const { return target_; }
+ IterationStatement* target() const { return target_; }
private:
IterationStatement* target_;
virtual void Accept(AstVisitor* v);
- BreakableStatement* target() const { return target_; }
+ BreakableStatement* target() const { return target_; }
private:
BreakableStatement* target_;
virtual void Accept(AstVisitor* v);
- Expression* expression() const { return expression_; }
+ Expression* expression() const { return expression_; }
bool is_catch_block() const { return is_catch_block_; }
public:
CaseClause(Expression* label, ZoneList<Statement*>* statements);
- bool is_default() const { return label_ == NULL; }
- Expression* label() const {
+ bool is_default() const { return label_ == NULL; }
+ Expression* label() const {
CHECK(!is_default());
return label_;
}
JumpTarget* body_target() { return &body_target_; }
- ZoneList<Statement*>* statements() const { return statements_; }
+ ZoneList<Statement*>* statements() const { return statements_; }
private:
Expression* label_;
virtual void Accept(AstVisitor* v);
- Expression* tag() const { return tag_; }
- ZoneList<CaseClause*>* cases() const { return cases_; }
+ Expression* tag() const { return tag_; }
+ ZoneList<CaseClause*>* cases() const { return cases_; }
private:
Expression* tag_;
virtual void Accept(AstVisitor* v);
- VariableProxy* catch_var() const { return catch_var_; }
- Block* catch_block() const { return catch_block_; }
+ VariableProxy* catch_var() const { return catch_var_; }
+ Block* catch_block() const { return catch_block_; }
private:
VariableProxy* catch_var_;
return (variable == NULL) ? false : variable->is_arguments();
}
- Handle<String> name() const { return name_; }
- Variable* var() const { return var_; }
- bool is_this() const { return is_this_; }
- bool inside_with() const { return inside_with_; }
+ Handle<String> name() const { return name_; }
+ Variable* var() const { return var_; }
+ bool is_this() const { return is_this_; }
+ bool inside_with() const { return inside_with_; }
void MarkAsTrivial() { is_trivial_ = true; }
// Type testing & conversion
virtual FunctionLiteral* AsFunctionLiteral() { return this; }
- Handle<String> name() const { return name_; }
- Scope* scope() const { return scope_; }
- ZoneList<Statement*>* body() const { return body_; }
+ Handle<String> name() const { return name_; }
+ Scope* scope() const { return scope_; }
+ ZoneList<Statement*>* body() const { return body_; }
void set_function_token_position(int pos) { function_token_position_ = pos; }
int function_token_position() const { return function_token_position_; }
int start_position() const { return start_position_; }
bool AllowsLazyCompilation();
- Handle<String> inferred_name() const { return inferred_name_; }
+ Handle<String> inferred_name() const { return inferred_name_; }
void set_inferred_name(Handle<String> inferred_name) {
inferred_name_ = inferred_name;
}
void Clear();
// The number of (non-empty) entries in the table.
- uint32_t occupancy() const { return occupancy_; }
+ uint32_t occupancy() const { return occupancy_; }
// The capacity of the table. The implementation
// makes sure that occupancy is at most 80% of
// the table capacity.
- uint32_t capacity() const { return capacity_; }
+ uint32_t capacity() const { return capacity_; }
// Iteration
//
uint32_t capacity_;
uint32_t occupancy_;
- Entry* map_end() const { return map_ + capacity_; }
+ Entry* map_end() const { return map_ + capacity_; }
Entry* Probe(void* key, uint32_t hash);
void Initialize(uint32_t capacity);
void Resize();
// and best performance in optimized code.
//
struct Register {
- bool is_valid() const { return 0 <= code_ && code_ < 8; }
- bool is(Register reg) const { return code_ == reg.code_; }
+ bool is_valid() const { return 0 <= code_ && code_ < 8; }
+ bool is(Register reg) const { return code_ == reg.code_; }
// eax, ebx, ecx and edx are byte registers, the rest are not.
- bool is_byte_register() const { return code_ <= 3; }
- int code() const {
+ bool is_byte_register() const { return code_ <= 3; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
struct XMMRegister {
- bool is_valid() const { return 0 <= code_ && code_ < 8; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 8; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
// Used for inline tables, e.g., jump-tables.
void dd(uint32_t data, RelocInfo::Mode reloc_info);
- int pc_offset() const { return pc_ - buffer_; }
+ int pc_offset() const { return pc_ - buffer_; }
int current_statement_position() const { return current_statement_position_; }
- int current_position() const { return current_position_; }
+ int current_position() const { return current_position_; }
// Check if there is less than kGap bytes available in the buffer.
// If this is the case, we need to grow the buffer before emitting
// Returns a reference to the element at index i. This reference is
// not safe to use after operations that can change the list's
// backing store (eg, Add).
- inline T& operator[](int i) const {
+ inline T& operator[](int i) const {
ASSERT(0 <= i);
ASSERT(i < length_);
return data_[i];
}
- inline T& at(int i) const { return operator[](i); }
+ inline T& at(int i) const { return operator[](i); }
inline T& last() const { return at(length_ - 1); }
inline T& first() const { return at(0); }
// Core register.
struct Register {
- bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
- bool is(Register reg) const { return code_ == reg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < kNumRegisters; }
+ bool is(Register reg) const { return code_ == reg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
// Coprocessor register.
struct FPURegister {
- bool is_valid() const { return 0 <= code_ && code_ < kNumFPURegister ; }
- bool is(FPURegister creg) const { return code_ == creg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < kNumFPURegister ; }
+ bool is(FPURegister creg) const { return code_ == creg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
ASSERT(is_valid());
return 1 << code_;
}
} } // namespace v8::internal
#endif // V8_ARM_ASSEMBLER_MIPS_H_
-
void ProcessDeferred();
// State
- bool has_cc() const { return cc_reg_ != cc_always; }
+ bool has_cc() const { return cc_reg_ != cc_always; }
TypeofState typeof_state() const { return state_->typeof_state(); }
- JumpTarget* true_target() const { return state_->true_target(); }
- JumpTarget* false_target() const { return state_->false_target(); }
+ JumpTarget* true_target() const { return state_->true_target(); }
+ JumpTarget* false_target() const { return state_->false_target(); }
// We don't track loop nesting level on mips yet.
int loop_nesting() const { return 0; }
MemOperand SlotOperand(Slot* slot, Register tmp);
// Expressions
- MemOperand GlobalObject() const {
+ MemOperand GlobalObject() const {
return ContextOperand(cp, Context::GLOBAL_INDEX);
}
ScriptDataImpl* pre_data_;
FuncNameInferrer* fni_;
- bool inside_with() const { return with_nesting_level_ > 0; }
- ParserFactory* factory() const { return factory_; }
+ bool inside_with() const { return with_nesting_level_ > 0; }
+ ParserFactory* factory() const { return factory_; }
ParserLog* log() const { return log_; }
Scanner& scanner() { return scanner_; }
- Mode mode() const { return mode_; }
- ScriptDataImpl* pre_data() const { return pre_data_; }
+ Mode mode() const { return mode_; }
+ ScriptDataImpl* pre_data() const { return pre_data_; }
// All ParseXXX functions take as the last argument an *ok parameter
// which is set to false if parsing failed; it is unchanged otherwise.
}
void Process(ZoneList<Statement*>* statements);
- bool result_assigned() const { return result_assigned_; }
+ bool result_assigned() const { return result_assigned_; }
private:
VariableProxy* result_;
Token::Value Next();
// One token look-ahead (past the token returned by Next()).
- Token::Value peek() const { return next_.token; }
+ Token::Value peek() const { return next_.token; }
// Returns true if there was a line terminator before the peek'ed token.
bool has_line_terminator_before_next() const {
// Returns the location information for the current token
// (the token returned by Next()).
- Location location() const { return current_.location; }
- Location peek_location() const { return next_.location; }
+ Location location() const { return current_.location; }
+ Location peek_location() const { return next_.location; }
// Returns the literal string, if any, for the current token (the
// token returned by Next()). The string is 0-terminated and in
// --------------------------------------------------------------------------
// Lookup
- Handle<String> function_name() const { return function_name_; }
+ Handle<String> function_name() const { return function_name_; }
- Handle<String> parameter_name(int i) const { return parameters_[i]; }
- int number_of_parameters() const { return parameters_.length(); }
+ Handle<String> parameter_name(int i) const { return parameters_[i]; }
+ int number_of_parameters() const { return parameters_.length(); }
- Handle<String> stack_slot_name(int i) const { return stack_slots_[i]; }
- int number_of_stack_slots() const { return stack_slots_.length(); }
+ Handle<String> stack_slot_name(int i) const { return stack_slots_[i]; }
+ int number_of_stack_slots() const { return stack_slots_.length(); }
Handle<String> context_slot_name(int i) const {
return context_slots_[i - Context::MIN_CONTEXT_SLOTS];
// Predicates.
// Specific scope types.
- bool is_eval_scope() const { return type_ == EVAL_SCOPE; }
- bool is_function_scope() const { return type_ == FUNCTION_SCOPE; }
- bool is_global_scope() const { return type_ == GLOBAL_SCOPE; }
+ bool is_eval_scope() const { return type_ == EVAL_SCOPE; }
+ bool is_function_scope() const { return type_ == FUNCTION_SCOPE; }
+ bool is_global_scope() const { return type_ == GLOBAL_SCOPE; }
// Information about which scopes calls eval.
- bool calls_eval() const { return scope_calls_eval_; }
- bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; }
+ bool calls_eval() const { return scope_calls_eval_; }
+ bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; }
// Is this scope inside a with statement.
- bool inside_with() const { return scope_inside_with_; }
+ bool inside_with() const { return scope_inside_with_; }
// Does this scope contain a with statement.
- bool contains_with() const { return scope_contains_with_; }
+ bool contains_with() const { return scope_contains_with_; }
// The scope immediately surrounding this scope, or NULL.
- Scope* outer_scope() const { return outer_scope_; }
+ Scope* outer_scope() const { return outer_scope_; }
// ---------------------------------------------------------------------------
// Accessors.
// The variable holding the function literal for named function
// literals, or NULL.
// Only valid for function scopes.
- Variable* function() const {
+ Variable* function() const {
ASSERT(is_function_scope());
return function_;
}
// Parameters. The left-most parameter has index 0.
// Only valid for function scopes.
- Variable* parameter(int index) const {
+ Variable* parameter(int index) const {
ASSERT(is_function_scope());
return params_[index];
}
- int num_parameters() const { return params_.length(); }
+ int num_parameters() const { return params_.length(); }
// The local variable 'arguments' if we need to allocate it; NULL otherwise.
// If arguments() exist, arguments_shadow() exists, too.
- Variable* arguments() const { return arguments_; }
+ Variable* arguments() const { return arguments_; }
// The '.arguments' shadow variable if we need to allocate it; NULL otherwise.
// If arguments_shadow() exist, arguments() exists, too.
- Variable* arguments_shadow() const { return arguments_shadow_; }
+ Variable* arguments_shadow() const { return arguments_shadow_; }
// Declarations list.
ZoneList<Declaration*>* declarations() { return &decls_; }
void AllocateVariables(Handle<Context> context);
// Result of variable allocation.
- int num_stack_slots() const { return num_stack_slots_; }
- int num_heap_slots() const { return num_heap_slots_; }
+ int num_stack_slots() const { return num_stack_slots_; }
+ int num_heap_slots() const { return num_heap_slots_; }
// Make sure this scope and all outer scopes are eagerly compiled.
void ForceEagerCompilation() { force_eager_compilation_ = true; }
// in an outer scope about which we don't know anything (it may not
// be the global scope). scope() is NULL in that case. Currently the
// scope is only used to follow the context chain length.
- Scope* scope() const { return scope_; }
+ Scope* scope() const { return scope_; }
- Handle<String> name() const { return name_; }
- Mode mode() const { return mode_; }
- bool is_accessed_from_inner_scope() const {
+ Handle<String> name() const { return name_; }
+ Mode mode() const { return mode_; }
+ bool is_accessed_from_inner_scope() const {
return is_accessed_from_inner_scope_;
}
bool is_used() { return is_used_; }
local_if_not_shadowed_ = local;
}
- Expression* rewrite() const { return rewrite_; }
+ Expression* rewrite() const { return rewrite_; }
StaticType* type() { return &type_; }
Register r = { code };
return r;
}
- bool is_valid() const { return 0 <= code_ && code_ < 16; }
- bool is(Register reg) const { return code_ == reg.code_; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
+ bool is(Register reg) const { return code_ == reg.code_; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
- int bit() const {
+ int bit() const {
return 1 << code_;
}
struct XMMRegister {
- bool is_valid() const { return 0 <= code_ && code_ < 16; }
- int code() const {
+ bool is_valid() const { return 0 <= code_ && code_ < 16; }
+ int code() const {
ASSERT(is_valid());
return code_;
}
void RecordStatementPosition(int pos);
bool WriteRecordedPositions();
- int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
+ int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
int current_statement_position() const { return current_statement_position_; }
- int current_position() const { return current_position_; }
+ int current_position() const { return current_position_; }
// Check if there is less than kGap bytes available in the buffer.
// If this is the case, we need to grow the buffer before emitting