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

Issue 43020: Move InitLineEnds and GetLineNumber to handles.cc to avoid... (Closed)

Created:
11 years, 9 months ago by Kasper Lund
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Move InitLineEnds and GetLineNumber to handles.cc to avoid issues with a raw this pointer and GC. Fix issue with FlattenString where we may keep a StringShape alive across a GC. Committed: http://code.google.com/p/v8/source/detail?r=1481

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -83 lines) Patch
M src/accessors.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M src/compiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/handles.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/handles.cc View 2 chunks +73 lines, -3 lines 1 comment Download
M src/objects.h View 1 chunk +0 lines, -3 lines 0 comments Download
M src/objects.cc View 1 chunk +0 lines, -70 lines 0 comments Download
M test/cctest/test-compiler.cc View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Kasper Lund
11 years, 9 months ago (2009-03-10 14:39:05 UTC) #1
Mikhail Naganov
LGTM
11 years, 9 months ago (2009-03-10 15:00:13 UTC) #2
Mads Ager (chromium)
11 years, 9 months ago (2009-03-10 19:26:58 UTC) #3
LGTM

http://codereview.chromium.org/43020/diff/1/3
File src/handles.cc (right):

http://codereview.chromium.org/43020/diff/1/3#newcode189
Line 189:
CALL_HEAP_FUNCTION_VOID(string->TryFlattenIfNotFlat(StringShape(*string)));
I think this change makes the code much clearer (and I think we should get rid
of StringShape all together - we have talked about doing that for a while now).

I think that this code was safe the way it was though.  The only strings that
change their shape during GC are ConsStrings that have an emtpy right-hand side.
 For those strings, string->IsFlat(shape) will return true and we will bail out
before the part that can cause a GC.  For other strings, the shape is still
valid after a GC.

Anyway, this is a good change!

Powered by Google App Engine
This is Rietveld 408576698