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

Side by Side Diff: src/parser.h

Issue 781203003: Handle invalid parser cache gracefully (move invalid cache handling to embedder). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: streaminglining the test Created 6 years 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 | « no previous file | src/parser.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_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_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/compiler.h" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void Initialize(); 71 void Initialize();
72 FunctionEntry GetFunctionEntry(int start); 72 FunctionEntry GetFunctionEntry(int start);
73 int FunctionCount(); 73 int FunctionCount();
74 74
75 bool HasError(); 75 bool HasError();
76 76
77 unsigned* Data() { // Writable data as unsigned int array. 77 unsigned* Data() { // Writable data as unsigned int array.
78 return reinterpret_cast<unsigned*>(const_cast<byte*>(script_data_->data())); 78 return reinterpret_cast<unsigned*>(const_cast<byte*>(script_data_->data()));
79 } 79 }
80 80
81 void Reject() { script_data_->Reject(); }
82
83 bool rejected() const { return script_data_->rejected(); }
84
81 private: 85 private:
82 explicit ParseData(ScriptData* script_data) : script_data_(script_data) {} 86 explicit ParseData(ScriptData* script_data) : script_data_(script_data) {}
83 87
84 bool IsSane(); 88 bool IsSane();
85 unsigned Magic(); 89 unsigned Magic();
86 unsigned Version(); 90 unsigned Version();
87 int FunctionsSize(); 91 int FunctionsSize();
88 int Length() const { 92 int Length() const {
89 // Script data length is already checked to be a multiple of unsigned size. 93 // Script data length is already checked to be a multiple of unsigned size.
90 return script_data_->length() / sizeof(unsigned); 94 return script_data_->length() / sizeof(unsigned);
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } 1000 }
997 1001
998 1002
999 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, 1003 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state,
1000 int start, Expression* tag) { 1004 int start, Expression* tag) {
1001 return parser_->CloseTemplateLiteral(state, start, tag); 1005 return parser_->CloseTemplateLiteral(state, start, tag);
1002 } 1006 }
1003 } } // namespace v8::internal 1007 } } // namespace v8::internal
1004 1008
1005 #endif // V8_PARSER_H_ 1009 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698