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

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: 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
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 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 case Token::SUPER: 2565 case Token::SUPER:
2566 if (is_strong(language_mode()) && 2566 if ((FLAG_strong_this || peek() != Token::THIS) &&
conradw 2015/06/12 15:01:34 Could the peek() check be eliminated by shifting t
rossberg 2015/06/15 08:50:30 Done.
2567 is_strong(language_mode()) &&
2567 i::IsConstructor(function_state_->kind())) { 2568 i::IsConstructor(function_state_->kind())) {
2568 bool is_this = peek() == Token::THIS; 2569 bool is_this = peek() == Token::THIS;
2569 Expression* expr; 2570 Expression* expr;
2570 ExpressionClassifier classifier; 2571 ExpressionClassifier classifier;
2571 if (is_this) { 2572 if (is_this) {
2572 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK); 2573 expr = ParseStrongInitializationExpression(&classifier, CHECK_OK);
2573 } else { 2574 } else {
2574 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK); 2575 expr = ParseStrongSuperCallExpression(&classifier, CHECK_OK);
2575 } 2576 }
2576 ValidateExpression(&classifier, CHECK_OK); 2577 ValidateExpression(&classifier, CHECK_OK);
(...skipping 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after
5824 Expression* Parser::SpreadCallNew(Expression* function, 5825 Expression* Parser::SpreadCallNew(Expression* function,
5825 ZoneList<v8::internal::Expression*>* args, 5826 ZoneList<v8::internal::Expression*>* args,
5826 int pos) { 5827 int pos) {
5827 args->InsertAt(0, function, zone()); 5828 args->InsertAt(0, function, zone());
5828 5829
5829 return factory()->NewCallRuntime( 5830 return factory()->NewCallRuntime(
5830 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 5831 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5831 } 5832 }
5832 } // namespace internal 5833 } // namespace internal
5833 } // namespace v8 5834 } // namespace v8
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | src/preparser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698