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

Side by Side Diff: src/compiler.h

Issue 23710014: Introduce concurrent on-stack replacement. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 3 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 | « no previous file | 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 void AbortDueToDependencyChange() { 301 void AbortDueToDependencyChange() {
302 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread()); 302 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread());
303 abort_due_to_dependency_ = true; 303 abort_due_to_dependency_ = true;
304 } 304 }
305 305
306 bool HasAbortedDueToDependencyChange() { 306 bool HasAbortedDueToDependencyChange() {
307 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread()); 307 ASSERT(!isolate()->optimizing_compiler_thread()->IsOptimizerThread());
308 return abort_due_to_dependency_; 308 return abort_due_to_dependency_;
309 } 309 }
310 310
311 void set_osr_pc_offset(uint32_t pc_offset) {
312 osr_pc_offset_ = pc_offset;
313 }
314
315 bool HasSameOsrEntry(Handle<JSFunction> function, uint32_t pc_offset) {
316 return osr_pc_offset_ == pc_offset && function.is_identical_to(closure_);
317 }
318
311 protected: 319 protected:
312 CompilationInfo(Handle<Script> script, 320 CompilationInfo(Handle<Script> script,
313 Zone* zone); 321 Zone* zone);
314 CompilationInfo(Handle<SharedFunctionInfo> shared_info, 322 CompilationInfo(Handle<SharedFunctionInfo> shared_info,
315 Zone* zone); 323 Zone* zone);
316 CompilationInfo(HydrogenCodeStub* stub, 324 CompilationInfo(HydrogenCodeStub* stub,
317 Isolate* isolate, 325 Isolate* isolate,
318 Zone* zone); 326 Zone* zone);
319 327
320 private: 328 private:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 v8::Extension* extension_; 403 v8::Extension* extension_;
396 ScriptDataImpl* pre_parse_data_; 404 ScriptDataImpl* pre_parse_data_;
397 405
398 // The context of the caller for eval code, and the global context for a 406 // The context of the caller for eval code, and the global context for a
399 // global script. Will be a null handle otherwise. 407 // global script. Will be a null handle otherwise.
400 Handle<Context> context_; 408 Handle<Context> context_;
401 409
402 // Compilation mode flag and whether deoptimization is allowed. 410 // Compilation mode flag and whether deoptimization is allowed.
403 Mode mode_; 411 Mode mode_;
404 BailoutId osr_ast_id_; 412 BailoutId osr_ast_id_;
413 // The pc_offset corresponding to osr_ast_id_ in unoptimized code.
414 // We can look this up in the back edge table, but cache it for quick access.
415 uint32_t osr_pc_offset_;
405 416
406 // Flag whether compilation needs to be aborted due to dependency change. 417 // Flag whether compilation needs to be aborted due to dependency change.
407 bool abort_due_to_dependency_; 418 bool abort_due_to_dependency_;
408 419
409 // The zone from which the compilation pipeline working on this 420 // The zone from which the compilation pipeline working on this
410 // CompilationInfo allocates. 421 // CompilationInfo allocates.
411 Zone* zone_; 422 Zone* zone_;
412 423
413 DeferredHandles* deferred_handles_; 424 DeferredHandles* deferred_handles_;
414 425
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 Handle<Context> context, 604 Handle<Context> context,
594 bool is_global, 605 bool is_global,
595 LanguageMode language_mode, 606 LanguageMode language_mode,
596 ParseRestriction restriction, 607 ParseRestriction restriction,
597 int scope_position); 608 int scope_position);
598 609
599 // Compile from function info (used for lazy compilation). Returns true on 610 // Compile from function info (used for lazy compilation). Returns true on
600 // success and false if the compilation resulted in a stack overflow. 611 // success and false if the compilation resulted in a stack overflow.
601 static bool CompileLazy(CompilationInfo* info); 612 static bool CompileLazy(CompilationInfo* info);
602 613
603 static void RecompileConcurrent(Handle<JSFunction> function); 614 static bool RecompileConcurrent(Handle<JSFunction> function,
615 uint32_t osr_pc_offset = 0);
604 616
605 // Compile a shared function info object (the function is possibly lazily 617 // Compile a shared function info object (the function is possibly lazily
606 // compiled). 618 // compiled).
607 static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node, 619 static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node,
608 Handle<Script> script); 620 Handle<Script> script);
609 621
610 // Set the function info for a newly compiled function. 622 // Set the function info for a newly compiled function.
611 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info, 623 static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
612 FunctionLiteral* lit, 624 FunctionLiteral* lit,
613 bool is_toplevel, 625 bool is_toplevel,
614 Handle<Script> script); 626 Handle<Script> script);
615 627
616 static void InstallOptimizedCode(OptimizingCompiler* info); 628 static bool InstallOptimizedCode(OptimizingCompiler* info);
629
630 static BailoutId CompileForOnStackReplacement(Handle<JSFunction> function);
631
632 static BailoutId CompileForConcurrentOSR(Handle<JSFunction> function);
617 633
618 #ifdef ENABLE_DEBUGGER_SUPPORT 634 #ifdef ENABLE_DEBUGGER_SUPPORT
619 static bool MakeCodeForLiveEdit(CompilationInfo* info); 635 static bool MakeCodeForLiveEdit(CompilationInfo* info);
620 #endif 636 #endif
621 637
622 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, 638 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
623 CompilationInfo* info, 639 CompilationInfo* info,
624 Handle<SharedFunctionInfo> shared); 640 Handle<SharedFunctionInfo> shared);
625 }; 641 };
626 642
(...skipping 18 matching lines...) Expand all
645 unsigned info_zone_start_allocation_size_; 661 unsigned info_zone_start_allocation_size_;
646 ElapsedTimer timer_; 662 ElapsedTimer timer_;
647 663
648 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 664 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
649 }; 665 };
650 666
651 667
652 } } // namespace v8::internal 668 } } // namespace v8::internal
653 669
654 #endif // V8_COMPILER_H_ 670 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698