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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 644 } |
645 } | 645 } |
646 | 646 |
647 // Build array literal constant elements | 647 // Build array literal constant elements |
648 for (std::pair<ArrayLiteral*, size_t> literal : array_literals_) { | 648 for (std::pair<ArrayLiteral*, size_t> literal : array_literals_) { |
649 ArrayLiteral* array_literal = literal.first; | 649 ArrayLiteral* array_literal = literal.first; |
650 Handle<ConstantElementsPair> constant_elements = | 650 Handle<ConstantElementsPair> constant_elements = |
651 array_literal->GetOrBuildConstantElements(isolate); | 651 array_literal->GetOrBuildConstantElements(isolate); |
652 builder()->InsertConstantPoolEntryAt(literal.second, constant_elements); | 652 builder()->InsertConstantPoolEntryAt(literal.second, constant_elements); |
653 } | 653 } |
654 | |
655 // TODO(leszeks): ideally there would be no path to here where feedback | |
656 // metadata is previously created, and we could create it unconditionally. | |
657 // We should investigate again once FCG has shuffled off its mortal coil. | |
658 DCHECK(info()->has_shared_info()); | |
659 TypeFeedbackMetadata::EnsureAllocated( | |
660 info()->isolate(), info()->shared_info(), | |
661 info()->literal()->feedback_vector_spec()); | |
662 } | 654 } |
663 | 655 |
664 void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) { | 656 void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) { |
665 DisallowHeapAllocation no_allocation; | 657 DisallowHeapAllocation no_allocation; |
666 DisallowHandleAllocation no_handles; | 658 DisallowHandleAllocation no_handles; |
667 DisallowHandleDereference no_deref; | 659 DisallowHandleDereference no_deref; |
668 | 660 |
669 InitializeAstVisitor(stack_limit); | 661 InitializeAstVisitor(stack_limit); |
670 | 662 |
671 // Initialize the incoming context. | 663 // Initialize the incoming context. |
(...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3359 } | 3351 } |
3360 | 3352 |
3361 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3353 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
3362 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3354 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
3363 : Runtime::kStoreKeyedToSuper_Sloppy; | 3355 : Runtime::kStoreKeyedToSuper_Sloppy; |
3364 } | 3356 } |
3365 | 3357 |
3366 } // namespace interpreter | 3358 } // namespace interpreter |
3367 } // namespace internal | 3359 } // namespace internal |
3368 } // namespace v8 | 3360 } // namespace v8 |
OLD | NEW |