OLD | NEW |
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 Loading... |
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 prototype_string_(info->isolate()->factory()->prototype_string()), | 590 empty_fixed_array_(info->isolate()->factory()->empty_fixed_array()) { |
591 empty_fixed_array_(info->isolate()->factory()->empty_fixed_array()), | 591 AstValueFactory* ast_value_factory = info->parse_info()->ast_value_factory(); |
592 undefined_string_( | 592 const AstRawString* prototype_string = ast_value_factory->prototype_string(); |
593 info->isolate()->ast_string_constants()->undefined_string()) {} | 593 ast_value_factory->Internalize(info->isolate()); |
| 594 prototype_string_ = prototype_string->string(); |
| 595 undefined_string_ = ast_value_factory->undefined_string(); |
| 596 } |
594 | 597 |
595 Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) { | 598 Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(Isolate* isolate) { |
596 AllocateDeferredConstants(isolate); | 599 AllocateDeferredConstants(isolate); |
597 if (HasStackOverflow()) return Handle<BytecodeArray>(); | 600 if (HasStackOverflow()) return Handle<BytecodeArray>(); |
598 return builder()->ToBytecodeArray(isolate); | 601 return builder()->ToBytecodeArray(isolate); |
599 } | 602 } |
600 | 603 |
601 void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate) { | 604 void BytecodeGenerator::AllocateDeferredConstants(Isolate* isolate) { |
602 // Build global declaration pair arrays. | 605 // Build global declaration pair arrays. |
603 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { | 606 for (GlobalDeclarationsBuilder* globals_builder : global_declarations_) { |
(...skipping 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3348 } | 3351 } |
3349 | 3352 |
3350 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3353 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3351 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3354 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3352 : Runtime::kStoreKeyedToSuper_Sloppy; | 3355 : Runtime::kStoreKeyedToSuper_Sloppy; |
3353 } | 3356 } |
3354 | 3357 |
3355 } // namespace interpreter | 3358 } // namespace interpreter |
3356 } // namespace internal | 3359 } // namespace internal |
3357 } // namespace v8 | 3360 } // namespace v8 |
OLD | NEW |