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

Side by Side Diff: src/parser.cc

Issue 1180943007: [strong] Make strong 'this' optional for experimentation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comments Created 5 years, 6 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
« no previous file with comments | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 switch (peek()) { 2555 switch (peek()) {
2556 case Token::FUNCTION: 2556 case Token::FUNCTION:
2557 case Token::LBRACE: 2557 case Token::LBRACE:
2558 UNREACHABLE(); // Always handled by the callers. 2558 UNREACHABLE(); // Always handled by the callers.
2559 case Token::CLASS: 2559 case Token::CLASS:
2560 ReportUnexpectedToken(Next()); 2560 ReportUnexpectedToken(Next());
2561 *ok = false; 2561 *ok = false;
2562 return nullptr; 2562 return nullptr;
2563 2563
2564 case Token::THIS: 2564 case Token::THIS:
2565 if (!FLAG_strong_this) break;
2566 // Fall through.
2565 case Token::SUPER: 2567 case Token::SUPER:
2566 if (is_strong(language_mode()) && 2568 if (is_strong(language_mode()) &&
2567 i::IsConstructor(function_state_->kind())) { 2569 i::IsConstructor(function_state_->kind())) {
2568 bool is_this = peek() == Token::THIS; 2570 bool is_this = peek() == Token::THIS;
2569 Expression* expr; 2571 Expression* expr;
2570 ExpressionClassifier classifier; 2572 ExpressionClassifier classifier;
2571 if (is_this) { 2573 if (is_this) {
2572 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK); 2574 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK);
2573 } else { 2575 } else {
2574 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK); 2576 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK);
(...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after
5824 Expression* Parser::SpreadCallNew(Expression* function, 5826 Expression* Parser::SpreadCallNew(Expression* function,
5825 ZoneList<v8::internal::Expression*>* args, 5827 ZoneList<v8::internal::Expression*>* args,
5826 int pos) { 5828 int pos) {
5827 args->InsertAt(0, function, zone()); 5829 args->InsertAt(0, function, zone());
5828 5830
5829 return factory()->NewCallRuntime( 5831 return factory()->NewCallRuntime(
5830 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 5832 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5831 } 5833 }
5832 } // namespace internal 5834 } // namespace internal
5833 } // namespace v8 5835 } // namespace v8
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698