Bug 142556 - Integrate MapData into JSMap and JSSet
Summary: Integrate MapData into JSMap and JSSet
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: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks: 142408
  Show dependency treegraph
 
Reported: 2015-03-10 18:55 PDT by Yusuke Suzuki
Modified: 2015-03-12 16:04 PDT (History)
4 users (show)

See Also:


Attachments
Patch (26.04 KB, patch)
2015-03-10 18:58 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (60.95 KB, patch)
2015-03-10 23:23 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (81.40 KB, patch)
2015-03-11 02:11 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (76.56 KB, patch)
2015-03-11 09:22 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (76.56 KB, patch)
2015-03-11 09:27 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (74.00 KB, patch)
2015-03-11 10:18 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (80.81 KB, patch)
2015-03-12 12:47 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (80.85 KB, patch)
2015-03-12 12:49 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (81.62 KB, patch)
2015-03-12 13:26 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (84.01 KB, patch)
2015-03-12 13:43 PDT, Yusuke Suzuki
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2015-03-10 18:55:09 PDT
Integrate MapData into JSMap and JSSet
Comment 1 Yusuke Suzuki 2015-03-10 18:58:29 PDT
Created attachment 248382 [details]
Patch
Comment 2 Yusuke Suzuki 2015-03-10 19:03:10 PDT
Created the prototype to integrate MapData into JSMap / JSSet.
In the current patch, MapData is not splitted into MapData / SetData.

MapData's operations are similar to SetData.
If splitting MapData into SetData and MapData is preferable, one possible solution is template parameterizing MapData such as MapData<ValueType, ValueTraits> and using MapData<Pair<Key, Value>, Traits> in JSMap and MapData<Value, Traits> in JSSet.
Comment 3 Yusuke Suzuki 2015-03-10 23:23:15 PDT
Created attachment 248406 [details]
Patch
Comment 4 WebKit Commit Bot 2015-03-10 23:25:37 PDT
Attachment 248406 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/MapData.h:191:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:212:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Yusuke Suzuki 2015-03-11 02:11:30 PDT
Created attachment 248407 [details]
Patch
Comment 6 WebKit Commit Bot 2015-03-11 02:13:19 PDT
Attachment 248407 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/MapData.h:191:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:212:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/ChangeLog:8:  You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 3 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Yusuke Suzuki 2015-03-11 09:22:09 PDT
Created attachment 248422 [details]
Patch
Comment 8 WebKit Commit Bot 2015-03-11 09:24:22 PDT
Attachment 248422 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/MapData.h:193:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:214:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Yusuke Suzuki 2015-03-11 09:27:26 PDT
Created attachment 248425 [details]
Patch
Comment 10 WebKit Commit Bot 2015-03-11 09:29:26 PDT
Attachment 248425 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/MapData.h:194:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:215:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Yusuke Suzuki 2015-03-11 10:18:24 PDT
Created attachment 248430 [details]
Patch
Comment 12 WebKit Commit Bot 2015-03-11 10:22:37 PDT
Attachment 248430 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/MapData.h:194:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:215:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Yusuke Suzuki 2015-03-12 12:47:44 PDT
Created attachment 248532 [details]
Patch
Comment 14 Yusuke Suzuki 2015-03-12 12:49:23 PDT
Created attachment 248533 [details]
Patch
Comment 15 Filip Pizlo 2015-03-12 12:50:10 PDT
Comment on attachment 248533 [details]
Patch

Nice!
Comment 16 WebKit Commit Bot 2015-03-12 12:51:18 PDT
Attachment 248533 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/JSMap.h:119:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/MapData.h:193:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:214:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 17 Filip Pizlo 2015-03-12 12:59:24 PDT
(In reply to comment #16)
> Attachment 248533 [details] did not pass style-queue:
> 
> 
> ERROR: Source/JavaScriptCore/runtime/JSMap.h:119:  The parameter name
> "value" adds no information, so it should be removed. 

I think that the style bot is wrong here; you're using the word "value" to distinguish from "key".  So, please ignore this style feedback.

> [readability/parameter_name] [5]
> ERROR: Source/JavaScriptCore/runtime/MapData.h:193: 
> MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use
> underscores in your identifier names.  [readability/naming/underscores] [4]
> ERROR: Source/JavaScriptCore/runtime/MapData.h:214: 
> MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores
> in your identifier names.  [readability/naming/underscores] [4]

These errors are wrong.  You're right to use const_iterator as the name of a const iterator. ;-)

> Total errors found: 3 in 19 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.
Comment 18 Yusuke Suzuki 2015-03-12 13:09:05 PDT
(In reply to comment #17)
> I think that the style bot is wrong here; you're using the word "value" to
> distinguish from "key".  So, please ignore this style feedback.
> 
> > [readability/parameter_name] [5]
> > ERROR: Source/JavaScriptCore/runtime/MapData.h:193: 
> > MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use
> > underscores in your identifier names.  [readability/naming/underscores] [4]
> > ERROR: Source/JavaScriptCore/runtime/MapData.h:214: 
> > MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores
> > in your identifier names.  [readability/naming/underscores] [4]
> 
> These errors are wrong.  You're right to use const_iterator as the name of a
> const iterator. ;-)
> 
> > Total errors found: 3 in 19 files
> > 
> > 
> > If any of these errors are false positives, please file a bug against
> > check-webkit-style.

Thank you for your review.

Oops, one build failure is raised.
This is because JSMap::get conflicts with JSObject::get.
I needed to rebuild with --clean for MapConstructor.cpp, this is because it doesn't use JSMap::get, so rebuild doesn't occur.
I'll fix it with speciflying explicitly by `map->JSObject::get`. And update the patch with it.

The change will become only this from the reviewed patch.
Comment 19 Yusuke Suzuki 2015-03-12 13:26:28 PDT
Created attachment 248536 [details]
Patch
Comment 20 WebKit Commit Bot 2015-03-12 13:28:58 PDT
Attachment 248536 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/JSMap.h:119:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/MapData.h:193:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:214:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 20 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 21 Yusuke Suzuki 2015-03-12 13:36:21 PDT
Comment on attachment 248536 [details]
Patch

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

I've updated the patch with a few build fix.
I've only annotated the changes from the previous reviewed patch.

To land it safely, I've updated the patch again.
Could you take a look?

> Source/JavaScriptCore/runtime/MapConstructor.cpp:63
> +    JSValue adderFunction = map->JSObject::get(exec, exec->propertyNames().set);

Explicitly specifying JSObject::get since JSMap also has JSMap::get which signature is different from JSObject::get.

> Source/WebCore/bindings/js/SerializedScriptValue.cpp:2555
> +            set->add(m_exec, outValue);

I've missed that changing this from set->set to set->add.
Now I've built whole WebKit and make sure that build passed, run-webkit-tests for structured-cloning passed, run-javascriptcore-tests passed on GTK environment.
Comment 22 Yusuke Suzuki 2015-03-12 13:39:12 PDT
Ah, sorry, I'll update once more for windows build.
Dropping MapData.cpp from vcxproj.
Comment 23 Yusuke Suzuki 2015-03-12 13:43:22 PDT
Created attachment 248539 [details]
Patch
Comment 24 Filip Pizlo 2015-03-12 13:44:44 PDT
This probably doesn't need to be reviewed again even if you have to make small changes to pacify the various builds.  That's how we usually work - it's a given that after an r+, additional changes may be necessary, and if they are small, we don't request additional review.
Comment 25 WebKit Commit Bot 2015-03-12 13:46:21 PDT
Attachment 248539 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/JSMap.h:119:  The parameter name "value" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/JavaScriptCore/runtime/MapData.h:193:  MapDataImpl::const_iterator::const_iterator is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/JavaScriptCore/runtime/MapData.h:214:  MapDataImpl::const_iterator::end is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 3 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 26 Yusuke Suzuki 2015-03-12 13:50:36 PDT
(In reply to comment #24)
> This probably doesn't need to be reviewed again even if you have to make
> small changes to pacify the various builds.  That's how we usually work -
> it's a given that after an r+, additional changes may be necessary, and if
> they are small, we don't request additional review.

Thank you :)
I've checked build on gtk, but maybe, iOS seems failed due to the lack of JS_EXPORT_PRIVATE.
So I'll move this patch from my GTK environment to OSX, eusured that build/test passed and land it.

Does Tools/Scripts/webkit-patch land-safely works fine?
If it works, I'm planning to use it to land it safely.
Comment 27 Filip Pizlo 2015-03-12 14:22:07 PDT
(In reply to comment #26)
> (In reply to comment #24)
> > This probably doesn't need to be reviewed again even if you have to make
> > small changes to pacify the various builds.  That's how we usually work -
> > it's a given that after an r+, additional changes may be necessary, and if
> > they are small, we don't request additional review.
> 
> Thank you :)
> I've checked build on gtk, but maybe, iOS seems failed due to the lack of
> JS_EXPORT_PRIVATE.
> So I'll move this patch from my GTK environment to OSX, eusured that
> build/test passed and land it.
> 
> Does Tools/Scripts/webkit-patch land-safely works fine?
> If it works, I'm planning to use it to land it safely.

I don't know. I just svn commit. ;-)
Comment 28 Yusuke Suzuki 2015-03-12 15:57:53 PDT
Committed r181458: <http://trac.webkit.org/changeset/181458>
Comment 29 Yusuke Suzuki 2015-03-12 16:04:16 PDT
(In reply to comment #27)
> I don't know. I just svn commit. ;-)

I see. I've landed with Tools/Scripts/webkit-patch land. Thank you!