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

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

Issue 1372293005: [Interpreter] Support top-level code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add Todos. Created 5 years, 2 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/compiler.cc ('k') | src/interpreter/interpreter.cc » ('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 <stack> 7 #include <stack>
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/control-flow-builders.h" 10 #include "src/interpreter/control-flow-builders.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 100
101 BytecodeGenerator::~BytecodeGenerator() {} 101 BytecodeGenerator::~BytecodeGenerator() {}
102 102
103 103
104 Handle<BytecodeArray> BytecodeGenerator::MakeBytecode(CompilationInfo* info) { 104 Handle<BytecodeArray> BytecodeGenerator::MakeBytecode(CompilationInfo* info) {
105 set_info(info); 105 set_info(info);
106 set_scope(info->scope()); 106 set_scope(info->scope());
107 107
108 // This a temporary guard (oth).
109 DCHECK(scope()->is_function_scope());
110
111 builder()->set_parameter_count(info->num_parameters_including_this()); 108 builder()->set_parameter_count(info->num_parameters_including_this());
112 builder()->set_locals_count(scope()->num_stack_slots()); 109 builder()->set_locals_count(scope()->num_stack_slots());
113 110
114 // Visit implicit declaration of the function name. 111 // Visit implicit declaration of the function name.
115 if (scope()->is_function_scope() && scope()->function() != NULL) { 112 if (scope()->is_function_scope() && scope()->function() != NULL) {
116 VisitVariableDeclaration(scope()->function()); 113 VisitVariableDeclaration(scope()->function());
117 } 114 }
118 115
119 // Visit declarations within the function scope. 116 // Visit declarations within the function scope.
120 VisitDeclarations(scope()->declarations()); 117 VisitDeclarations(scope()->declarations());
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 732 }
736 733
737 734
738 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 735 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
739 return info()->feedback_vector()->GetIndex(slot); 736 return info()->feedback_vector()->GetIndex(slot);
740 } 737 }
741 738
742 } // namespace interpreter 739 } // namespace interpreter
743 } // namespace internal 740 } // namespace internal
744 } // namespace v8 741 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698