Bug 142436

Summary: The code to link FunctionExecutable is duplicated everywhere
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: JavaScriptCoreAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, benjamin, fpizlo, ggaren, mark.lam, msaboff, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 142388    
Attachments:
Description Flags
Patch
none
Fixed the bug title
none
Cleanup darin: review+

Description Ryosuke Niwa 2015-03-07 01:18:02 PST
There's a lot of code duplicated to adjust offsets within SourceCode.
Refactor them into two functions.
Comment 1 Ryosuke Niwa 2015-03-07 01:25:53 PST
Created attachment 248150 [details]
Patch
Comment 2 Ryosuke Niwa 2015-03-07 01:27:50 PST
Created attachment 248151 [details]
Fixed the bug title
Comment 3 Ryosuke Niwa 2015-03-07 01:36:41 PST
Created attachment 248152 [details]
Cleanup
Comment 4 Darin Adler 2015-03-07 08:51:12 PST
Comment on attachment 248152 [details]
Cleanup

View in context: https://bugs.webkit.org/attachment.cgi?id=248152&action=review

> Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp:144
> +    // The unlinkedBodyEndColumn is based-0. Hence, we need to add 1 to it. But if the

The term is "0-based", not "based-0". Would be nice to fix this since you are moving this comment into a new function.
Comment 5 Filip Pizlo 2015-03-07 09:05:03 PST
Comment on attachment 248152 [details]
Cleanup

Thanks for doing this!
Comment 6 Ryosuke Niwa 2015-03-07 13:44:54 PST
(In reply to comment #4)
> Comment on attachment 248152 [details]
> Cleanup
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248152&action=review
> 
> > Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp:144
> > +    // The unlinkedBodyEndColumn is based-0. Hence, we need to add 1 to it. But if the
> 
> The term is "0-based", not "based-0". Would be nice to fix this since you
> are moving this comment into a new function.

Thanks for the review. Will fix!
Comment 7 Ryosuke Niwa 2015-03-07 14:10:34 PST
Committed r181213: <http://trac.webkit.org/changeset/181213>