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

Issue 18707: Split handle scopes into an internal version and a version accessible... (Closed)

Created:
11 years, 11 months ago by iposva
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

Split handle scopes into an internal version and a version accessible through the API. This allows us to verify state on entry through the API. In this change verification in the API entry is checking that the current thread holds the V8 lock when a HandleScope is instantiated if a v8::Locker has ever been used by the V8 instance. Committed: http://code.google.com/p/v8/source/detail?r=1140

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -146 lines) Patch
M include/v8.h View 1 2 4 chunks +14 lines, -31 lines 0 comments Download
M src/api.h View 5 chunks +8 lines, -45 lines 0 comments Download
M src/api.cc View 11 chunks +44 lines, -64 lines 0 comments Download
A src/apiutils.h View 1 chunk +69 lines, -0 lines 2 comments Download
M src/factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/handles.h View 2 chunks +72 lines, -1 line 0 comments Download
M src/handles.cc View 1 chunk +68 lines, -0 lines 0 comments Download
M src/handles-inl.h View 3 chunks +4 lines, -3 lines 0 comments Download
M src/messages.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/v8threads.cc View 1 chunk +8 lines, -0 lines 0 comments Download
tools/v8.xcodeproj/project.pbxproj View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
iposva
Minor changes to the API and some code movement to enable an internal HandleScope. Please ...
11 years, 11 months ago (2009-01-23 07:26:25 UTC) #1
Mads Ager (chromium)
LGTM. With this structure, it is easy make the locker check happen only in debug ...
11 years, 11 months ago (2009-01-23 07:59:29 UTC) #2
Christian Plesner Hansen
Under the assumption that we need assertions in release mode, LGTM. However, I'm not convinced ...
11 years, 11 months ago (2009-01-23 10:26:13 UTC) #3
iposva
11 years, 11 months ago (2009-01-23 16:39:46 UTC) #4
Please realize that the verification code is not using CHECK but it is using
ApiCheck which is already used in many places in the API. This is to avoid
crashing (which as you point out is not-desirable) but it notifies the embedding
program to deal with the error in the appropriate fashion.

-Ivan

http://codereview.chromium.org/18707/diff/215/21
File src/api.cc (right):

http://codereview.chromium.org/18707/diff/215/21#newcode77
Line 77: #define API_ENTRY_CHECK(msg) \
On 2009/01/23 07:59:29, Mads Ager wrote:
> Right align the '\'s for consistency?

Done.

http://codereview.chromium.org/18707/diff/33/232
File src/apiutils.h (right):

http://codereview.chromium.org/18707/diff/33/232#newcode31
Line 31: namespace v8 {
On 2009/01/23 10:26:13, Christian Plesner Hansen wrote:
> Shouldn't this code be in v8::internal?  Namespace v8 is for stuff that is
> visible through the api.
> 
> Also, why is this in a separate file?  Circular dependencies?

ImplementationUtilities just moved to a separate file. Which is as you suggest
due to a circular dependency.

ImplementationUtilities is in the v8 namespace because it bridges between the
v8::internal:: and v8:: namespaces. The external API refers to
ImplementationUtilities to allow friend access from v8::internal to otherwise
private declarations.

Powered by Google App Engine
This is Rietveld 408576698