Commit graph

36788 commits

Author SHA1 Message Date
Ms2ger
262dc30c18 Assign into the argument binding directly in instantiateJSToNativeConversionTemplate. 2014-05-05 11:36:52 +02:00
Ms2ger
aed95dfd94 Move the assignment outside the if when dealing with optional arguments. 2014-05-05 11:36:52 +02:00
Ms2ger
d14efebb5c Move the assignment of 'None' in the no-argument-passed case into an else branch.
This is the only case where we assign into an argument local twice, so removing
it will allow us to make that binding immutable.
2014-05-05 11:36:52 +02:00
Ms2ger
cb2723c4ed Remove getJSToNativeConversionTemplate's initialValue return value.
This commit does not change the generated code.
2014-05-05 11:36:49 +02:00
Ms2ger
455465f3c6 Move the handling of default values in getJSToNativeConversionTemplate into handleOptional.
This is a first step towards moving responsibility for default values into the
caller, which should improve their code (in particular for the dictionary
codegen.

This also introduces a Dictionary::empty function, whose implementation is a
hack. The implementation will be improved once its codegen has access to the
raw default values.

Besides dictionaries, this commit does not change the generated code.
2014-05-05 11:29:46 +02:00
Ms2ger
e53c768b9e Use CGIfWrapper in instantiateJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
Ms2ger
2db1ce72f0 Remove references to unused substitution variables in getJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
bors-servo
310d2a19bb auto merge of #2320 : glennw/servo/codegen-warnings, r=jdm
Is it reasonable to always expect success here for now?

Fixes #2246.
2014-05-05 01:22:17 -04:00
bors-servo
150de252de auto merge of #2316 : Ms2ger/servo/owned-str-tests, r=jdm 2014-05-05 00:52:21 -04:00
Glenn Watson
71f3f5894e Prevent unused result warning in codegen. Always expect success for now. 2014-05-05 11:04:05 +10:00
bors-servo
67c9883d9a auto merge of #2317 : Ms2ger/servo/rebased-vec, r=Ms2ger
#2271 rebased.
2014-05-04 17:25:39 -04:00
Matt Murphy
8b94a44c0b Changes based on review 2014-05-04 23:16:18 +02:00
Matt Murphy
af920f442b Convert Vec::new() to vec!() 2014-05-04 23:16:18 +02:00
Matt Murphy
4d595b7d8c ~[] to Vec in harness/contenttest/contenttest.rs 2014-05-04 23:16:18 +02:00
Matt Murphy
c174a40afd ~[] to Vec in net/resource_task.rs 2014-05-04 23:16:18 +02:00
Matt Murphy
631f70b1c5 ~[] to Vec in util/cache.rs 2014-05-04 23:16:18 +02:00
Matt Murphy
33d0a3af09 ~[] to Vec in style/selectors.rs 2014-05-04 23:16:18 +02:00
Matt Murphy
544bbcde92 ~[] to Vec in util/time.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
428ea04fb5 ~[] to Vec in script/script_task.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
e107d0f015 ~[] to Vec in script/script_task.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
dccea25a8a ~[] to Vec in script/html/hubbub_html_parser.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
093e9fdd19 ~[] to Vec in style/properties.rs.mako and selector_matching.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
58bbe651a0 ~[] to Vec in script/dom/node.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
b88c84dde8 ~[] to Vec in gfx/text/text_run.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
2903e55de0 ~[] to Vec in gfx/text/shaping/harfbuzz.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
f32d1f007f ~[] to std::vec::Vec in gfx/text/glyph.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
f219dbeb6f ~[] to Vec in gfx/font_list.rs 2014-05-04 23:16:17 +02:00
Matt Murphy
98a78e3faf ~[] to Vec in glut_windowing 2014-05-04 23:16:17 +02:00
Matt Murphy
81fd243f37 ~[] to Vec in glfw_windowing and servo 2014-05-04 23:16:17 +02:00
Matt Murphy
7605464c24 ~[] to Vec in table, table_colgroup, and text 2014-05-04 23:16:16 +02:00
Matt Murphy
e761649cda ~[] to Vec in layout flow, block, table, row, rowgroup, wrapper 2014-05-04 23:16:16 +02:00
Matt Murphy
3d1a885a55 ~[] to Vec in main 2014-05-04 23:16:16 +02:00
Matt Murphy
6522e7827d ~[] to Vec in main/constellation.rs 2014-05-04 23:16:16 +02:00
Matt Murphy
7073f3b645 ~[] to Vec in main/compositing/compositor_layer.rs 2014-05-04 23:16:16 +02:00
Matt Murphy
60d443da16 ~[] to Vec in main/layout/wrapper.rs 2014-05-04 23:16:16 +02:00
Matt Murphy
3a8ecb2bb1 ~[] to Vec in main/layout/layout_task.rs, script/dom/clientrectlist.rs,
script/layout_interface.rs
2014-05-04 23:16:16 +02:00
Matt Murphy
36fdcdc929 ~[] to Vec in main/layout/box_.rs, gfx/text/util.rs, main/layout/text.rs 2014-05-04 23:16:16 +02:00
Matt Murphy
62bbe1f555 ~[] to Vec in main/layout/construct.rs and associated files 2014-05-04 23:16:16 +02:00
Matt Murphy
8da47b6a32 ~[] to std::vec::Vec in layout 2014-05-04 23:16:16 +02:00
Matt Murphy
d734a8937d ~[] to Vec in main/compositing and associated files 2014-05-04 23:16:16 +02:00
Matt Murphy
f2707bc405 ~[] to Vec in style/media_quieres.rs, selectors.rs, stylesheets.rs 2014-05-04 23:16:15 +02:00
Matt Murphy
7447ed69e3 ~[] to Vec in FontStyle and FontGroup 2014-05-04 23:16:15 +02:00
Ms2ger
cde01affcd Use str.to_owned() in tests. 2014-05-04 20:12:58 +02:00
bors-servo
b1d0dac50d auto merge of #2312 : Ms2ger/servo/owned-strings, r=SimonSapin 2014-05-04 06:22:21 -04:00
Ms2ger
11ea7d4935 Call find_equiv to avoid allocation strings. 2014-05-04 10:17:32 +02:00
Ms2ger
0ff8610727 Reorder some comparisons to avoid allocating strings for them. 2014-05-04 10:17:06 +02:00
Ms2ger
25542e3f7e Replace most ~"string"s with "string".to_owned(). 2014-05-04 09:39:07 +02:00
bors-servo
660f7a016e auto merge of #2311 : Ms2ger/servo/empty-owned, r=jdm 2014-05-04 01:01:21 -04:00
Ms2ger
243814022e Replace all ~"" with "".to_owned(). 2014-05-03 22:17:45 +02:00
bors-servo
731e66ff13 auto merge of #2101 : jdm/servo/newroot_rebase, r=Ms2ger
As described in #1764, this strategy uses the following properties:
* DOM members are `JS<T>` types. These cannot be used with being explicitly rooted, but they are required for compiler-derived trace hooks.
* Methods that take DOM type arguments receive `&[mut] JSRef<T>`. These are rooted value references that are cloneable but cannot escape.
* Methods that return DOM values use `Unrooted<T>`. These are values that may or may not be rooted elsewhere, but callers must root them in order to interact with them in any way. One unsoundness hole exists - `Unrooted` values must be rooted ASAP, or there exists the danger that JSAPI calls could be made that could cause the underlying JS value to be GCed.
* All methods are implemented on `JSRef<T>`, enforcing the requirement that all DOM values are rooted for the duration of a method call (with a few exceptions for layout-related code, which cannot root values and therefore interacts with `JS<T>` and `&T` values - this is safe under the assumption that layout code interacts with DOM nodes that are in the tree, therefore rooted, and does not run concurrently with content code)
2014-05-03 14:25:22 -04:00