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

Side by Side Diff: src/parser.h

Issue 214883002: Two-threaded parser (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 6 years, 8 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
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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok); 783 IterationStatement* LookupContinueTarget(Handle<String> label, bool* ok);
784 784
785 void RegisterTargetUse(Label* target, Target* stop); 785 void RegisterTargetUse(Label* target, Target* stop);
786 786
787 // Factory methods. 787 // Factory methods.
788 788
789 Scope* NewScope(Scope* parent, ScopeType type); 789 Scope* NewScope(Scope* parent, ScopeType type);
790 790
791 Handle<String> LookupCachedSymbol(int symbol_id); 791 Handle<String> LookupCachedSymbol(int symbol_id);
792 792
793 // Skip over a lazy function, either using cached data if we have it, or 793 // Skip over a lazy function, either using cached data if we have it, or by
794 // by parsing the function with PreParser. Consumes the ending }. 794 // parsing the function with PreParser. After returning, the position is just
795 // before the ending }.
795 void SkipLazyFunctionBody(Handle<String> function_name, 796 void SkipLazyFunctionBody(Handle<String> function_name,
797 int function_block_pos,
796 int* materialized_literal_count, 798 int* materialized_literal_count,
797 int* expected_property_count, 799 int* expected_property_count,
800 StrictMode* strict_mode,
798 bool* ok); 801 bool* ok);
799 802
803 void ProcessErrorFromRecorder(PreParser::PreParseResult result,
804 const SingletonLogger* logger, bool* ok);
805
800 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser( 806 PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser(
801 SingletonLogger* logger); 807 SingletonLogger* logger);
802 808
803 // Consumes the ending }. 809 // Consumes the ending }.
804 ZoneList<Statement*>* ParseEagerFunctionBody(Handle<String> function_name, 810 ZoneList<Statement*>* ParseEagerFunctionBody(Handle<String> function_name,
805 int pos, 811 int pos,
806 Variable* fvar, 812 Variable* fvar,
807 Token::Value fvar_init_op, 813 Token::Value fvar_init_op,
808 bool is_generator, 814 bool is_generator,
809 bool* ok); 815 bool* ok);
810 816
817 // If possible, starts a background task for doing a fast pass over the script
818 // to find lazy functions with PreParser. Restrictions: 1) PreParser cannot
819 // yet parse everything that Parser can (e.g., harmony modules). So here we
820 // are on the safe side, and only use the FastParserThread when we're sure
821 // that the script is good (i.e., for scripts for which we produce cached
822 // data). TODO(marja): Use background tasks for other kinds of compilations
823 // too. 2) The thread cannot use the Isolate, or Handles, so this will only
824 // work if the actual data is kept outside the V8 heap as an external string.
825 void StartFastParserTaskIfPossible(Handle<String> source);
826 void FinishFastParserTask();
827
811 Isolate* isolate_; 828 Isolate* isolate_;
812 ZoneList<Handle<String> > symbol_cache_; 829 ZoneList<Handle<String> > symbol_cache_;
813 830
814 Handle<Script> script_; 831 Handle<Script> script_;
815 Scanner scanner_; 832 Scanner scanner_;
816 PreParser* reusable_preparser_; 833 PreParser* reusable_preparser_;
817 Scope* original_scope_; // for ES5 function declarations in sloppy eval 834 Scope* original_scope_; // for ES5 function declarations in sloppy eval
818 Target* target_stack_; // for break, continue statements 835 Target* target_stack_; // for break, continue statements
819 ScriptData** cached_data_; 836 ScriptData** cached_data_;
820 CachedDataMode cached_data_mode_; 837 CachedDataMode cached_data_mode_;
(...skipping 26 matching lines...) Expand all
847 private: 864 private:
848 static const int kLiteralTypeSlot = 0; 865 static const int kLiteralTypeSlot = 0;
849 static const int kElementsSlot = 1; 866 static const int kElementsSlot = 1;
850 867
851 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 868 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
852 }; 869 };
853 870
854 } } // namespace v8::internal 871 } } // namespace v8::internal
855 872
856 #endif // V8_PARSER_H_ 873 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/parser.cc » ('j') | src/parser-thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698