OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_H_ | 5 #ifndef V8_COMPILER_H_ |
6 #define V8_COMPILER_H_ | 6 #define V8_COMPILER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 | 522 |
523 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 523 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
524 }; | 524 }; |
525 | 525 |
526 | 526 |
527 // Exactly like a CompilationInfo, except also creates and enters a | 527 // Exactly like a CompilationInfo, except also creates and enters a |
528 // Zone on construction and deallocates it on exit. | 528 // Zone on construction and deallocates it on exit. |
529 class CompilationInfoWithZone: public CompilationInfo { | 529 class CompilationInfoWithZone: public CompilationInfo { |
530 public: | 530 public: |
531 explicit CompilationInfoWithZone(Handle<Script> script) | 531 explicit CompilationInfoWithZone(Handle<Script> script) |
532 : CompilationInfo(script, &zone_), | 532 : CompilationInfo(script, &zone_), zone_() {} |
Michael Starzinger
2015/01/23 14:21:10
nit: It should be possible to just drop the initia
danno
2015/01/23 14:45:19
Done.
| |
533 zone_(script->GetIsolate()) {} | |
534 explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info) | 533 explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info) |
535 : CompilationInfo(shared_info, &zone_), | 534 : CompilationInfo(shared_info, &zone_), zone_() {} |
536 zone_(shared_info->GetIsolate()) {} | |
537 explicit CompilationInfoWithZone(Handle<JSFunction> closure) | 535 explicit CompilationInfoWithZone(Handle<JSFunction> closure) |
538 : CompilationInfo(closure, &zone_), | 536 : CompilationInfo(closure, &zone_), zone_() {} |
539 zone_(closure->GetIsolate()) {} | |
540 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate) | 537 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate) |
541 : CompilationInfo(stub, isolate, &zone_), | 538 : CompilationInfo(stub, isolate, &zone_), zone_() {} |
542 zone_(isolate) {} | |
543 CompilationInfoWithZone(ScriptCompiler::ExternalSourceStream* stream, | 539 CompilationInfoWithZone(ScriptCompiler::ExternalSourceStream* stream, |
544 ScriptCompiler::StreamedSource::Encoding encoding, | 540 ScriptCompiler::StreamedSource::Encoding encoding, |
545 Isolate* isolate) | 541 Isolate* isolate) |
546 : CompilationInfo(stream, encoding, isolate, &zone_), zone_(isolate) {} | 542 : CompilationInfo(stream, encoding, isolate, &zone_) {} |
547 | 543 |
548 // Virtual destructor because a CompilationInfoWithZone has to exit the | 544 // Virtual destructor because a CompilationInfoWithZone has to exit the |
549 // zone scope and get rid of dependent maps even when the destructor is | 545 // zone scope and get rid of dependent maps even when the destructor is |
550 // called when cast as a CompilationInfo. | 546 // called when cast as a CompilationInfo. |
551 virtual ~CompilationInfoWithZone() { | 547 virtual ~CompilationInfoWithZone() { |
552 RollbackDependencies(); | 548 RollbackDependencies(); |
553 } | 549 } |
554 | 550 |
555 private: | 551 private: |
556 Zone zone_; | 552 Zone zone_; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
753 Zone zone_; | 749 Zone zone_; |
754 unsigned info_zone_start_allocation_size_; | 750 unsigned info_zone_start_allocation_size_; |
755 base::ElapsedTimer timer_; | 751 base::ElapsedTimer timer_; |
756 | 752 |
757 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 753 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
758 }; | 754 }; |
759 | 755 |
760 } } // namespace v8::internal | 756 } } // namespace v8::internal |
761 | 757 |
762 #endif // V8_COMPILER_H_ | 758 #endif // V8_COMPILER_H_ |
OLD | NEW |