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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2630343002: [Parser] Introduce AstStringConstants to share constants across AstValueFactory (Closed)
Patch Set: Fix test Created 3 years, 11 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/heap-symbols.h ('k') | src/isolate.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/builtins/builtins-constructor.h" 9 #include "src/builtins/builtins-constructor.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 object_literals_(0, info->zone()), 580 object_literals_(0, info->zone()),
581 array_literals_(0, info->zone()), 581 array_literals_(0, info->zone()),
582 execution_control_(nullptr), 582 execution_control_(nullptr),
583 execution_context_(nullptr), 583 execution_context_(nullptr),
584 execution_result_(nullptr), 584 execution_result_(nullptr),
585 generator_resume_points_(info->literal()->yield_count(), info->zone()), 585 generator_resume_points_(info->literal()->yield_count(), info->zone()),
586 generator_state_(), 586 generator_state_(),
587 loop_depth_(0), 587 loop_depth_(0),
588 home_object_symbol_(info->isolate()->factory()->home_object_symbol()), 588 home_object_symbol_(info->isolate()->factory()->home_object_symbol()),
589 iterator_symbol_(info->isolate()->factory()->iterator_symbol()), 589 iterator_symbol_(info->isolate()->factory()->iterator_symbol()),
590 empty_fixed_array_(info->isolate()->factory()->empty_fixed_array()) { 590 prototype_string_(info->isolate()->factory()->prototype_string()),
591 AstValueFactory* ast_value_factory = info->parse_info()->ast_value_factory(); 591 empty_fixed_array_(info->isolate()->factory()->empty_fixed_array()),
592 const AstRawString* prototype_string = ast_value_factory->prototype_string(); 592 undefined_string_(
593 ast_value_factory->Internalize(info->isolate()); 593 info->isolate()->ast_string_constants()->undefined_string()) {}
594 prototype_string_ = prototype_string->string();
595 undefined_string_ = ast_value_factory->undefined_string();
596 }
597 594
598 Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) { 595 Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) {
599 AllocateDeferredConstants(isolate); 596 AllocateDeferredConstants(isolate);
600 if (HasStackOverflow()) return Handle<BytecodeArray>(); 597 if (HasStackOverflow()) return Handle<BytecodeArray>();
601 return builder()->ToBytecodeArray(isolate); 598 return builder()->ToBytecodeArray(isolate);
602 } 599 }
603 600
604 void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate) { 601 void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate) {
605 // Build global declaration pair arrays. 602 // Build global declaration pair arrays.
606 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { 603 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) {
(...skipping 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after
3351 } 3348 }
3352 3349
3353 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { 3350 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() {
3354 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict 3351 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict
3355 : Runtime::kStoreKeyedToSuper_Sloppy; 3352 : Runtime::kStoreKeyedToSuper_Sloppy;
3356 } 3353 }
3357 3354
3358 } // namespace interpreter 3355 } // namespace interpreter
3359 } // namespace internal 3356 } // namespace internal
3360 } // namespace v8 3357 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap-symbols.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698