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

Unified Diff: src/parser.cc

Issue 373713006: Introduce code serializer/deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments and rebased 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
« no previous file with comments | « src/parser.h ('k') | src/serialize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
if (owns_store) {
// Copy the data to align it.
deserialized_data = i::NewArray<unsigned>(deserialized_data_length);
« no previous file with comments | « src/parser.h ('k') | src/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698