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

Side by Side Diff: src/compiler.h

Issue 724023002: Soft fail for invalid cache data. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use flag to indicate rejection 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
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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 Zone zone_; 752 Zone zone_;
749 unsigned info_zone_start_allocation_size_; 753 unsigned info_zone_start_allocation_size_;
750 base::ElapsedTimer timer_; 754 base::ElapsedTimer timer_;
751 755
752 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); 756 DISALLOW_COPY_AND_ASSIGN(CompilationPhase);
753 }; 757 };
754 758
755 } } // namespace v8::internal 759 } } // namespace v8::internal
756 760
757 #endif // V8_COMPILER_H_ 761 #endif // V8_COMPILER_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.cc » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698