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

Unified Diff: src/pattern-rewriter.cc

Issue 1306993003: Call JS functions via native context instead of js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 4 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
« no previous file with comments | « src/parser.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pattern-rewriter.cc
diff --git a/src/pattern-rewriter.cc b/src/pattern-rewriter.cc
index 489530d47750bafe3a520d6faf37ab494163e2ea..f7e5b434664ce5905effdbee891e44859ae77aea 100644
--- a/src/pattern-rewriter.cc
+++ b/src/pattern-rewriter.cc
@@ -142,10 +142,9 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
// and add it to the initialization statement block.
// Note that the function does different things depending on
// the number of arguments (1 or 2).
- initialize = factory()->NewCallRuntime(
- ast_value_factory()->initialize_const_global_string(),
- Runtime::FunctionForId(Runtime::kInitializeConstGlobal), arguments,
- descriptor_->initialization_pos);
+ initialize =
+ factory()->NewCallRuntime(Runtime::kInitializeConstGlobal, arguments,
+ descriptor_->initialization_pos);
} else {
// Add language mode.
// We may want to pass singleton to avoid Literal allocations.
@@ -163,10 +162,9 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
value = NULL; // zap the value to avoid the unnecessary assignment
// Construct the call to Runtime_InitializeVarGlobal
// and add it to the initialization statement block.
- initialize = factory()->NewCallRuntime(
- ast_value_factory()->initialize_var_global_string(),
- Runtime::FunctionForId(Runtime::kInitializeVarGlobal), arguments,
- descriptor_->declaration_pos);
+ initialize =
+ factory()->NewCallRuntime(Runtime::kInitializeVarGlobal, arguments,
+ descriptor_->declaration_pos);
} else {
initialize = NULL;
}
@@ -312,7 +310,7 @@ void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) {
if (spread != nullptr) {
// array = [];
- // if (!done) $concatIterableToArray(array, iterator);
+ // if (!done) %concat_iterable_to_array(array, iterator);
auto empty_exprs = new (zone()) ZoneList<Expression*>(0, zone());
auto array = CreateTempVar(factory()->NewArrayLiteral(
empty_exprs,
@@ -324,9 +322,9 @@ void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) {
auto arguments = new (zone()) ZoneList<Expression*>(2, zone());
arguments->Add(factory()->NewVariableProxy(array), zone());
arguments->Add(factory()->NewVariableProxy(iterator), zone());
- auto spread_into_array_call = factory()->NewCallRuntime(
- ast_value_factory()->concat_iterable_to_array_string(), nullptr,
- arguments, RelocInfo::kNoPosition);
+ auto spread_into_array_call =
+ factory()->NewCallRuntime(Context::CONCAT_ITERABLE_TO_ARRAY_INDEX,
+ arguments, RelocInfo::kNoPosition);
auto if_statement = factory()->NewIfStatement(
factory()->NewUnaryOperation(Token::NOT,
« no previous file with comments | « src/parser.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698