From: kmillikin@chromium.org Date: Fri, 24 Sep 2010 08:25:31 +0000 (+0000) Subject: Fix some inconsistent formatting. X-Git-Tag: upstream/4.7.83~21165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c503a833096d3caf7073c775b31c1e3920dbfb7;p=platform%2Fupstream%2Fv8.git Fix some inconsistent formatting. I noticed we sometimes had extra spaces before and after the "const" keyword. Probably the result of a search and replace gone wrong. This is a whitespace only change. Review URL: http://codereview.chromium.org/3427021 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/assembler-arm.h b/src/arm/assembler-arm.h index be9aa92f1..1c4fd6094 100644 --- a/src/arm/assembler-arm.h +++ b/src/arm/assembler-arm.h @@ -69,13 +69,13 @@ namespace internal { // // 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_; } @@ -110,17 +110,17 @@ const Register pc = { 15 }; // 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; @@ -133,31 +133,31 @@ struct SwVfpRegister { // 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; @@ -222,13 +222,13 @@ const DwVfpRegister d15 = { 15 }; // 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_; } diff --git a/src/arm/codegen-arm.h b/src/arm/codegen-arm.h index d4c352260..1483c0b54 100644 --- a/src/arm/codegen-arm.h +++ b/src/arm/codegen-arm.h @@ -307,9 +307,9 @@ class CodeGenerator: public AstVisitor { 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_; } diff --git a/src/assembler.h b/src/assembler.h index ba1087f3f..d28bf4370 100644 --- a/src/assembler.h +++ b/src/assembler.h @@ -57,7 +57,7 @@ class Label BASE_EMBEDDED { 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; } @@ -232,10 +232,10 @@ class RelocInfo BASE_EMBEDDED { 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)); @@ -390,7 +390,7 @@ class RelocIterator: public Malloced { 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(). diff --git a/src/ast.h b/src/ast.h index 1e3d02594..eadb310d4 100644 --- a/src/ast.h +++ b/src/ast.h @@ -330,7 +330,7 @@ class Block: public BreakableStatement { void AddStatement(Statement* statement) { statements_.Add(statement); } ZoneList* statements() { return &statements_; } - bool is_initializer_block() const { return is_initializer_block_; } + bool is_initializer_block() const { return is_initializer_block_; } private: ZoneList statements_; @@ -351,9 +351,9 @@ class Declaration: public AstNode { 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_; @@ -454,11 +454,11 @@ class ForStatement: public IterationStatement { 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 { @@ -531,7 +531,7 @@ class ContinueStatement: public Statement { virtual void Accept(AstVisitor* v); - IterationStatement* target() const { return target_; } + IterationStatement* target() const { return target_; } private: IterationStatement* target_; @@ -545,7 +545,7 @@ class BreakStatement: public Statement { virtual void Accept(AstVisitor* v); - BreakableStatement* target() const { return target_; } + BreakableStatement* target() const { return target_; } private: BreakableStatement* target_; @@ -576,7 +576,7 @@ class WithEnterStatement: public Statement { virtual void Accept(AstVisitor* v); - Expression* expression() const { return expression_; } + Expression* expression() const { return expression_; } bool is_catch_block() const { return is_catch_block_; } @@ -598,13 +598,13 @@ class CaseClause: public ZoneObject { public: CaseClause(Expression* label, ZoneList* 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* statements() const { return statements_; } + ZoneList* statements() const { return statements_; } private: Expression* label_; @@ -624,8 +624,8 @@ class SwitchStatement: public BreakableStatement { virtual void Accept(AstVisitor* v); - Expression* tag() const { return tag_; } - ZoneList* cases() const { return cases_; } + Expression* tag() const { return tag_; } + ZoneList* cases() const { return cases_; } private: Expression* tag_; @@ -719,8 +719,8 @@ class TryCatchStatement: public TryStatement { 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_; @@ -987,10 +987,10 @@ class VariableProxy: public Expression { return (variable == NULL) ? false : variable->is_arguments(); } - Handle name() const { return name_; } - Variable* var() const { return var_; } - bool is_this() const { return is_this_; } - bool inside_with() const { return inside_with_; } + Handle 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; } @@ -1457,9 +1457,9 @@ class FunctionLiteral: public Expression { // Type testing & conversion virtual FunctionLiteral* AsFunctionLiteral() { return this; } - Handle name() const { return name_; } - Scope* scope() const { return scope_; } - ZoneList* body() const { return body_; } + Handle name() const { return name_; } + Scope* scope() const { return scope_; } + ZoneList* 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_; } @@ -1479,7 +1479,7 @@ class FunctionLiteral: public Expression { bool AllowsLazyCompilation(); - Handle inferred_name() const { return inferred_name_; } + Handle inferred_name() const { return inferred_name_; } void set_inferred_name(Handle inferred_name) { inferred_name_ = inferred_name; } diff --git a/src/hashmap.h b/src/hashmap.h index b92c71573..3b947beb5 100644 --- a/src/hashmap.h +++ b/src/hashmap.h @@ -83,12 +83,12 @@ class HashMap { 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 // @@ -108,7 +108,7 @@ class HashMap { 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(); diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h index 56d91524f..1dab0a608 100644 --- a/src/ia32/assembler-ia32.h +++ b/src/ia32/assembler-ia32.h @@ -64,15 +64,15 @@ namespace internal { // 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_; } @@ -93,8 +93,8 @@ const Register no_reg = { -1 }; 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_; } @@ -855,9 +855,9 @@ class Assembler : public Malloced { // 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 diff --git a/src/list.h b/src/list.h index 9abf61ce5..5a08212b1 100644 --- a/src/list.h +++ b/src/list.h @@ -67,12 +67,12 @@ class List { // 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); } diff --git a/src/mips/assembler-mips.h b/src/mips/assembler-mips.h index b7c3ebcbc..a687c2b8f 100644 --- a/src/mips/assembler-mips.h +++ b/src/mips/assembler-mips.h @@ -73,13 +73,13 @@ namespace internal { // 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_; } @@ -129,13 +129,13 @@ Register ToRegister(int num); // 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_; } @@ -665,4 +665,3 @@ class Assembler : public Malloced { } } // namespace v8::internal #endif // V8_ARM_ASSEMBLER_MIPS_H_ - diff --git a/src/mips/codegen-mips.h b/src/mips/codegen-mips.h index 75e7a293f..66f891bd7 100644 --- a/src/mips/codegen-mips.h +++ b/src/mips/codegen-mips.h @@ -240,10 +240,10 @@ class CodeGenerator: public AstVisitor { 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; } @@ -280,7 +280,7 @@ class CodeGenerator: public AstVisitor { MemOperand SlotOperand(Slot* slot, Register tmp); // Expressions - MemOperand GlobalObject() const { + MemOperand GlobalObject() const { return ContextOperand(cp, Context::GLOBAL_INDEX); } diff --git a/src/parser.cc b/src/parser.cc index aebcc9ae2..a3f469af7 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -156,12 +156,12 @@ class Parser { 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. diff --git a/src/rewriter.cc b/src/rewriter.cc index d5c0750b2..f253ec533 100644 --- a/src/rewriter.cc +++ b/src/rewriter.cc @@ -692,7 +692,7 @@ class Processor: public AstVisitor { } void Process(ZoneList* statements); - bool result_assigned() const { return result_assigned_; } + bool result_assigned() const { return result_assigned_; } private: VariableProxy* result_; diff --git a/src/scanner.h b/src/scanner.h index 56760c374..6e5333bce 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -297,7 +297,7 @@ class Scanner { 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 { @@ -313,8 +313,8 @@ class Scanner { // 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 diff --git a/src/scopeinfo.h b/src/scopeinfo.h index 0fdab56db..b210ae76a 100644 --- a/src/scopeinfo.h +++ b/src/scopeinfo.h @@ -63,13 +63,13 @@ class ScopeInfo BASE_EMBEDDED { // -------------------------------------------------------------------------- // Lookup - Handle function_name() const { return function_name_; } + Handle function_name() const { return function_name_; } - Handle parameter_name(int i) const { return parameters_[i]; } - int number_of_parameters() const { return parameters_.length(); } + Handle parameter_name(int i) const { return parameters_[i]; } + int number_of_parameters() const { return parameters_.length(); } - Handle stack_slot_name(int i) const { return stack_slots_[i]; } - int number_of_stack_slots() const { return stack_slots_.length(); } + Handle stack_slot_name(int i) const { return stack_slots_[i]; } + int number_of_stack_slots() const { return stack_slots_.length(); } Handle context_slot_name(int i) const { return context_slots_[i - Context::MIN_CONTEXT_SLOTS]; diff --git a/src/scopes.h b/src/scopes.h index 0d706f9ff..68cf5e517 100644 --- a/src/scopes.h +++ b/src/scopes.h @@ -187,21 +187,21 @@ class Scope: public ZoneObject { // 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. @@ -217,27 +217,27 @@ class Scope: public ZoneObject { // 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* declarations() { return &decls_; } @@ -262,8 +262,8 @@ class Scope: public ZoneObject { void AllocateVariables(Handle 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; } diff --git a/src/variables.h b/src/variables.h index 1b518b7cf..ec76fee4f 100644 --- a/src/variables.h +++ b/src/variables.h @@ -131,11 +131,11 @@ class Variable: public ZoneObject { // 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 name() const { return name_; } - Mode mode() const { return mode_; } - bool is_accessed_from_inner_scope() const { + Handle 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_; } @@ -172,7 +172,7 @@ class Variable: public ZoneObject { local_if_not_shadowed_ = local; } - Expression* rewrite() const { return rewrite_; } + Expression* rewrite() const { return rewrite_; } StaticType* type() { return &type_; } diff --git a/src/x64/assembler-x64.h b/src/x64/assembler-x64.h index 73398d87f..bbc101062 100644 --- a/src/x64/assembler-x64.h +++ b/src/x64/assembler-x64.h @@ -92,13 +92,13 @@ struct Register { 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_; } @@ -138,8 +138,8 @@ const Register no_reg = { -1 }; 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_; } @@ -1178,9 +1178,9 @@ class Assembler : public Malloced { void RecordStatementPosition(int pos); bool WriteRecordedPositions(); - int pc_offset() const { return static_cast(pc_ - buffer_); } + int pc_offset() const { return static_cast(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