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; |