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

Side by Side Diff: src/parser.cc

Issue 4078: - Added a map cache for literal objects. This will... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 break; 2731 break;
2732 } 2732 }
2733 2733
2734 Expect(Token::COLON, CHECK_OK); 2734 Expect(Token::COLON, CHECK_OK);
2735 Expression* value = ParseAssignmentExpression(true, CHECK_OK); 2735 Expression* value = ParseAssignmentExpression(true, CHECK_OK);
2736 2736
2737 ObjectLiteral::Property* property = 2737 ObjectLiteral::Property* property =
2738 NEW(ObjectLiteral::Property(key, value)); 2738 NEW(ObjectLiteral::Property(key, value));
2739 2739
2740 // Count CONSTANT or COMPUTED properties to maintain the enumeration order. 2740 // Count CONSTANT or COMPUTED properties to maintain the enumeration order.
2741 if (IsBoilerplateProperty(property)) 2741 if (IsBoilerplateProperty(property)) number_of_boilerplate_properties++;
2742 number_of_boilerplate_properties++;
2743 properties.Add(property); 2742 properties.Add(property);
2744 2743
2745 // TODO(1240767): Consider allowing trailing comma. 2744 // TODO(1240767): Consider allowing trailing comma.
2746 if (peek() != Token::RBRACE) Expect(Token::COMMA, CHECK_OK); 2745 if (peek() != Token::RBRACE) Expect(Token::COMMA, CHECK_OK);
2747 } 2746 }
2748 Expect(Token::RBRACE, CHECK_OK); 2747 Expect(Token::RBRACE, CHECK_OK);
2749 // Computation of literal_index must happen before pre parse bailout. 2748 // Computation of literal_index must happen before pre parse bailout.
2750 int literal_index = temp_scope_->NextMaterializedLiteralIndex(); 2749 int literal_index = temp_scope_->NextMaterializedLiteralIndex();
2751 if (is_pre_parsing_) return NULL; 2750 if (is_pre_parsing_) return NULL;
2752 2751
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
3257 start_position, 3256 start_position,
3258 is_expression); 3257 is_expression);
3259 return result; 3258 return result;
3260 } 3259 }
3261 3260
3262 3261
3263 #undef NEW 3262 #undef NEW
3264 3263
3265 3264
3266 } } // namespace v8::internal 3265 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698