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

Unified Diff: src/serialize.h

Issue 724053004: Revert "Soft fail for invalid cache data." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 1c781139b5a6a0cf1092261bcaff9ffc15247913..d7a6c7fa30b6ea3b1ef01f5e7a9834d03acdff7c 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -706,7 +706,7 @@ class CodeSerializer : public Serializer {
Handle<String> source);
MUST_USE_RESULT static MaybeHandle<SharedFunctionInfo> Deserialize(
- Isolate* isolate, ScriptData* cached_data, Handle<String> source);
+ Isolate* isolate, ScriptData* data, Handle<String> source);
static const int kSourceObjectIndex = 0;
static const int kCodeStubsBaseIndex = 1;
@@ -757,14 +757,10 @@ class CodeSerializer : public Serializer {
class SerializedCodeData {
public:
// Used by when consuming.
- static SerializedCodeData* FromCachedData(ScriptData* cached_data,
- String* source) {
+ explicit SerializedCodeData(ScriptData* data, String* source)
+ : script_data_(data), owns_script_data_(false) {
DisallowHeapAllocation no_gc;
- SerializedCodeData* scd = new SerializedCodeData(cached_data);
- if (scd->IsSane(source)) return scd;
- cached_data->Reject();
- delete scd;
- return NULL;
+ CHECK(IsSane(source));
}
// Used when producing.
@@ -826,9 +822,6 @@ class SerializedCodeData {
}
private:
- explicit SerializedCodeData(ScriptData* data)
- : script_data_(data), owns_script_data_(false) {}
-
void SetHeaderValue(int offset, int value) {
reinterpret_cast<int*>(const_cast<byte*>(script_data_->data()))[offset] =
value;
« no previous file with comments | « src/parser.cc ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698