Revision f230a1cf deps/v8/src/compiler.h
deps/v8/src/compiler.h | ||
---|---|---|
35 | 35 |
namespace v8 { |
36 | 36 |
namespace internal { |
37 | 37 |
|
38 |
static const int kPrologueOffsetNotSet = -1; |
|
39 |
|
|
40 | 38 |
class ScriptDataImpl; |
41 | 39 |
class HydrogenCodeStub; |
42 | 40 |
|
... | ... | |
86 | 84 |
ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } |
87 | 85 |
Handle<Context> context() const { return context_; } |
88 | 86 |
BailoutId osr_ast_id() const { return osr_ast_id_; } |
87 |
uint32_t osr_pc_offset() const { return osr_pc_offset_; } |
|
89 | 88 |
int opt_count() const { return opt_count_; } |
90 | 89 |
int num_parameters() const; |
91 | 90 |
int num_heap_slots() const; |
... | ... | |
268 | 267 |
void set_bailout_reason(BailoutReason reason) { bailout_reason_ = reason; } |
269 | 268 |
|
270 | 269 |
int prologue_offset() const { |
271 |
ASSERT_NE(kPrologueOffsetNotSet, prologue_offset_); |
|
270 |
ASSERT_NE(Code::kPrologueOffsetNotSet, prologue_offset_);
|
|
272 | 271 |
return prologue_offset_; |
273 | 272 |
} |
274 | 273 |
|
275 | 274 |
void set_prologue_offset(int prologue_offset) { |
276 |
ASSERT_EQ(kPrologueOffsetNotSet, prologue_offset_); |
|
275 |
ASSERT_EQ(Code::kPrologueOffsetNotSet, prologue_offset_);
|
|
277 | 276 |
prologue_offset_ = prologue_offset; |
278 | 277 |
} |
279 | 278 |
|
... | ... | |
505 | 504 |
// fail, bail-out to the full code generator or succeed. Apart from |
506 | 505 |
// their return value, the status of the phase last run can be checked |
507 | 506 |
// using last_status(). |
508 |
class OptimizingCompiler: public ZoneObject {
|
|
507 |
class RecompileJob: public ZoneObject {
|
|
509 | 508 |
public: |
510 |
explicit OptimizingCompiler(CompilationInfo* info)
|
|
509 |
explicit RecompileJob(CompilationInfo* info)
|
|
511 | 510 |
: info_(info), |
512 | 511 |
graph_builder_(NULL), |
513 | 512 |
graph_(NULL), |
514 | 513 |
chunk_(NULL), |
515 |
last_status_(FAILED) { } |
|
514 |
last_status_(FAILED), |
|
515 |
awaiting_install_(false) { } |
|
516 | 516 |
|
517 | 517 |
enum Status { |
518 | 518 |
FAILED, BAILED_OUT, SUCCEEDED |
... | ... | |
532 | 532 |
return SetLastStatus(BAILED_OUT); |
533 | 533 |
} |
534 | 534 |
|
535 |
void WaitForInstall() { |
|
536 |
ASSERT(info_->is_osr()); |
|
537 |
awaiting_install_ = true; |
|
538 |
} |
|
539 |
|
|
540 |
bool IsWaitingForInstall() { return awaiting_install_; } |
|
541 |
|
|
535 | 542 |
private: |
536 | 543 |
CompilationInfo* info_; |
537 | 544 |
HOptimizedGraphBuilder* graph_builder_; |
... | ... | |
541 | 548 |
TimeDelta time_taken_to_optimize_; |
542 | 549 |
TimeDelta time_taken_to_codegen_; |
543 | 550 |
Status last_status_; |
551 |
bool awaiting_install_; |
|
544 | 552 |
|
545 | 553 |
MUST_USE_RESULT Status SetLastStatus(Status status) { |
546 | 554 |
last_status_ = status; |
... | ... | |
549 | 557 |
void RecordOptimizationStats(); |
550 | 558 |
|
551 | 559 |
struct Timer { |
552 |
Timer(OptimizingCompiler* compiler, TimeDelta* location) |
|
553 |
: compiler_(compiler), |
|
554 |
location_(location) { |
|
560 |
Timer(RecompileJob* job, TimeDelta* location) |
|
561 |
: job_(job), location_(location) { |
|
555 | 562 |
ASSERT(location_ != NULL); |
556 | 563 |
timer_.Start(); |
557 | 564 |
} |
... | ... | |
560 | 567 |
*location_ += timer_.Elapsed(); |
561 | 568 |
} |
562 | 569 |
|
563 |
OptimizingCompiler* compiler_;
|
|
570 |
RecompileJob* job_;
|
|
564 | 571 |
ElapsedTimer timer_; |
565 | 572 |
TimeDelta* location_; |
566 | 573 |
}; |
... | ... | |
625 | 632 |
bool is_toplevel, |
626 | 633 |
Handle<Script> script); |
627 | 634 |
|
628 |
static Handle<Code> InstallOptimizedCode(OptimizingCompiler* info);
|
|
635 |
static Handle<Code> InstallOptimizedCode(RecompileJob* job);
|
|
629 | 636 |
|
630 | 637 |
#ifdef ENABLE_DEBUGGER_SUPPORT |
631 | 638 |
static bool MakeCodeForLiveEdit(CompilationInfo* info); |
Also available in: Unified diff