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

Unified Diff: src/parsing/parser.cc

Issue 2324803002: [Parser] Avoid on-the-fly internalization for natives_syntax. (Closed)
Patch Set: Created 4 years, 3 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/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index e027ffc10b6548c546fec824c14082bba0504c11..4bc770398c79a2f52c2a39cead6a59011b19694c 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -515,12 +515,14 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
GetClosureScope()->ForceEagerCompilation();
}
- const Runtime::Function* function = Runtime::FunctionForName(name->string());
+ DCHECK(name->is_one_byte());
+ const Runtime::Function* function =
+ Runtime::FunctionForName(name->raw_data(), name->length());
if (function != nullptr) {
// Check for possible name clash.
DCHECK_EQ(Context::kNotFound,
- Context::IntrinsicIndexForName(name->string()));
+ Context::IntrinsicIndexForName(name->raw_data(), name->length()));
// Check for built-in IS_VAR macro.
if (function->function_id == Runtime::kIS_VAR) {
DCHECK_EQ(Runtime::RUNTIME, function->intrinsic_type);
@@ -546,7 +548,8 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
return factory()->NewCallRuntime(function, args, pos);
}
- int context_index = Context::IntrinsicIndexForName(name->string());
+ int context_index =
+ Context::IntrinsicIndexForName(name->raw_data(), name->length());
// Check that the function is defined.
if (context_index == Context::kNotFound) {
@@ -4436,12 +4439,6 @@ bool Parser::Parse(ParseInfo* info) {
DCHECK(parsing_on_main_thread_);
Isolate* isolate = info->isolate();
pre_parse_timer_ = isolate->counters()->pre_parse();
- if (FLAG_trace_parse || allow_natives() || extension_ != NULL) {
- // If intrinsics are allowed, the Parser cannot operate independent of the
- // V8 heap because of Runtime. Tell the string table to internalize strings
- // and values right after they're created.
- ast_value_factory()->Internalize(isolate);
- }
if (info->is_lazy()) {
DCHECK(!info->is_eval());
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698