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

Side by Side Diff: src/compiler.h

Issue 733023003: Reland "Soft fail for invalid cache data." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix leak Created 6 years, 1 month 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
« no previous file with comments | « src/api.cc ('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 // 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 21 matching lines...) Expand all
32 32
33 class ScriptData { 33 class ScriptData {
34 public: 34 public:
35 ScriptData(const byte* data, int length); 35 ScriptData(const byte* data, int length);
36 ~ScriptData() { 36 ~ScriptData() {
37 if (owns_data_) DeleteArray(data_); 37 if (owns_data_) DeleteArray(data_);
38 } 38 }
39 39
40 const byte* data() const { return data_; } 40 const byte* data() const { return data_; }
41 int length() const { return length_; } 41 int length() const { return length_; }
42 bool rejected() const { return rejected_; }
43
44 void Reject() { rejected_ = true; }
42 45
43 void AcquireDataOwnership() { 46 void AcquireDataOwnership() {
44 DCHECK(!owns_data_); 47 DCHECK(!owns_data_);
45 owns_data_ = true; 48 owns_data_ = true;
46 } 49 }
47 50
48 void ReleaseDataOwnership() { 51 void ReleaseDataOwnership() {
49 DCHECK(owns_data_); 52 DCHECK(owns_data_);
50 owns_data_ = false; 53 owns_data_ = false;
51 } 54 }
52 55
53 private: 56 private:
54 bool owns_data_; 57 bool owns_data_ : 1;
58 bool rejected_ : 1;
55 const byte* data_; 59 const byte* data_;
56 int length_; 60 int length_;
57 61
58 DISALLOW_COPY_AND_ASSIGN(ScriptData); 62 DISALLOW_COPY_AND_ASSIGN(ScriptData);
59 }; 63 };
60 64
61 // CompilationInfo encapsulates some information known at compile time. It 65 // CompilationInfo encapsulates some information known at compile time. It
62 // is constructed based on the resources available at compile-time. 66 // is constructed based on the resources available at compile-time.
63 class CompilationInfo { 67 class CompilationInfo {
64 public: 68 public:
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 Zone zone_; 751 Zone zone_;
748 unsigned info_zone_start_allocation_size_; 752 unsigned info_zone_start_allocation_size_;
749 base::ElapsedTimer timer_; 753 base::ElapsedTimer timer_;
750 754
751 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 755 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
752 }; 756 };
753 757
754 } } // namespace v8::internal 758 } } // namespace v8::internal
755 759
756 #endif // V8_COMPILER_H_ 760 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698