| 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/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 Register literal = register_allocator()->NextConsecutiveRegister(); | 794 Register literal = register_allocator()->NextConsecutiveRegister(); |
| 795 builder()->LoadLiteral(variable->name()).StoreAccumulatorInRegister(name); | 795 builder()->LoadLiteral(variable->name()).StoreAccumulatorInRegister(name); |
| 796 | 796 |
| 797 VisitForAccumulatorValue(decl->fun()); | 797 VisitForAccumulatorValue(decl->fun()); |
| 798 builder()->StoreAccumulatorInRegister(literal).CallRuntime( | 798 builder()->StoreAccumulatorInRegister(literal).CallRuntime( |
| 799 Runtime::kDeclareEvalFunction, name, 2); | 799 Runtime::kDeclareEvalFunction, name, 2); |
| 800 } | 800 } |
| 801 } | 801 } |
| 802 } | 802 } |
| 803 | 803 |
| 804 void BytecodeGenerator::VisitImportDeclaration(ImportDeclaration* decl) { | |
| 805 UNIMPLEMENTED(); | |
| 806 } | |
| 807 | |
| 808 void BytecodeGenerator::VisitDeclarations( | 804 void BytecodeGenerator::VisitDeclarations( |
| 809 ZoneList<Declaration*>* declarations) { | 805 ZoneList<Declaration*>* declarations) { |
| 810 RegisterAllocationScope register_scope(this); | 806 RegisterAllocationScope register_scope(this); |
| 811 DCHECK(globals()->empty()); | 807 DCHECK(globals()->empty()); |
| 812 for (int i = 0; i < declarations->length(); i++) { | 808 for (int i = 0; i < declarations->length(); i++) { |
| 813 RegisterAllocationScope register_scope(this); | 809 RegisterAllocationScope register_scope(this); |
| 814 Visit(declarations->at(i)); | 810 Visit(declarations->at(i)); |
| 815 } | 811 } |
| 816 if (globals()->empty()) return; | 812 if (globals()->empty()) return; |
| 817 int array_index = 0; | 813 int array_index = 0; |
| (...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3171 return execution_context()->scope()->language_mode(); | 3167 return execution_context()->scope()->language_mode(); |
| 3172 } | 3168 } |
| 3173 | 3169 |
| 3174 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3170 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
| 3175 return TypeFeedbackVector::GetIndex(slot); | 3171 return TypeFeedbackVector::GetIndex(slot); |
| 3176 } | 3172 } |
| 3177 | 3173 |
| 3178 } // namespace interpreter | 3174 } // namespace interpreter |
| 3179 } // namespace internal | 3175 } // namespace internal |
| 3180 } // namespace v8 | 3176 } // namespace v8 |
| OLD | NEW |