Chromium Code Reviews| 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( | |
|
Michael Starzinger
2017/01/16 15:28:41
Some follow-up questions:
1) Would it be possible
Leszek Swirski
2017/01/16 16:28:03
I'm hesitant, could this interact badly with --alw
| |
| 660 info()->isolate(), info()->shared_info(), | |
| 661 info()->literal()->feedback_vector_spec()); | |
| 654 } | 662 } |
| 655 | 663 |
| 656 void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) { | 664 void BytecodeGenerator::GenerateBytecode(uintptr_t stack_limit) { |
| 657 DisallowHeapAllocation no_allocation; | 665 DisallowHeapAllocation no_allocation; |
| 658 DisallowHandleAllocation no_handles; | 666 DisallowHandleAllocation no_handles; |
| 659 DisallowHandleDereference no_deref; | 667 DisallowHandleDereference no_deref; |
| 660 | 668 |
| 661 InitializeAstVisitor(stack_limit); | 669 InitializeAstVisitor(stack_limit); |
| 662 | 670 |
| 663 // Initialize the incoming context. | 671 // Initialize the incoming context. |
| (...skipping 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3349 } | 3357 } |
| 3350 | 3358 |
| 3351 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { | 3359 Runtime::FunctionId BytecodeGenerator::StoreKeyedToSuperRuntimeId() { |
| 3352 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict | 3360 return is_strict(language_mode()) ? Runtime::kStoreKeyedToSuper_Strict |
| 3353 : Runtime::kStoreKeyedToSuper_Sloppy; | 3361 : Runtime::kStoreKeyedToSuper_Sloppy; |
| 3354 } | 3362 } |
| 3355 | 3363 |
| 3356 } // namespace interpreter | 3364 } // namespace interpreter |
| 3357 } // namespace internal | 3365 } // namespace internal |
| 3358 } // namespace v8 | 3366 } // namespace v8 |
| OLD | NEW |