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

Issue 271873003: Restore behavior of PrepareForBreakpoints which was broken by r21145 (Closed)

Created:
6 years, 7 months ago by rmcilroy
Modified:
6 years, 7 months ago
Reviewers:
wingo, Yang
CC:
v8-dev, ulan
Visibility:
Public.

Description

Restore behavior of PrepareForBreakpoints which was broken by r21145. Rename Debug::MaybeRecompileFunctionForDebugging to EnsureFunctionHasDebugBreakSlots and ensure that it does nothing if the function is unoptimized code with debug break slots, otherwise, if the shared code has no debug break slots, it recompile that shared code and sets the function code to that shared code. Also removes two incorrect ASSERTs. R=yangguo@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=21201

Patch Set 1 #

Total comments: 2

Patch Set 2 : Change conditional #

Patch Set 3 : Update to only recompile if shared code doesn't have debug_break_slots #

Total comments: 2

Patch Set 4 : Set function code to shared #

Total comments: 4

Patch Set 5 : set_code() -> ReplaceCode() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -13 lines) Patch
M src/debug.h View 1 chunk +1 line, -1 line 0 comments Download
M src/debug.cc View 1 2 3 4 3 chunks +19 lines, -12 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
rmcilroy
As discussed, PTAL. Thanks!
6 years, 7 months ago (2014-05-08 14:18:00 UTC) #1
Yang
Not LGTM just yet. https://codereview.chromium.org/271873003/diff/1/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/1/src/debug.cc#newcode2041 src/debug.cc:2041: if (function->code()->kind() != Code::FUNCTION || ...
6 years, 7 months ago (2014-05-08 14:28:08 UTC) #2
rmcilroy
https://codereview.chromium.org/271873003/diff/1/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/1/src/debug.cc#newcode2041 src/debug.cc:2041: if (function->code()->kind() != Code::FUNCTION || On 2014/05/08 14:28:09, Yang ...
6 years, 7 months ago (2014-05-08 14:53:59 UTC) #3
Yang
On 2014/05/08 14:53:59, rmcilroy wrote: > https://codereview.chromium.org/271873003/diff/1/src/debug.cc > File src/debug.cc (right): > > https://codereview.chromium.org/271873003/diff/1/src/debug.cc#newcode2041 > ...
6 years, 7 months ago (2014-05-08 15:12:38 UTC) #4
rmcilroy
On 2014/05/08 15:12:38, Yang wrote: > On 2014/05/08 14:53:59, rmcilroy wrote: > > https://codereview.chromium.org/271873003/diff/1/src/debug.cc > ...
6 years, 7 months ago (2014-05-08 16:29:28 UTC) #5
Yang
https://codereview.chromium.org/271873003/diff/40001/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/40001/src/debug.cc#newcode2057 src/debug.cc:2057: } You need to replace the function code by ...
6 years, 7 months ago (2014-05-08 16:36:48 UTC) #6
rmcilroy
https://codereview.chromium.org/271873003/diff/40001/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/40001/src/debug.cc#newcode2057 src/debug.cc:2057: } On 2014/05/08 16:36:48, Yang wrote: > You need ...
6 years, 7 months ago (2014-05-08 16:57:16 UTC) #7
rmcilroy
6 years, 7 months ago (2014-05-08 16:57:17 UTC) #8
Yang
On 2014/05/08 16:57:17, rmcilroy wrote: Lgtm. But I think it's safer to use ReplaceCode instead ...
6 years, 7 months ago (2014-05-08 17:00:39 UTC) #9
rmcilroy
https://codereview.chromium.org/271873003/diff/60001/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/60001/src/debug.cc#newcode2067 src/debug.cc:2067: EnsureFunctionHasDebugBreakSlots(fun); Should there also be checks here to just ...
6 years, 7 months ago (2014-05-08 17:00:45 UTC) #10
Yang
https://codereview.chromium.org/271873003/diff/60001/src/debug.cc File src/debug.cc (right): https://codereview.chromium.org/271873003/diff/60001/src/debug.cc#newcode2067 src/debug.cc:2067: EnsureFunctionHasDebugBreakSlots(fun); On 2014/05/08 17:00:45, rmcilroy wrote: > Should there ...
6 years, 7 months ago (2014-05-08 17:03:49 UTC) #11
rmcilroy
> Lgtm. But I think it's safer to use ReplaceCode instead of set_code. Done https://codereview.chromium.org/271873003/diff/60001/src/debug.cc ...
6 years, 7 months ago (2014-05-08 17:45:37 UTC) #12
rmcilroy
Committed patchset #5 manually as r21201 (tree was closed).
6 years, 7 months ago (2014-05-08 18:00:34 UTC) #13
wingo
On 2014/05/08 16:36:48, Yang wrote: > https://codereview.chromium.org/271873003/diff/40001/src/debug.cc > File src/debug.cc (right): > > https://codereview.chromium.org/271873003/diff/40001/src/debug.cc#newcode2057 > ...
6 years, 7 months ago (2014-05-12 07:54:30 UTC) #14
Yang
On 2014/05/12 07:54:30, wingo wrote: > On 2014/05/08 16:36:48, Yang wrote: > > https://codereview.chromium.org/271873003/diff/40001/src/debug.cc > ...
6 years, 7 months ago (2014-05-12 07:57:09 UTC) #15
wingo
6 years, 7 months ago (2014-05-12 08:02:49 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/271873003/diff/60001/src/debug.cc
File src/debug.cc (right):

https://codereview.chromium.org/271873003/diff/60001/src/debug.cc#newcode2067
src/debug.cc:2067: EnsureFunctionHasDebugBreakSlots(fun);
On 2014/05/08 17:45:37, rmcilroy wrote:
> On 2014/05/08 17:03:49, Yang wrote:
> > On 2014/05/08 17:00:45, rmcilroy wrote:
> > > Should there also be checks here to just continue if function->shared() is
> > > toplevel or !allow_lazy_compilation like lines 2223-2224 below, or is this
> not
> > > possible for generators (I assume they can't be builtins)?  
> > 
> > Not sure about lazy compilation. I'll do some research tomorrow.
> 
> OK, I'll land as-is now, and leave investigation of whether generators and
> lazy_compilation interact to you.

Some test cases would have been nice here.  I don't think the condition
corresponding to this problem is exercised in the test suite.

Regarding generators -- it isn't possible to have a toplevel generator.  I think
however it is possible to have a generator that doesn't allow lazy compilation,
if I understand scopes.cc:AllowLazyCompilation() correctly.

Powered by Google App Engine
This is Rietveld 408576698