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

Unified Diff: src/handles.cc

Issue 5148002: Store script's line ends in copy-on-write fixed array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address problems with empty fixed array Created 10 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/accessors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index 7a46bc3ea251fc6232b769ee0c4232c279306ae2..1364951b714ceb2c87731312f77ff1427ad98f5f 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -499,6 +499,10 @@ void InitScriptLineEnds(Handle<Script> script) {
Handle<FixedArray> array = CalculateLineEnds(src, true);
+ if (*array != Heap::empty_fixed_array()) {
+ array->set_map(Heap::fixed_cow_array_map());
+ }
+
script->set_line_ends(*array);
ASSERT(script->line_ends()->IsFixedArray());
}
« no previous file with comments | « src/accessors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698