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

Unified Diff: src/parser.cc

Issue 373713006: Introduce code serializer/deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 261de4eed78e2021a3c8ff4dfa21dd7513bcb977..4ab9659dd2ff662f3fc4d3e09b1eb38df2cf0aee 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -182,7 +182,7 @@ void RegExpBuilder::AddQuantifierToAtom(
}
-ScriptData* ScriptData::New(const char* data, int length) {
+ScriptData* ScriptData::New(const char* data, int length, bool owns_store) {
// The length is obviously invalid.
if (length % sizeof(unsigned) != 0) {
return NULL;
@@ -190,7 +190,8 @@ ScriptData* ScriptData::New(const char* data, int length) {
int deserialized_data_length = length / sizeof(unsigned);
unsigned* deserialized_data;
- bool owns_store = reinterpret_cast<intptr_t>(data) % sizeof(unsigned) != 0;
+ owns_store =
+ owns_store || reinterpret_cast<intptr_t>(data) % sizeof(unsigned) != 0;
vogelheim 2014/07/07 15:20:00 The naming is weird: I had read the 'owns_store' p
Yang 2014/07/08 09:01:05 I'll address this in a follow-up CL.
if (owns_store) {
// Copy the data to align it.
deserialized_data = i::NewArray<unsigned>(deserialized_data_length);

Powered by Google App Engine
This is Rietveld 408576698