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

Issue 159587: Allocate global object as a normalized object (Closed)

Created:
11 years, 4 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
Reviewers:
Kasper Lund
CC:
v8-dev
Visibility:
Public.

Description

Allocate global object as a normalized object. The global object is now allocated and initialized as a normalized object. Committed: http://code.google.com/p/v8/source/detail?r=2582

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 7

Patch Set 3 : '' #

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -25 lines) Patch
M src/heap.cc View 1 2 3 2 chunks +53 lines, -10 lines 0 comments Download
M src/objects.cc View 5 chunks +4 lines, -15 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Thygesen Gjesse
I will run layout tests with this patch. http://codereview.chromium.org/159587/diff/1001/11 File src/heap.cc (right): http://codereview.chromium.org/159587/diff/1001/11#newcode2165 Line 2165: ...
11 years, 4 months ago (2009-07-29 13:45:43 UTC) #1
Kasper Lund
LGTM, but: http://codereview.chromium.org/159587/diff/1001/11 File src/heap.cc (right): http://codereview.chromium.org/159587/diff/1001/11#newcode2106 Line 2106: ASSERT(map->instance_type() != JS_FUNCTION_TYPE); Maybe avoid using ...
11 years, 4 months ago (2009-07-29 14:00:51 UTC) #2
Søren Thygesen Gjesse
11 years, 4 months ago (2009-07-30 07:32:19 UTC) #3
http://codereview.chromium.org/159587/diff/1001/11
File src/heap.cc (right):

http://codereview.chromium.org/159587/diff/1001/11#newcode2106
Line 2106: ASSERT(map->instance_type() != JS_FUNCTION_TYPE);
On 2009/07/29 14:00:51, Kasper Lund wrote:
> Maybe avoid using this for allocating global objects and extend the assert to
> check that we don't?

Good point, JS_GLOBAL_OBJECT_TYPE and JS_BUILTINS_OBJECT_TYPE is now also
asserted to be not allocated this way. Also removed the initial_properties
parameter again as it has no use when the global objects are not allocated this
way.

http://codereview.chromium.org/159587/diff/1001/11#newcode2165
Line 2165: StringDictionary::Allocate(map->NumberOfDescribedProperties() * 2 +
4);
On 2009/07/29 14:00:51, Kasper Lund wrote:
> I think you're right: A bigger size would be good here. Maybe you should try
to
> count the number of resizes we do when running the bootstrapping code (maybe
try
> to use Date too to get that lazy loaded).

After measuring the sizes after bootstrapping is complete the initial size of
JS_GLOBAL_OBJECT_TYPE and JS_BUILTINS_OBJECT_TYPE is 64 and 512 respectively.

http://codereview.chromium.org/159587/diff/1001/11#newcode2171
Line 2171: Object* result = AllocateJSObjectFromMap(map, TENURED, dictionary);
On 2009/07/29 14:00:51, Kasper Lund wrote:
> Have you considered not using AlloacteJSObjectFromMap, but just call Allocate
> and InitializeJSObjectFromMap directly from here? That way, you wouldn't have
to
> pass the initial_properties all the time...

Done.

Powered by Google App Engine
This is Rietveld 408576698