Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: src/parsing/parser.h

Issue 1439693002: [runtime] Support Proxy setPrototypeOf trap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-11-09_new_Proxy_1417063011
Patch Set: merging with master Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/json-parser.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index b27f5512717f91db6c9fe36fb78e5d52cd2999ac..66662a0cbbee30ecb6a48c719534310bcccb78b8 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -217,10 +217,9 @@ class FunctionEntry BASE_EMBEDDED {
kSize
};
- explicit FunctionEntry(Vector<unsigned> backing)
- : backing_(backing) { }
+ explicit FunctionEntry(Vector<unsigned> backing) : backing_(backing) {}
- FunctionEntry() : backing_() { }
+ FunctionEntry() : backing_() {}
int start_pos() { return backing_[kStartPositionIndex]; }
int end_pos() { return backing_[kEndPositionIndex]; }
@@ -303,7 +302,7 @@ class BufferedZoneList {
void Add(T* value, Zone* zone) {
if (last_ != NULL) {
if (list_ == NULL) {
- list_ = new(zone) ZoneList<T*>(initial_size, zone);
+ list_ = new (zone) ZoneList<T*>(initial_size, zone);
}
list_->Add(last_, zone);
}
@@ -352,7 +351,7 @@ class BufferedZoneList {
ZoneList<T*>* GetList(Zone* zone) {
if (list_ == NULL) {
- list_ = new(zone) ZoneList<T*>(initial_size, zone);
+ list_ = new (zone) ZoneList<T*>(initial_size, zone);
}
if (last_ != NULL) {
list_->Add(last_, zone);
@@ -368,7 +367,7 @@ class BufferedZoneList {
// Accumulates RegExp atoms and assertions into lists of terms and alternatives.
-class RegExpBuilder: public ZoneObject {
+class RegExpBuilder : public ZoneObject {
public:
explicit RegExpBuilder(Zone* zone);
void AddCharacter(uc16 character);
@@ -378,8 +377,8 @@ class RegExpBuilder: public ZoneObject {
void AddAtom(RegExpTree* tree);
void AddAssertion(RegExpTree* tree);
void NewAlternative(); // '|'
- void AddQuantifierToAtom(
- int min, int max, RegExpQuantifier::QuantifierType type);
+ void AddQuantifierToAtom(int min, int max,
+ RegExpQuantifier::QuantifierType type);
RegExpTree* ToRegExp();
private:
@@ -395,7 +394,7 @@ class RegExpBuilder: public ZoneObject {
BufferedZoneList<RegExpTree, 2> text_;
BufferedZoneList<RegExpTree, 2> alternatives_;
#ifdef DEBUG
- enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
+ enum { ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM } last_added_;
#define LAST(x) last_added_ = x;
#else
#define LAST(x)
@@ -734,22 +733,14 @@ class ParserTraits {
ParseErrorType error_type = kSyntaxError);
// "null" return type creators.
- static const AstRawString* EmptyIdentifier() {
- return NULL;
- }
- static Expression* EmptyExpression() {
- return NULL;
- }
- static Literal* EmptyLiteral() {
- return NULL;
- }
+ static const AstRawString* EmptyIdentifier() { return NULL; }
+ static Expression* EmptyExpression() { return NULL; }
+ static Literal* EmptyLiteral() { return NULL; }
static ObjectLiteralProperty* EmptyObjectLiteralProperty() { return NULL; }
static FunctionLiteral* EmptyFunctionLiteral() { return NULL; }
// Used in error return values.
- static ZoneList<Expression*>* NullExpressionList() {
- return NULL;
- }
+ static ZoneList<Expression*>* NullExpressionList() { return NULL; }
static const AstRawString* EmptyFormalParameter() { return NULL; }
// Non-NULL empty string.
@@ -782,13 +773,13 @@ class ParserTraits {
AstNodeFactory* factory);
Expression* GetIterator(Expression* iterable, AstNodeFactory* factory);
ZoneList<v8::internal::Expression*>* NewExpressionList(int size, Zone* zone) {
- return new(zone) ZoneList<v8::internal::Expression*>(size, zone);
+ return new (zone) ZoneList<v8::internal::Expression*>(size, zone);
}
ZoneList<ObjectLiteral::Property*>* NewPropertyList(int size, Zone* zone) {
- return new(zone) ZoneList<ObjectLiteral::Property*>(size, zone);
+ return new (zone) ZoneList<ObjectLiteral::Property*>(size, zone);
}
ZoneList<v8::internal::Statement*>* NewStatementList(int size, Zone* zone) {
- return new(zone) ZoneList<v8::internal::Statement*>(size, zone);
+ return new (zone) ZoneList<v8::internal::Statement*>(size, zone);
}
V8_INLINE void AddParameterInitializationBlock(
@@ -811,8 +802,8 @@ class ParserTraits {
bool* ok);
void ParseArrowFunctionFormalParameterList(
ParserFormalParameters* parameters, Expression* params,
- const Scanner::Location& params_loc,
- Scanner::Location* duplicate_loc, bool* ok);
+ const Scanner::Location& params_loc, Scanner::Location* duplicate_loc,
+ bool* ok);
V8_INLINE DoExpression* ParseDoExpression(bool* ok);
@@ -956,8 +947,7 @@ class Parser : public ParserBase<ParserTraits> {
return compile_options_ == ScriptCompiler::kProduceParserCache;
}
Scope* DeclarationScope(VariableMode mode) {
- return IsLexicalVariableMode(mode)
- ? scope_ : scope_->DeclarationScope();
+ return IsLexicalVariableMode(mode) ? scope_ : scope_->DeclarationScope();
}
// All ParseXXX functions take as the last argument an *ok parameter
@@ -980,7 +970,7 @@ class Parser : public ParserBase<ParserTraits> {
Statement* ParseStatement(ZoneList<const AstRawString*>* labels, bool* ok);
Statement* ParseSubStatement(ZoneList<const AstRawString*>* labels, bool* ok);
Statement* ParseStatementAsUnlabelled(ZoneList<const AstRawString*>* labels,
- bool* ok);
+ bool* ok);
Statement* ParseFunctionDeclaration(ZoneList<const AstRawString*>* names,
bool* ok);
Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names,
@@ -988,8 +978,7 @@ class Parser : public ParserBase<ParserTraits> {
Statement* ParseNativeDeclaration(bool* ok);
Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok);
Block* ParseVariableStatement(VariableDeclarationContext var_context,
- ZoneList<const AstRawString*>* names,
- bool* ok);
+ ZoneList<const AstRawString*>* names, bool* ok);
DoExpression* ParseDoExpression(bool* ok);
struct DeclarationDescriptor {
@@ -1109,10 +1098,8 @@ class Parser : public ParserBase<ParserTraits> {
// Initialize the components of a for-in / for-of statement.
- void InitializeForEachStatement(ForEachStatement* stmt,
- Expression* each,
- Expression* subject,
- Statement* body);
+ void InitializeForEachStatement(ForEachStatement* stmt, Expression* each,
+ Expression* subject, Statement* body);
Statement* DesugarLexicalBindingsInForStatement(
Scope* inner_scope, bool is_const, ZoneList<const AstRawString*>* names,
ForStatement* loop, Statement* init, Expression* cond, Statement* next,
@@ -1218,7 +1205,7 @@ class Parser : public ParserBase<ParserTraits> {
Scanner scanner_;
PreParser* reusable_preparser_;
Scope* original_scope_; // for ES5 function declarations in sloppy eval
- Target* target_stack_; // for break, continue statements
+ Target* target_stack_; // for break, continue statements
ScriptCompiler::CompileOptions compile_options_;
ParseData* cached_parse_data_;
@@ -1275,7 +1262,7 @@ void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope,
// Support for handling complex values (array and object literals) that
// can be fully handled at compile time.
-class CompileTimeValue: public AllStatic {
+class CompileTimeValue : public AllStatic {
public:
enum LiteralType {
OBJECT_LITERAL_FAST_ELEMENTS,
@@ -1372,8 +1359,8 @@ void ParserTraits::DeclareFormalParameter(
auto mode = is_simple ? VAR : TEMPORARY;
if (!is_simple) scope->SetHasNonSimpleParameters();
bool is_optional = parameter.initializer != nullptr;
- Variable* var = scope->DeclareParameter(
- name, mode, is_optional, parameter.is_rest, &is_duplicate);
+ Variable* var = scope->DeclareParameter(name, mode, is_optional,
+ parameter.is_rest, &is_duplicate);
if (is_duplicate) {
classifier->RecordDuplicateFormalParameterError(
parser_->scanner()->location());
« no previous file with comments | « src/parsing/json-parser.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698