From 6d163d9fd0fdef82558944f505f6773824bb2bee Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Fri, 27 Nov 2009 14:10:48 +0000 Subject: [PATCH] Remove usage of JSArray in Script object Storing a JSArray in the Script object could cause an indirect reference from the compilation cache to a global object to be created. Now the line ends are only stored as a FixedArrya and when that is needed in JavaScript a JSArray copy is created. Changed some of the JavaScript code to cache the line ends in a local variable for better performance. BUG=http://code.google.com/p/v8/issues/detail?id=528 TEST=test/test-api/Bug528 Review URL: http://codereview.chromium.org/434117 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 4 ++-- src/accessors.cc | 13 +++++-------- src/api.cc | 4 ++-- src/factory.cc | 3 +-- src/handles.cc | 12 ++++++------ src/messages.js | 24 ++++++++++++++---------- src/objects-debug.cc | 9 +++------ src/objects-inl.h | 3 +-- src/objects.h | 17 +++-------------- test/cctest/test-api.cc | 22 ++-------------------- test/cctest/test-debug.cc | 8 ++++---- 11 files changed, 43 insertions(+), 76 deletions(-) diff --git a/include/v8.h b/include/v8.h index f679b0e..a8ee8d4 100644 --- a/include/v8.h +++ b/include/v8.h @@ -598,7 +598,7 @@ class V8EXPORT Script { * with the debugger as this data object is only available through the * debugger API. */ - void SetData(Handle data); + void SetData(Handle data); }; @@ -2634,7 +2634,7 @@ class V8EXPORT Context { * with the debugger to provide additional information on the context through * the debugger API. */ - void SetData(Handle data); + void SetData(Handle data); Local GetData(); /** diff --git a/src/accessors.cc b/src/accessors.cc index 734c364..09a3886 100644 --- a/src/accessors.cc +++ b/src/accessors.cc @@ -315,14 +315,11 @@ Object* Accessors::ScriptGetLineEnds(Object* object, void*) { HandleScope scope; Handle