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

Issue 101763003: Replace 'operator*' with explicit 'get' method on SmartPointer (Closed)

Created:
7 years ago by yurys
Modified:
7 years ago
CC:
v8-dev
Visibility:
Public.

Description

Replace 'operator*' with explicit 'get' method on SmartPointer Made operator* return reference to the raw type, not pointer. New method 'get()' should be used when raw pointer is needed. Also removed useless inline modifier from the SmaprtPointer methods and added const modifier to the methods that don't change smart pointer. Made ~SmartPointerBase protected to avoid accidental calls of the non-virtual base class's destructor. drive-by: fixed use after free in src/factory.cc BUG=None LOG=N R=alph@chromium.org, svenpanne@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=18275

Patch Set 1 #

Total comments: 7

Patch Set 2 : Made ~SmartPointerBase protected #

Patch Set 3 : Made ~SmartPointerBase protected #

Patch Set 4 : Reupload to make rietveld happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -185 lines) Patch
M src/arm/lithium-arm.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M src/code-stubs.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M src/code-stubs-hydrogen.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/codegen.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/compiler.cc View 6 chunks +11 lines, -11 lines 0 comments Download
M src/d8-debug.h View 1 chunk +1 line, -1 line 0 comments Download
M src/d8-debug.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/debug-agent.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/deoptimizer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/disassembler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/factory.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M src/flags.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/frames.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/gdb-jit.cc View 6 chunks +7 lines, -6 lines 0 comments Download
M src/heap-profiler.h View 2 chunks +8 lines, -4 lines 0 comments Download
M src/heap-profiler.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/heap-snapshot-generator.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/hydrogen.cc View 6 chunks +11 lines, -9 lines 0 comments Download
M src/hydrogen-dce.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/hydrogen-gvn.cc View 5 chunks +7 lines, -7 lines 0 comments Download
M src/hydrogen-instructions.cc View 4 chunks +9 lines, -5 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M src/isolate.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M src/jsregexp.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/lithium-allocator.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/log.cc View 11 chunks +16 lines, -14 lines 0 comments Download
M src/messages.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M src/mips/lithium-mips.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M src/objects.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/parser.cc View 6 chunks +6 lines, -6 lines 0 comments Download
M src/regexp-macro-assembler-tracer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/scopes.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/smart-pointers.h View 1 6 chunks +25 lines, -22 lines 0 comments Download
M src/stub-cache.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/x64/lithium-x64.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/test-api.cc View 1 chunk +2 lines, -1 line 0 comments Download
M test/cctest/test-cpu-profiler.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M test/cctest/test-debug.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-declarative-accessors.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M test/cctest/test-func-name-inference.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-heap-profiler.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/test-parsing.cc View 5 chunks +8 lines, -8 lines 0 comments Download
M test/cctest/test-regexp.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/test-reloc-info.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/test-strings.cc View 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
yurys
7 years ago (2013-12-03 13:05:00 UTC) #1
alph
lgtm https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode87 src/smart-pointers.h:87: ASSERT(p_ == NULL || p_ != new_value); maybe: ...
7 years ago (2013-12-03 14:15:03 UTC) #2
yurys
https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode87 src/smart-pointers.h:87: ASSERT(p_ == NULL || p_ != new_value); On 2013/12/03 ...
7 years ago (2013-12-03 14:28:19 UTC) #3
svenpanne
https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54 src/smart-pointers.h:54: ~SmartPointerBase() { if (p_) Deallocator::Delete(p_); } Hmmm, this has ...
7 years ago (2013-12-03 16:17:55 UTC) #4
yurys
https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54 src/smart-pointers.h:54: ~SmartPointerBase() { if (p_) Deallocator::Delete(p_); } On 2013/12/03 16:17:55, ...
7 years ago (2013-12-04 07:34:01 UTC) #5
Sven Panne
https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54 src/smart-pointers.h:54: ~SmartPointerBase() { if (p_) Deallocator::Delete(p_); } On 2013/12/04 07:34:01, ...
7 years ago (2013-12-04 07:40:56 UTC) #6
alph
https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h File src/smart-pointers.h (right): https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54 src/smart-pointers.h:54: ~SmartPointerBase() { if (p_) Deallocator::Delete(p_); } On 2013/12/04 07:34:01, ...
7 years ago (2013-12-04 07:44:47 UTC) #7
jochen (gone - plz use gerrit)
we can't use std::unique_ptr because it's not available on mac os 10.6's libstdc++ Using get() ...
7 years ago (2013-12-04 08:07:47 UTC) #8
yurys
On 2013/12/04 07:44:47, alph wrote: > https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h > File src/smart-pointers.h (right): > > https://codereview.chromium.org/101763003/diff/1/src/smart-pointers.h#newcode54 > ...
7 years ago (2013-12-04 08:36:27 UTC) #9
yurys
On 2013/12/04 08:07:47, jochen wrote: > we can't use std::unique_ptr because it's not available on ...
7 years ago (2013-12-04 08:43:09 UTC) #10
yurys
Sven, I've made the destructor protected, do you have any other concerns?
7 years ago (2013-12-05 07:15:22 UTC) #11
Sven Panne
On 2013/12/05 07:15:22, yurys wrote: > Sven, I've made the destructor protected, do you have ...
7 years ago (2013-12-05 07:38:12 UTC) #12
Sven Panne
On 2013/12/05 07:15:22, yurys wrote: > Sven, I've made the destructor protected, do you have ...
7 years ago (2013-12-05 07:38:12 UTC) #13
yurys
On 2013/12/05 07:38:12, Sven Panne wrote: > On 2013/12/05 07:15:22, yurys wrote: > > Sven, ...
7 years ago (2013-12-05 07:51:20 UTC) #14
Sven Panne
LGTM. Ooops, forgot that there was only a non-OWNER LGTM :-}
7 years ago (2013-12-05 08:11:23 UTC) #15
yurys
On 2013/12/05 08:11:23, Sven Panne wrote: > LGTM. Ooops, forgot that there was only a ...
7 years ago (2013-12-05 08:31:32 UTC) #16
yurys
7 years ago (2013-12-09 07:42:25 UTC) #17
Message was sent while issue was closed.
Committed patchset #4 manually as r18275 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698