Bug 68717 - Make write barriers actually do something when enabled
Summary: Make write barriers actually do something when enabled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on: 68780
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-23 12:48 PDT by Oliver Hunt
Modified: 2011-09-25 14:45 PDT (History)
2 users (show)

See Also:


Attachments
Patch (46.58 KB, patch)
2011-09-23 12:56 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff
Patch (46.61 KB, patch)
2011-09-23 14:08 PDT, Oliver Hunt
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2011-09-23 12:48:48 PDT
Make write barriers actually do something when enabled
Comment 1 Oliver Hunt 2011-09-23 12:56:03 PDT
Created attachment 108512 [details]
Patch
Comment 2 WebKit Review Bot 2011-09-23 12:59:36 PDT
Attachment 108512 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/assembler/X86Assembler.h:1061:  movb_i8m is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/assembler/X86Assembler.h:1068:  movb_i8m is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Oliver Hunt 2011-09-23 14:08:27 PDT
Created attachment 108535 [details]
Patch
Comment 4 WebKit Review Bot 2011-09-23 14:11:05 PDT
Attachment 108535 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/assembler/X86Assembler.h:1061:  movb_i8m is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Source/JavaScriptCore/assembler/X86Assembler.h:1068:  movb_i8m is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 17 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Geoffrey Garen 2011-09-23 14:34:09 PDT
r=me with those changes and a working build.

> Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp:1245
> +    OwnPtr<GPRTemporary> temp1;
> +    OwnPtr<GPRTemporary> temp2;
> +    if (scratch1 == InvalidGPRReg) {
> +        temp1 = adoptPtr(new GPRTemporary(this));
> +        scratch1 = temp1->gpr();
> +    }
> +    if (scratch2 == InvalidGPRReg) {
> +        temp2 = adoptPtr(new GPRTemporary(this));
> +        scratch2 = temp2->gpr();
> +    }

Using OwnPtr here is a bit awkward and inefficient. I think this would be better:
* Give GPRTemporary a default constructor that initializes m_jit to NULL and m_gpr to InvalidGPRReg.
* Change GPRTemporary's destructor to return early if m_jit is NULL.
* Give GPRTemporary an adopt function that takes "GPRTemporary& other" as an argument, steals other's data, and null out other.

Then:
 1236    GPRTemporary temp1;
 1237    GPRTemporary temp2;
 1238    if (scratch1 == InvalidGPRReg) {
 1239        temp1.adopt(GPRTemporary(this));
 1240        scratch1 = temp1->gpr();
 1241    }
 1242    if (scratch2 == InvalidGPRReg) {
 1243        temp2.adopt(GPRTemporary(this));
 1244        scratch2 = temp2->gpr();
 1245    }

> Source/JavaScriptCore/dfg/DFGJITCodeGenerator.cpp:1279
> +    OwnPtr<GPRTemporary> temp;
> +    if (scratch == InvalidGPRReg) {
> +        temp = adoptPtr(new GPRTemporary(this));
> +        scratch = temp->gpr();
> +    }

Ditto.

> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:27
> +

No space here please.

> Source/JavaScriptCore/heap/CardSet.h:44
> +    bool cardMarkedForAtom(const void*);

"isCardMarkedForAtom", please, since this is a boolean test and not a notification.

> Source/JavaScriptCore/heap/CardSet.h:45
> +    void markCardForAtom(const void*);

Soon you will need clearCardForAtom or clearAll, too, no?

> Source/JavaScriptCore/heap/Heap.h:248
> +        MarkedBlock::blockFor(owner)->setDirtyObject(owner);

Let's just call this "writeBarrier" too.
Comment 6 Oliver Hunt 2011-09-23 15:07:44 PDT
Committed r95865: <http://trac.webkit.org/changeset/95865>