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

Issue 10021046: Initialize tags back to 0 before using it. (Closed)

Created:
8 years, 8 months ago by siva
Modified:
8 years, 8 months ago
Reviewers:
cshapiro
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Initialize tags back to 0 before using it. Committed: https://code.google.com/p/dart/source/detail?r=6711

Patch Set 1 #

Patch Set 2 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M vm/object.cc View 1 3 chunks +4 lines, -3 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
siva
8 years, 8 months ago (2012-04-18 01:16:46 UTC) #1
siva
8 years, 8 months ago (2012-04-18 17:00:03 UTC) #2
cshapiro
lgtm https://chromiumcodereview.appspot.com/10021046/diff/3/vm/object.cc File vm/object.cc (right): https://chromiumcodereview.appspot.com/10021046/diff/3/vm/object.cc#newcode8539 vm/object.cc:8539: tags = 0; This seems like a strange ...
8 years, 8 months ago (2012-04-18 20:52:00 UTC) #3
siva
8 years, 8 months ago (2012-04-18 21:21:17 UTC) #4
https://chromiumcodereview.appspot.com/10021046/diff/3/vm/object.cc
File vm/object.cc (right):

https://chromiumcodereview.appspot.com/10021046/diff/3/vm/object.cc#newcode8539
vm/object.cc:8539: tags = 0;
This is in preparation for merging the tags fields and the header field into one
word.

The pattern at that point will look as:

header_bits = 0;
header_bits = UpdateTag info...
header_bits = UpdateSize...
header_bits = UpdateClassId ...
raw->ptr()->header_ = header_bits;


On 2012/04/18 20:52:00, cshapiro wrote:
> This seems like a strange idiom but I may not understand what is actually
going
> on.  Rather than doing this
> 
>   tag = 0
>   tag = DoSomething(tag)
>   raw->ptr()->tags_ = tags
> 
> Why not just do
> 
>   uword tag = DoSomething(0)
>   raw->ptr()->tags_ = tag
> 
> It was unclear to me what the effect of the tags = 0 assignment was when I
> looked at this code.  Keeping the def and use as close together as possible
> would be great.

Powered by Google App Engine
This is Rietveld 408576698