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

Side by Side Diff: src/compiler.h

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: 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/collection.js ('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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 ParseRestriction parse_restriction() const { 170 ParseRestriction parse_restriction() const {
171 return ParseRestricitonField::decode(flags_); 171 return ParseRestricitonField::decode(flags_);
172 } 172 }
173 173
174 void SetFunction(FunctionLiteral* literal) { 174 void SetFunction(FunctionLiteral* literal) {
175 ASSERT(function_ == NULL); 175 ASSERT(function_ == NULL);
176 function_ = literal; 176 function_ = literal;
177 } 177 }
178 void SetScope(Scope* scope) { 178 // When the scope is applied, we may have deferred work to do on the function.
179 ASSERT(scope_ == NULL); 179 void PrepareForCompilation(Scope* scope);
180 scope_ = scope;
181 }
182 void SetGlobalScope(Scope* global_scope) { 180 void SetGlobalScope(Scope* global_scope) {
183 ASSERT(global_scope_ == NULL); 181 ASSERT(global_scope_ == NULL);
184 global_scope_ = global_scope; 182 global_scope_ = global_scope;
185 } 183 }
186 void SetCode(Handle<Code> code) { code_ = code; } 184 void SetCode(Handle<Code> code) { code_ = code; }
187 void SetExtension(v8::Extension* extension) { 185 void SetExtension(v8::Extension* extension) {
188 ASSERT(!is_lazy()); 186 ASSERT(!is_lazy());
189 extension_ = extension; 187 extension_ = extension;
190 } 188 }
191 void SetPreParseData(ScriptDataImpl* pre_parse_data) { 189 void SetPreParseData(ScriptDataImpl* pre_parse_data) {
(...skipping 30 matching lines...) Expand all
222 220
223 // Accessors for the different compilation modes. 221 // Accessors for the different compilation modes.
224 bool IsOptimizing() const { return mode_ == OPTIMIZE; } 222 bool IsOptimizing() const { return mode_ == OPTIMIZE; }
225 bool IsOptimizable() const { return mode_ == BASE; } 223 bool IsOptimizable() const { return mode_ == BASE; }
226 bool IsStub() const { return mode_ == STUB; } 224 bool IsStub() const { return mode_ == STUB; }
227 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) { 225 void SetOptimizing(BailoutId osr_ast_id, Handle<Code> unoptimized) {
228 ASSERT(!shared_info_.is_null()); 226 ASSERT(!shared_info_.is_null());
229 SetMode(OPTIMIZE); 227 SetMode(OPTIMIZE);
230 osr_ast_id_ = osr_ast_id; 228 osr_ast_id_ = osr_ast_id;
231 unoptimized_code_ = unoptimized; 229 unoptimized_code_ = unoptimized;
230 optimization_id_ = isolate()->NextOptimizationId();
232 } 231 }
233 void DisableOptimization(); 232 void DisableOptimization();
234 233
235 // Deoptimization support. 234 // Deoptimization support.
236 bool HasDeoptimizationSupport() const { 235 bool HasDeoptimizationSupport() const {
237 return SupportsDeoptimization::decode(flags_); 236 return SupportsDeoptimization::decode(flags_);
238 } 237 }
239 void EnableDeoptimizationSupport() { 238 void EnableDeoptimizationSupport() {
240 ASSERT(IsOptimizable()); 239 ASSERT(IsOptimizable());
241 flags_ |= SupportsDeoptimization::encode(true); 240 flags_ |= SupportsDeoptimization::encode(true);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 309
311 bool HasAbortedDueToDependencyChange() { 310 bool HasAbortedDueToDependencyChange() {
312 ASSERT(!OptimizingCompilerThread::IsOptimizerThread(isolate())); 311 ASSERT(!OptimizingCompilerThread::IsOptimizerThread(isolate()));
313 return abort_due_to_dependency_; 312 return abort_due_to_dependency_;
314 } 313 }
315 314
316 bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) { 315 bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) {
317 return osr_ast_id_ == osr_ast_id && function.is_identical_to(closure_); 316 return osr_ast_id_ == osr_ast_id && function.is_identical_to(closure_);
318 } 317 }
319 318
319 int optimization_id() const { return optimization_id_; }
320
320 protected: 321 protected:
321 CompilationInfo(Handle<Script> script, 322 CompilationInfo(Handle<Script> script,
322 Zone* zone); 323 Zone* zone);
323 CompilationInfo(Handle<SharedFunctionInfo> shared_info, 324 CompilationInfo(Handle<SharedFunctionInfo> shared_info,
324 Zone* zone); 325 Zone* zone);
325 CompilationInfo(HydrogenCodeStub* stub, 326 CompilationInfo(HydrogenCodeStub* stub,
326 Isolate* isolate, 327 Isolate* isolate,
327 Zone* zone); 328 Zone* zone);
328 329
329 private: 330 private:
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // during graph optimization. 446 // during graph optimization.
446 int opt_count_; 447 int opt_count_;
447 448
448 // Number of parameters used for compilation of stubs that require arguments. 449 // Number of parameters used for compilation of stubs that require arguments.
449 int parameter_count_; 450 int parameter_count_;
450 451
451 bool this_has_uses_; 452 bool this_has_uses_;
452 453
453 Handle<Foreign> object_wrapper_; 454 Handle<Foreign> object_wrapper_;
454 455
456 int optimization_id_;
457
455 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); 458 DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
456 }; 459 };
457 460
458 461
459 // Exactly like a CompilationInfo, except also creates and enters a 462 // Exactly like a CompilationInfo, except also creates and enters a
460 // Zone on construction and deallocates it on exit. 463 // Zone on construction and deallocates it on exit.
461 class CompilationInfoWithZone: public CompilationInfo { 464 class CompilationInfoWithZone: public CompilationInfo {
462 public: 465 public:
463 explicit CompilationInfoWithZone(Handle<Script> script) 466 explicit CompilationInfoWithZone(Handle<Script> script)
464 : CompilationInfo(script, &zone_), 467 : CompilationInfo(script, &zone_),
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 unsigned info_zone_start_allocation_size_; 679 unsigned info_zone_start_allocation_size_;
677 ElapsedTimer timer_; 680 ElapsedTimer timer_;
678 681
679 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 682 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
680 }; 683 };
681 684
682 685
683 } } // namespace v8::internal 686 } } // namespace v8::internal
684 687
685 #endif // V8_COMPILER_H_ 688 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/collection.js ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698