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

Side by Side Diff: src/compiler.h

Issue 181543003: Proof of concept: API for doing only one parsing pass instead of first preparsing and then parsing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased -- this applies to r19832 Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/compiler.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool is_in_loop() const { return IsInLoop::decode(flags_); } 70 bool is_in_loop() const { return IsInLoop::decode(flags_); }
71 FunctionLiteral* function() const { return function_; } 71 FunctionLiteral* function() const { return function_; }
72 Scope* scope() const { return scope_; } 72 Scope* scope() const { return scope_; }
73 Scope* global_scope() const { return global_scope_; } 73 Scope* global_scope() const { return global_scope_; }
74 Handle<Code> code() const { return code_; } 74 Handle<Code> code() const { return code_; }
75 Handle<JSFunction> closure() const { return closure_; } 75 Handle<JSFunction> closure() const { return closure_; }
76 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 76 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
77 Handle<Script> script() const { return script_; } 77 Handle<Script> script() const { return script_; }
78 HydrogenCodeStub* code_stub() const {return code_stub_; } 78 HydrogenCodeStub* code_stub() const {return code_stub_; }
79 v8::Extension* extension() const { return extension_; } 79 v8::Extension* extension() const { return extension_; }
80 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } 80 ScriptDataImpl** cached_data() const { return cached_data_; }
81 Handle<Context> context() const { return context_; } 81 Handle<Context> context() const { return context_; }
82 BailoutId osr_ast_id() const { return osr_ast_id_; } 82 BailoutId osr_ast_id() const { return osr_ast_id_; }
83 Handle<Code> unoptimized_code() const { return unoptimized_code_; } 83 Handle<Code> unoptimized_code() const { return unoptimized_code_; }
84 int opt_count() const { return opt_count_; } 84 int opt_count() const { return opt_count_; }
85 int num_parameters() const; 85 int num_parameters() const;
86 int num_heap_slots() const; 86 int num_heap_slots() const;
87 Code::Flags flags() const; 87 Code::Flags flags() const;
88 88
89 void MarkAsEval() { 89 void MarkAsEval() {
90 ASSERT(!is_lazy()); 90 ASSERT(!is_lazy());
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 global_scope_ = global_scope; 176 global_scope_ = global_scope;
177 } 177 }
178 Handle<FixedArray> feedback_vector() const { 178 Handle<FixedArray> feedback_vector() const {
179 return feedback_vector_; 179 return feedback_vector_;
180 } 180 }
181 void SetCode(Handle<Code> code) { code_ = code; } 181 void SetCode(Handle<Code> code) { code_ = code; }
182 void SetExtension(v8::Extension* extension) { 182 void SetExtension(v8::Extension* extension) {
183 ASSERT(!is_lazy()); 183 ASSERT(!is_lazy());
184 extension_ = extension; 184 extension_ = extension;
185 } 185 }
186 void SetPreParseData(ScriptDataImpl* pre_parse_data) { 186 void SetCachedData(ScriptDataImpl** cached_data) {
187 ASSERT(!is_lazy()); 187 ASSERT(!is_lazy());
188 pre_parse_data_ = pre_parse_data; 188 cached_data_ = cached_data;
189 } 189 }
190 void SetContext(Handle<Context> context) { 190 void SetContext(Handle<Context> context) {
191 context_ = context; 191 context_ = context;
192 } 192 }
193 193
194 void MarkCompilingForDebugging() { 194 void MarkCompilingForDebugging() {
195 flags_ |= IsCompilingForDebugging::encode(true); 195 flags_ |= IsCompilingForDebugging::encode(true);
196 } 196 }
197 bool IsCompilingForDebugging() { 197 bool IsCompilingForDebugging() {
198 return IsCompilingForDebugging::decode(flags_); 198 return IsCompilingForDebugging::decode(flags_);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // The compiled code. 393 // The compiled code.
394 Handle<Code> code_; 394 Handle<Code> code_;
395 395
396 // Possible initial inputs to the compilation process. 396 // Possible initial inputs to the compilation process.
397 Handle<JSFunction> closure_; 397 Handle<JSFunction> closure_;
398 Handle<SharedFunctionInfo> shared_info_; 398 Handle<SharedFunctionInfo> shared_info_;
399 Handle<Script> script_; 399 Handle<Script> script_;
400 400
401 // Fields possibly needed for eager compilation, NULL by default. 401 // Fields possibly needed for eager compilation, NULL by default.
402 v8::Extension* extension_; 402 v8::Extension* extension_;
403 ScriptDataImpl* pre_parse_data_; 403 ScriptDataImpl** cached_data_;
404 404
405 // The context of the caller for eval code, and the global context for a 405 // The context of the caller for eval code, and the global context for a
406 // global script. Will be a null handle otherwise. 406 // global script. Will be a null handle otherwise.
407 Handle<Context> context_; 407 Handle<Context> context_;
408 408
409 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. 409 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo.
410 Handle<FixedArray> feedback_vector_; 410 Handle<FixedArray> feedback_vector_;
411 411
412 // Compilation mode flag and whether deoptimization is allowed. 412 // Compilation mode flag and whether deoptimization is allowed.
413 Mode mode_; 413 Mode mode_;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 int scope_position); 623 int scope_position);
624 624
625 // Compile a String source within a context. 625 // Compile a String source within a context.
626 static Handle<SharedFunctionInfo> CompileScript(Handle<String> source, 626 static Handle<SharedFunctionInfo> CompileScript(Handle<String> source,
627 Handle<Object> script_name, 627 Handle<Object> script_name,
628 int line_offset, 628 int line_offset,
629 int column_offset, 629 int column_offset,
630 bool is_shared_cross_origin, 630 bool is_shared_cross_origin,
631 Handle<Context> context, 631 Handle<Context> context,
632 v8::Extension* extension, 632 v8::Extension* extension,
633 ScriptDataImpl* pre_data, 633 ScriptDataImpl** pre_data,
634 NativesFlag is_natives_code); 634 NativesFlag is_natives_code);
635 635
636 // Create a shared function info object (the code may be lazily compiled). 636 // Create a shared function info object (the code may be lazily compiled).
637 static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node, 637 static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node,
638 Handle<Script> script); 638 Handle<Script> script);
639 639
640 enum ConcurrencyMode { NOT_CONCURRENT, CONCURRENT }; 640 enum ConcurrencyMode { NOT_CONCURRENT, CONCURRENT };
641 641
642 // Generate and return optimized code or start a concurrent optimization job. 642 // Generate and return optimized code or start a concurrent optimization job.
643 // In the latter case, return the InOptimizationQueue builtin. On failure, 643 // In the latter case, return the InOptimizationQueue builtin. On failure,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 unsigned info_zone_start_allocation_size_; 678 unsigned info_zone_start_allocation_size_;
679 ElapsedTimer timer_; 679 ElapsedTimer timer_;
680 680
681 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 681 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
682 }; 682 };
683 683
684 684
685 } } // namespace v8::internal 685 } } // namespace v8::internal
686 686
687 #endif // V8_COMPILER_H_ 687 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698