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

Side by Side Diff: src/compiler.h

Issue 1372293005: [Interpreter] Support top-level code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased 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 | « no previous file | src/compiler.cc » ('j') | src/objects.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_COMPILER_H_ 5 #ifndef V8_COMPILER_H_
6 #define V8_COMPILER_H_ 6 #define V8_COMPILER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 int num_parameters() const; 166 int num_parameters() const;
167 int num_parameters_including_this() const; 167 int num_parameters_including_this() const;
168 bool is_this_defined() const; 168 bool is_this_defined() const;
169 int num_heap_slots() const; 169 int num_heap_slots() const;
170 170
171 void set_parameter_count(int parameter_count) { 171 void set_parameter_count(int parameter_count) {
172 DCHECK(IsStub()); 172 DCHECK(IsStub());
173 parameter_count_ = parameter_count; 173 parameter_count_ = parameter_count;
174 } 174 }
175 175
176 bool has_bytecode_array() const { return !bytecode_array_.is_null(); }
177 Handle<BytecodeArray> bytecode_array() const { return bytecode_array_; }
178
176 bool is_tracking_positions() const { return track_positions_; } 179 bool is_tracking_positions() const { return track_positions_; }
177 180
178 bool is_calling() const { 181 bool is_calling() const {
179 return GetFlag(kDeferredCalling) || GetFlag(kNonDeferredCalling); 182 return GetFlag(kDeferredCalling) || GetFlag(kNonDeferredCalling);
180 } 183 }
181 184
182 void MarkAsDeferredCalling() { SetFlag(kDeferredCalling); } 185 void MarkAsDeferredCalling() { SetFlag(kDeferredCalling); }
183 186
184 bool is_deferred_calling() const { return GetFlag(kDeferredCalling); } 187 bool is_deferred_calling() const { return GetFlag(kDeferredCalling); }
185 188
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() && 270 return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() &&
268 !is_debug(); 271 !is_debug();
269 } 272 }
270 273
271 void EnsureFeedbackVector(); 274 void EnsureFeedbackVector();
272 Handle<TypeFeedbackVector> feedback_vector() const { 275 Handle<TypeFeedbackVector> feedback_vector() const {
273 return feedback_vector_; 276 return feedback_vector_;
274 } 277 }
275 void SetCode(Handle<Code> code) { code_ = code; } 278 void SetCode(Handle<Code> code) { code_ = code; }
276 279
280 void SetBytecodeArray(Handle<BytecodeArray> bytecode_array) {
281 bytecode_array_ = bytecode_array;
282 }
283
277 bool ShouldTrapOnDeopt() const { 284 bool ShouldTrapOnDeopt() const {
278 return (FLAG_trap_on_deopt && IsOptimizing()) || 285 return (FLAG_trap_on_deopt && IsOptimizing()) ||
279 (FLAG_trap_on_stub_deopt && IsStub()); 286 (FLAG_trap_on_stub_deopt && IsStub());
280 } 287 }
281 288
282 bool has_global_object() const { 289 bool has_global_object() const {
283 return !closure().is_null() && 290 return !closure().is_null() &&
284 (closure()->context()->global_object() != NULL); 291 (closure()->context()->global_object() != NULL);
285 } 292 }
286 293
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 Handle<TypeFeedbackVector> feedback_vector_; 459 Handle<TypeFeedbackVector> feedback_vector_;
453 460
454 // Compilation mode flag and whether deoptimization is allowed. 461 // Compilation mode flag and whether deoptimization is allowed.
455 Mode mode_; 462 Mode mode_;
456 BailoutId osr_ast_id_; 463 BailoutId osr_ast_id_;
457 // The unoptimized code we patched for OSR may not be the shared code 464 // The unoptimized code we patched for OSR may not be the shared code
458 // afterwards, since we may need to compile it again to include deoptimization 465 // afterwards, since we may need to compile it again to include deoptimization
459 // data. Keep track which code we patched. 466 // data. Keep track which code we patched.
460 Handle<Code> unoptimized_code_; 467 Handle<Code> unoptimized_code_;
461 468
469 // Holds the bytecode array generated by the interpreter.
470 Handle<BytecodeArray> bytecode_array_;
Michael Starzinger 2015/10/07 09:53:29 As discussed offline: I am not a huge fan of this
rmcilroy 2015/10/07 10:05:37 Added TODO.
471
462 // The zone from which the compilation pipeline working on this 472 // The zone from which the compilation pipeline working on this
463 // CompilationInfo allocates. 473 // CompilationInfo allocates.
464 Zone* zone_; 474 Zone* zone_;
465 475
466 DeferredHandles* deferred_handles_; 476 DeferredHandles* deferred_handles_;
467 477
468 // Dependencies for this compilation, e.g. stable maps. 478 // Dependencies for this compilation, e.g. stable maps.
469 CompilationDependencies dependencies_; 479 CompilationDependencies dependencies_;
470 480
471 BailoutReason bailout_reason_; 481 BailoutReason bailout_reason_;
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 size_t info_zone_start_allocation_size_; 703 size_t info_zone_start_allocation_size_;
694 base::ElapsedTimer timer_; 704 base::ElapsedTimer timer_;
695 705
696 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 706 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
697 }; 707 };
698 708
699 } // namespace internal 709 } // namespace internal
700 } // namespace v8 710 } // namespace v8
701 711
702 #endif // V8_COMPILER_H_ 712 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698