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

Side by Side Diff: src/compiler.h

Issue 17827005: Get rid of ZoneScope completely. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Suggestions from danno Created 7 years, 6 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 }; 434 };
435 435
436 436
437 // Exactly like a CompilationInfo, except also creates and enters a 437 // Exactly like a CompilationInfo, except also creates and enters a
438 // Zone on construction and deallocates it on exit. 438 // Zone on construction and deallocates it on exit.
439 class CompilationInfoWithZone: public CompilationInfo { 439 class CompilationInfoWithZone: public CompilationInfo {
440 public: 440 public:
441 explicit CompilationInfoWithZone(Handle<Script> script) 441 explicit CompilationInfoWithZone(Handle<Script> script)
442 : CompilationInfo(script, &zone_, &phase_zone_), 442 : CompilationInfo(script, &zone_, &phase_zone_),
443 zone_(script->GetIsolate()), 443 zone_(script->GetIsolate()),
444 zone_scope_(&zone_, DELETE_ON_EXIT),
445 phase_zone_(script->GetIsolate()) {} 444 phase_zone_(script->GetIsolate()) {}
446 explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info) 445 explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info)
447 : CompilationInfo(shared_info, &zone_, &phase_zone_), 446 : CompilationInfo(shared_info, &zone_, &phase_zone_),
448 zone_(shared_info->GetIsolate()), 447 zone_(shared_info->GetIsolate()),
449 zone_scope_(&zone_, DELETE_ON_EXIT),
450 phase_zone_(shared_info->GetIsolate()) {} 448 phase_zone_(shared_info->GetIsolate()) {}
451 explicit CompilationInfoWithZone(Handle<JSFunction> closure) 449 explicit CompilationInfoWithZone(Handle<JSFunction> closure)
452 : CompilationInfo(closure, &zone_, &phase_zone_), 450 : CompilationInfo(closure, &zone_, &phase_zone_),
453 zone_(closure->GetIsolate()), 451 zone_(closure->GetIsolate()),
454 zone_scope_(&zone_, DELETE_ON_EXIT),
455 phase_zone_(closure->GetIsolate()) {} 452 phase_zone_(closure->GetIsolate()) {}
456 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate) 453 CompilationInfoWithZone(HydrogenCodeStub* stub, Isolate* isolate)
457 : CompilationInfo(stub, isolate, &zone_, &phase_zone_), 454 : CompilationInfo(stub, isolate, &zone_, &phase_zone_),
458 zone_(isolate), 455 zone_(isolate),
459 zone_scope_(&zone_, DELETE_ON_EXIT),
460 phase_zone_(isolate) {} 456 phase_zone_(isolate) {}
461 457
462 // Virtual destructor because a CompilationInfoWithZone has to exit the 458 // Virtual destructor because a CompilationInfoWithZone has to exit the
463 // zone scope and get rid of dependent maps even when the destructor is 459 // zone scope and get rid of dependent maps even when the destructor is
464 // called when cast as a CompilationInfo. 460 // called when cast as a CompilationInfo.
465 virtual ~CompilationInfoWithZone() { 461 virtual ~CompilationInfoWithZone() {
466 RollbackDependentMaps(); 462 RollbackDependentMaps();
467 } 463 }
468 464
469 private: 465 private:
470 Zone zone_; 466 Zone zone_;
471 ZoneScope zone_scope_;
472 Zone phase_zone_; 467 Zone phase_zone_;
473 }; 468 };
474 469
475 470
476 // A wrapper around a CompilationInfo that detaches the Handles from 471 // A wrapper around a CompilationInfo that detaches the Handles from
477 // the underlying DeferredHandleScope and stores them in info_ on 472 // the underlying DeferredHandleScope and stores them in info_ on
478 // destruction. 473 // destruction.
479 class CompilationHandleScope BASE_EMBEDDED { 474 class CompilationHandleScope BASE_EMBEDDED {
480 public: 475 public:
481 explicit CompilationHandleScope(CompilationInfo* info) 476 explicit CompilationHandleScope(CompilationInfo* info)
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 class CompilationPhase BASE_EMBEDDED { 631 class CompilationPhase BASE_EMBEDDED {
637 public: 632 public:
638 CompilationPhase(const char* name, Isolate* isolate, Zone* zone); 633 CompilationPhase(const char* name, Isolate* isolate, Zone* zone);
639 ~CompilationPhase(); 634 ~CompilationPhase();
640 635
641 protected: 636 protected:
642 bool ShouldProduceTraceOutput() const; 637 bool ShouldProduceTraceOutput() const;
643 638
644 const char* name() const { return name_; } 639 const char* name() const { return name_; }
645 Isolate* isolate() const { return isolate_; } 640 Isolate* isolate() const { return isolate_; }
646 Zone* zone() const { return zone_scope_.zone(); } 641 Zone* zone() const { return zone_; }
647 642
648 private: 643 private:
649 const char* name_; 644 const char* name_;
650 Isolate* isolate_; 645 Isolate* isolate_;
651 ZoneScope zone_scope_; 646 Zone* zone_;
652 unsigned start_allocation_size_; 647 unsigned start_allocation_size_;
653 int64_t start_ticks_; 648 int64_t start_ticks_;
654 649
655 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 650 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
656 }; 651 };
657 652
658 653
659 } } // namespace v8::internal 654 } } // namespace v8::internal
660 655
661 #endif // V8_COMPILER_H_ 656 #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