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

Unified Diff: src/parser.cc

Issue 953563002: Implement experimental exponentiation operator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add more tests and fix some bugs Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 54e4c7cec15b1ed18f2fedcf36db47fb8ed6a126..4c0f8c94e5860f5ff5f72eaa789ee658c7644cde 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -511,6 +511,11 @@ bool ParserTraits::ShortcutNumericLiteralBinaryExpression(
*x = factory->NewNumberLiteral(value, pos);
return true;
}
+ case Token::EXP: {
+ double value = power_helper(x_val, y_val);
+ *x = factory->NewNumberLiteral(value, pos);
+ return true;
+ }
default:
break;
}
@@ -815,6 +820,7 @@ Parser::Parser(CompilationInfo* info, uintptr_t stack_limit, uint32_t hash_seed,
set_allow_harmony_computed_property_names(
FLAG_harmony_computed_property_names);
set_allow_harmony_rest_params(FLAG_harmony_rest_parameters);
+ set_allow_harmony_exponentiation(FLAG_harmony_exponentiation);
set_allow_strong_mode(FLAG_strong_mode);
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
++feature) {
@@ -4033,6 +4039,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
allow_harmony_computed_property_names());
reusable_preparser_->set_allow_harmony_rest_params(
allow_harmony_rest_params());
+ reusable_preparser_->set_allow_harmony_exponentiation(
+ allow_harmony_exponentiation());
reusable_preparser_->set_allow_strong_mode(allow_strong_mode());
}
PreParser::PreParseResult result = reusable_preparser_->PreParseLazyFunction(
« src/compiler/typer.cc ('K') | « src/ic/ic-state.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698