[ES6] Implement ES6 arrow function syntax. Prototype of arrow function should be...
[WebKit-https.git] / Source / JavaScriptCore / ChangeLog
1 2015-09-03 Aleksandr Skachkov   <gskachkov@gmail.com>
2
3         [ES6] Implement ES6 arrow function syntax. Prototype of arrow function should be undefined
4         https://bugs.webkit.org/show_bug.cgi?id=147742
5
6         Reviewed by Saam Barati.
7
8         Added correct support of prototype property for arrow function. Arrow function 
9         doesn’t have own prototype property, so (() => {}).hasOwnProperty('prototype') === false.
10         Changes prevent from creation of 'prototype' property automatically during initialization 
11         of arrow function and allow to assign & delete it later in js code. 
12
13
14         * runtime/JSFunction.cpp:
15         (JSC::JSFunction::getOwnPropertySlot):
16         (JSC::JSFunction::deleteProperty):
17         * tests/stress/arrowfunction-prototype.js: Added.
18
19 2015-09-03  Commit Queue  <commit-queue@webkit.org>
20
21         Unreviewed, rolling out r189338.
22         https://bugs.webkit.org/show_bug.cgi?id=148785
23
24         Caused tons of crashes (Requested by cdumez on #webkit).
25
26         Reverted changeset:
27
28         "Web Inspector: InspectorController should support multiple
29         frontend channels"
30         https://bugs.webkit.org/show_bug.cgi?id=148538
31         http://trac.webkit.org/changeset/189338
32
33 2015-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
34
35         [ES6] Instantiate Module Environment bindings and execute module
36         https://bugs.webkit.org/show_bug.cgi?id=148053
37
38         Reviewed by Saam Barati.
39
40         This patch implements Module Environment binding instantiation.
41         And since the layout of the module environment is tightly coupled with the variable
42         look up in LLInt / Baseline / DFG, we implement the execution part at the same time.
43
44         For the instantiation, we implement the several operations (like resolveExport)
45         specified in the spec. The original algorithm contains the recursive call, but it is not
46         good for C++ code. We flatten the algorithm by using the manual frames to avoid recursions.
47         By leveraging the information retrieved by the above operations, we instantiate and
48         initialize the slots of the module environment.
49
50         The module namespace object is not implemented yet in this patch. It will be implemented
51         and instantiated in the module environment in the subsequent patch[1].
52
53         To look up the imported module bindings in the JS code, we introduce the "ModuleVar" resolve
54         type for resolve_scope, get_from_scope and put_to_scope. This "ModuleVar" will be filled
55         when linking the CodeBlock. This type is used when treating the imported bindings.
56
57         1. For resolve_scope, when linking, we resolve the actual module environment where
58             looked up variable resides and store it directly to the instruction. And resolve_scope
59             simply retrieve the stored pointer from the instruction.
60
61         2. For get_from_scope, since "ModuleVar" behavior for get_from_scope is completely same
62             to the "ClosureVar", we just store "ClosureVar" for get_from_scope to eliminate
63             unnecessary branch in LLInt layer.
64
65         3. For put_to_scope, we always emit the function call that immediately raises the error.
66             Because all the imported bindings are immutable and module code is always strict code.
67             In DFG, we just emit the ForceOSRExit. We don't make put_to_scope with "ModuleVar"
68             "CannotCompile" because it disables DFG compiling for the function even if this
69             problematic instruction is never executed.
70
71         Exported module variables inside the original module environment are just treated as the
72         usual heap variables. So the types for closure variables are just used. ("ClosureVar" etc.)
73
74         [1]: https://bugs.webkit.org/show_bug.cgi?id=148705
75
76         * CMakeLists.txt:
77         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
78         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
79         * JavaScriptCore.xcodeproj/project.pbxproj:
80         * bytecode/CodeBlock.cpp:
81         (JSC::CodeBlock::CodeBlock):
82         * bytecode/CodeBlock.h:
83         * bytecode/UnlinkedCodeBlock.cpp:
84         (JSC::UnlinkedModuleProgramCodeBlock::visitChildren): Deleted.
85         * bytecode/UnlinkedCodeBlock.h:
86         * bytecompiler/BytecodeGenerator.cpp:
87         (JSC::BytecodeGenerator::BytecodeGenerator):
88         * dfg/DFGByteCodeParser.cpp:
89         (JSC::DFG::ByteCodeParser::parseBlock):
90         * interpreter/Interpreter.cpp:
91         (JSC::Interpreter::execute):
92         * interpreter/Interpreter.h:
93         * jit/JITOperations.cpp:
94         * jit/JITPropertyAccess.cpp:
95         (JSC::JIT::emit_op_resolve_scope):
96         (JSC::JIT::emitSlow_op_resolve_scope):
97         (JSC::JIT::emit_op_get_from_scope):
98         (JSC::JIT::emit_op_put_to_scope):
99         (JSC::JIT::emitSlow_op_put_to_scope):
100         * jit/JITPropertyAccess32_64.cpp:
101         (JSC::JIT::emit_op_resolve_scope):
102         (JSC::JIT::emitSlow_op_resolve_scope):
103         (JSC::JIT::emit_op_get_from_scope):
104         (JSC::JIT::emit_op_put_to_scope):
105         (JSC::JIT::emitSlow_op_put_to_scope):
106         * llint/LLIntData.cpp:
107         (JSC::LLInt::Data::performAssertions):
108         * llint/LLIntSlowPaths.cpp:
109         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
110         * llint/LowLevelInterpreter.asm:
111         * llint/LowLevelInterpreter32_64.asm:
112         * llint/LowLevelInterpreter64.asm:
113         * parser/ModuleAnalyzer.cpp:
114         (JSC::ModuleAnalyzer::exportVariable):
115         * runtime/CommonSlowPaths.cpp:
116         (JSC::SLOW_PATH_DECL):
117         * runtime/CommonSlowPaths.h:
118         * runtime/Error.cpp:
119         (JSC::throwSyntaxError):
120         * runtime/Error.h:
121         * runtime/Executable.cpp:
122         (JSC::ModuleProgramExecutable::create):
123         (JSC::ModuleProgramExecutable::visitChildren):
124         (JSC::ModuleProgramExecutable::clearCode):
125         * runtime/Executable.h:
126         * runtime/GetPutInfo.h:
127         (JSC::resolveTypeName):
128         (JSC::makeType):
129         (JSC::needsVarInjectionChecks):
130         (JSC::ResolveOp::ResolveOp):
131         * runtime/JSGlobalObject.cpp:
132         (JSC::JSGlobalObject::init):
133         (JSC::JSGlobalObject::visitChildren):
134         * runtime/JSGlobalObject.h:
135         (JSC::JSGlobalObject::moduleEnvironmentStructure):
136         * runtime/JSLexicalEnvironment.h:
137         * runtime/JSModuleEnvironment.cpp: Added.
138         (JSC::JSModuleEnvironment::create):
139         (JSC::JSModuleEnvironment::finishCreation):
140         (JSC::JSModuleEnvironment::visitChildren):
141         (JSC::JSModuleEnvironment::getOwnPropertySlot):
142         (JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames):
143         (JSC::JSModuleEnvironment::put):
144         (JSC::JSModuleEnvironment::deleteProperty):
145         * runtime/JSModuleEnvironment.h: Copied from Source/JavaScriptCore/runtime/JSLexicalEnvironment.h.
146         (JSC::JSModuleEnvironment::create):
147         (JSC::JSModuleEnvironment::createStructure):
148         (JSC::JSModuleEnvironment::offsetOfModuleRecord):
149         (JSC::JSModuleEnvironment::allocationSize):
150         (JSC::JSModuleEnvironment::moduleRecord):
151         (JSC::JSModuleEnvironment::moduleRecordSlot):
152         (JSC::JSModuleEnvironment::JSModuleEnvironment):
153         * runtime/JSModuleRecord.cpp:
154         (JSC::JSModuleRecord::visitChildren):
155         (JSC::JSModuleRecord::appendRequestedModule):
156         (JSC::JSModuleRecord::addStarExportEntry):
157         (JSC::JSModuleRecord::addImportEntry):
158         (JSC::JSModuleRecord::addExportEntry):
159         (JSC::ResolveQuery::ResolveQuery):
160         (JSC::ResolveQuery::isEmptyValue):
161         (JSC::ResolveQuery::isDeletedValue):
162         (JSC::ResolveQueryHash::hash):
163         (JSC::ResolveQueryHash::equal):
164         (JSC::resolveExportLoop):
165         (JSC::JSModuleRecord::link):
166         (JSC::JSModuleRecord::instantiateDeclarations):
167         (JSC::JSModuleRecord::execute):
168         (JSC::JSModuleRecord::dump):
169         * runtime/JSModuleRecord.h:
170         (JSC::JSModuleRecord::exportEntries):
171         (JSC::JSModuleRecord::importEntries):
172         (JSC::JSModuleRecord::starExportEntries):
173         (JSC::JSModuleRecord::moduleEnvironment):
174         (JSC::JSModuleRecord::appendRequestedModule): Deleted.
175         (JSC::JSModuleRecord::addImportEntry): Deleted.
176         (JSC::JSModuleRecord::addExportEntry): Deleted.
177         (JSC::JSModuleRecord::addStarExportEntry): Deleted.
178         * runtime/JSScope.cpp:
179         (JSC::abstractAccess):
180         (JSC::JSScope::collectVariablesUnderTDZ):
181         (JSC::JSScope::isModuleScope):
182         * runtime/JSScope.h:
183         * runtime/ModuleLoaderObject.cpp:
184
185 2015-09-03  Brian Burg  <bburg@apple.com>
186
187         Web Inspector: InspectorController should support multiple frontend channels
188         https://bugs.webkit.org/show_bug.cgi?id=148538
189
190         Reviewed by Joseph Pecoraro.
191
192         Instead of a singleton, it should be possible to have multiple channels open
193         at the same time and to individually close channels as frontends come and go.
194
195         The FrontendRouter class keeps a list of open FrontendChannels and sends messages
196         to the appropriate frontends based on whether the message is a response or event.
197         Each InspectorController owns a single FrontendRouter and BackendDispatcher instance.
198         Inspector backend code that sends messages to the frontend should switch over to
199         using the router rather than directly using a FrontendChannel.
200
201         * CMakeLists.txt:
202         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
203         * JavaScriptCore.xcodeproj/project.pbxproj:
204         * inspector/InspectorBackendDispatcher.cpp: Move constructors/destructors out of the header
205         to avoid including InspectorFrontendRouter everywhere. Use the router instead of a
206         specific frontend channel. Remove guards that are no longer necessary since the router
207         is guaranteed to outlive the backend dispatcher.
208
209         (Inspector::SupplementalBackendDispatcher::SupplementalBackendDispatcher):
210         (Inspector::SupplementalBackendDispatcher::~SupplementalBackendDispatcher):
211         (Inspector::BackendDispatcher::BackendDispatcher):
212         (Inspector::BackendDispatcher::create):
213         (Inspector::BackendDispatcher::isActive):
214         (Inspector::BackendDispatcher::registerDispatcherForDomain):
215         (Inspector::BackendDispatcher::sendResponse):
216         (Inspector::BackendDispatcher::sendPendingErrors):
217         * inspector/InspectorBackendDispatcher.h:
218         (Inspector::SupplementalBackendDispatcher::SupplementalBackendDispatcher): Deleted.
219         (Inspector::SupplementalBackendDispatcher::~SupplementalBackendDispatcher): Deleted.
220         (Inspector::BackendDispatcher::clearFrontend): Deleted, no longer necessary.
221         (Inspector::BackendDispatcher::isActive): Moved to implementation file.
222         (Inspector::BackendDispatcher::BackendDispatcher): Moved to implementation file.
223         * inspector/InspectorFrontendRouter.cpp: Added.
224         (Inspector::FrontendRouter::create):
225         (Inspector::FrontendRouter::connectFrontend):
226         (Inspector::FrontendRouter::disconnectFrontend):
227         (Inspector::FrontendRouter::disconnectAllFrontends):
228         (Inspector::FrontendRouter::leakChannel):
229         (Inspector::FrontendRouter::hasLocalFrontend):
230         (Inspector::FrontendRouter::hasRemoteFrontend):
231         (Inspector::FrontendRouter::sendEvent):
232         (Inspector::FrontendRouter::sendResponse):
233         * inspector/InspectorFrontendRouter.h: Added.
234         * inspector/JSGlobalObjectInspectorController.cpp: Remove guards that are no longer necessary.
235         The frontend router and backend dispatcher now have the same lifetime as the controller.
236         Explicitly connect/disconnect the frontend channel.
237
238         (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
239         (Inspector::JSGlobalObjectInspectorController::globalObjectDestroyed):
240         (Inspector::JSGlobalObjectInspectorController::connectFrontend):
241         (Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
242         (Inspector::JSGlobalObjectInspectorController::disconnectAllFrontends):
243         (Inspector::JSGlobalObjectInspectorController::dispatchMessageFromFrontend):
244         (Inspector::JSGlobalObjectInspectorController::appendExtraAgent):
245         (Inspector::JSGlobalObjectInspectorController::pause): Deleted.
246         * inspector/JSGlobalObjectInspectorController.h:
247         * inspector/agents/InspectorAgent.cpp:
248         * inspector/agents/InspectorConsoleAgent.cpp:
249         * inspector/agents/InspectorDebuggerAgent.cpp:
250         * inspector/agents/InspectorRuntimeAgent.cpp:
251         * inspector/augmentable/AugmentableInspectorController.h:
252         (Inspector::AugmentableInspectorController::connected):
253         * inspector/remote/RemoteInspectorDebuggable.h:
254         * inspector/remote/RemoteInspectorDebuggableConnection.mm:
255         (Inspector::RemoteInspectorDebuggableConnection::close):
256         * inspector/scripts/codegen/generate_cpp_alternate_backend_dispatcher_header.py:
257         (CppAlternateBackendDispatcherHeaderGenerator.generate_output):
258         * inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
259         (ObjCFrontendDispatcherImplementationGenerator._generate_event): Use the router.
260         * runtime/JSGlobalObjectDebuggable.cpp:
261         (JSC::JSGlobalObjectDebuggable::disconnect):
262         * runtime/JSGlobalObjectDebuggable.h:
263
264 2015-09-03  Basile Clement  <basile_clement@apple.com>
265
266         [ES6] Recognize calls in tail position
267         https://bugs.webkit.org/show_bug.cgi?id=148665
268
269         Reviewed by Saam Barati.
270
271         This patch adds the capability for the bytecode generator to recognize
272         and dispatch tail calls, as per ES6 spec:
273         http://www.ecma-international.org/ecma-262/6.0/#sec-isintailposition
274
275         This does not change the generated bytecode, but merely provides the
276         hook for generating tail calls in subsequent patches toward
277         https://bugs.webkit.org/show_bug.cgi?id=146477
278
279         * bytecompiler/BytecodeGenerator.cpp:
280         (JSC::BytecodeGenerator::BytecodeGenerator):
281         (JSC::BytecodeGenerator::emitCallInTailPosition):
282         (JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
283         * bytecompiler/BytecodeGenerator.h:
284         (JSC::BytecodeGenerator::emitNode):
285         (JSC::BytecodeGenerator::emitNodeInTailPosition):
286         * bytecompiler/NodesCodegen.cpp:
287         (JSC::FunctionCallValueNode::emitBytecode):
288         (JSC::FunctionCallResolveNode::emitBytecode):
289         (JSC::FunctionCallBracketNode::emitBytecode):
290         (JSC::FunctionCallDotNode::emitBytecode):
291         (JSC::CallFunctionCallDotNode::emitBytecode):
292         (JSC::ApplyFunctionCallDotNode::emitBytecode):
293         (JSC::LogicalOpNode::emitBytecode):
294         (JSC::ConditionalNode::emitBytecode):
295         (JSC::CommaNode::emitBytecode):
296         (JSC::SourceElements::emitBytecode):
297         (JSC::IfElseNode::emitBytecode):
298         (JSC::DoWhileNode::emitBytecode):
299         (JSC::WhileNode::emitBytecode):
300         (JSC::ForNode::emitBytecode):
301         (JSC::ReturnNode::emitBytecode):
302         (JSC::WithNode::emitBytecode):
303         (JSC::TryNode::emitBytecode):
304         * bytecompiler/SetForScope.h: Added.
305         (JSC::SetForScope::SetForScope):
306         (JSC::SetForScope::~SetForScope):
307         * runtime/Options.h:
308
309 2015-08-11  Basile Clement  <basile_clement@apple.com>
310
311         Add more strict mode tests
312         https://bugs.webkit.org/show_bug.cgi?id=147850
313
314         Reviewed by Michael Saboff.
315
316         We should have more tests in strict mode to have better test coverage.
317         This adds a copy of the v8-v6 tests from SunSpider as JSC stress tests,
318         with "use strict"; added at the top of the files.
319
320         A few modifications were necessary to make the files valid in strict
321         mode, namely adding a couple of "var" statements and removing some
322         generated code in earley-boyer that was using strings with octal
323         escapes.
324
325         * tests/stress/v8-crypto-strict.js: Added.
326         * tests/stress/v8-deltablue-strict.js: Added.
327         * tests/stress/v8-earley-boyer-strict.js: Added.
328         * tests/stress/v8-raytrace-strict.js: Added.
329         * tests/stress/v8-regexp-strict.js: Added.
330         * tests/stress/v8-richards-strict.js: Added.
331         * tests/stress/v8-splay-strict.js: Added.
332
333 2015-09-03  Geoffrey Garen  <ggaren@apple.com>
334
335         JavaScriptCore should have some ES6 conformance tests
336         https://bugs.webkit.org/show_bug.cgi?id=148771
337
338         Reviewed by Chris Dumez.
339
340         I created 590 independent, reduced test cases that collectively tell us
341         whether we pass or fail the conformance matrix @ http://kangax.github.io/compat-table/es6/.
342
343         * tests/es6: Added.
344         * tests/es6.yaml: Added.
345         * tests/es6/Array.prototype_methods_Array.prototype.copyWithin.js: Added.
346         (test):
347         * tests/es6/Array.prototype_methods_Array.prototype.entries.js: Added.
348         (test):
349         * tests/es6/Array.prototype_methods_Array.prototype.fill.js: Added.
350         (test):
351         * tests/es6/Array.prototype_methods_Array.prototype.find.js: Added.
352         (test):
353         * tests/es6/Array.prototype_methods_Array.prototype.findIndex.js: Added.
354         (test):
355         * tests/es6/Array.prototype_methods_Array.prototype.keys.js: Added.
356         (test):
357         * tests/es6/Array.prototype_methods_Array.prototype.values.js: Added.
358         (test):
359         * tests/es6/Array.prototype_methods_Array.prototype[Symbol.iterator].js: Added.
360         (test):
361         * tests/es6/Array.prototype_methods_Array.prototype[Symbol.unscopables].js: Added.
362         (test):
363         * tests/es6/Array.prototype_methods_Array_iterator_prototype_chain.js: Added.
364         (test):
365         * tests/es6/Array_is_subclassable_Array.from.js: Added.
366         (test.C):
367         (test):
368         * tests/es6/Array_is_subclassable_Array.isArray_support.js: Added.
369         (test.C):
370         (test):
371         * tests/es6/Array_is_subclassable_Array.of.js: Added.
372         (test.C):
373         (test):
374         * tests/es6/Array_is_subclassable_Array.prototype.concat.js: Added.
375         (test.C):
376         (test):
377         * tests/es6/Array_is_subclassable_Array.prototype.filter.js: Added.
378         (test.C):
379         (test):
380         * tests/es6/Array_is_subclassable_Array.prototype.map.js: Added.
381         (test.C):
382         (test):
383         * tests/es6/Array_is_subclassable_Array.prototype.slice.js: Added.
384         (test.C):
385         (test):
386         * tests/es6/Array_is_subclassable_Array.prototype.splice.js: Added.
387         (test.C):
388         (test):
389         * tests/es6/Array_is_subclassable_correct_prototype_chain.js: Added.
390         (test.C):
391         (test):
392         * tests/es6/Array_is_subclassable_length_property_accessing.js: Added.
393         (test.C):
394         (test):
395         * tests/es6/Array_is_subclassable_length_property_setting.js: Added.
396         (test.C):
397         (test):
398         * tests/es6/Array_static_methods_Array.from_array-like_objects.js: Added.
399         (test):
400         * tests/es6/Array_static_methods_Array.from_generator_instances.js: Added.
401         (test.iterable):
402         (test):
403         * tests/es6/Array_static_methods_Array.from_generic_iterables.js: Added.
404         (test):
405         * tests/es6/Array_static_methods_Array.from_instances_of_generic_iterables.js: Added.
406         (test):
407         * tests/es6/Array_static_methods_Array.from_iterator_closing.js: Added.
408         (test.):
409         (test):
410         * tests/es6/Array_static_methods_Array.from_map_function_array-like_objects.js: Added.
411         (test):
412         * tests/es6/Array_static_methods_Array.from_map_function_generator_instances.js: Added.
413         (test.iterable):
414         (test):
415         * tests/es6/Array_static_methods_Array.from_map_function_generic_iterables.js: Added.
416         (test):
417         * tests/es6/Array_static_methods_Array.from_map_function_instances_of_iterables.js: Added.
418         (test):
419         * tests/es6/Array_static_methods_Array.of.js: Added.
420         (test):
421         * tests/es6/Array_static_methods_Array[Symbol.species].js: Added.
422         (test):
423         * tests/es6/Function_is_subclassable_Function.prototype.apply.js: Added.
424         (test.C):
425         (test):
426         * tests/es6/Function_is_subclassable_Function.prototype.bind.js: Added.
427         (test.C):
428         (test):
429         * tests/es6/Function_is_subclassable_Function.prototype.call.js: Added.
430         (test.C):
431         (test):
432         * tests/es6/Function_is_subclassable_can_be_called.js: Added.
433         (test.C):
434         (test):
435         * tests/es6/Function_is_subclassable_can_be_used_with_new.js: Added.
436         (test.C):
437         (test):
438         * tests/es6/Function_is_subclassable_correct_prototype_chain.js: Added.
439         (test.C):
440         (test):
441         * tests/es6/HTML-style_comments.js: Added.
442         (test):
443         * tests/es6/Map_-0_key_converts_to_+0.js: Added.
444         (test.set var):
445         * tests/es6/Map_Map.prototype.clear.js: Added.
446         (test):
447         * tests/es6/Map_Map.prototype.delete.js: Added.
448         (test):
449         * tests/es6/Map_Map.prototype.entries.js: Added.
450         (test):
451         * tests/es6/Map_Map.prototype.forEach.js: Added.
452         (test):
453         * tests/es6/Map_Map.prototype.keys.js: Added.
454         (test):
455         * tests/es6/Map_Map.prototype.set_returns_this.js: Added.
456         * tests/es6/Map_Map.prototype.size.js: Added.
457         * tests/es6/Map_Map.prototype.values.js: Added.
458         (test):
459         * tests/es6/Map_Map.prototype[Symbol.iterator].js: Added.
460         (test):
461         * tests/es6/Map_Map[Symbol.species].js: Added.
462         (test):
463         * tests/es6/Map_Map_iterator_prototype_chain.js: Added.
464         (test):
465         * tests/es6/Map_basic_functionality.js: Added.
466         * tests/es6/Map_constructor_accepts_null.js: Added.
467         (test):
468         * tests/es6/Map_constructor_arguments.js: Added.
469         * tests/es6/Map_constructor_invokes_set.js: Added.
470         * tests/es6/Map_constructor_requires_new.js: Added.
471         (test):
472         * tests/es6/Map_iterator_closing.js: Added.
473         (test.):
474         (test):
475         * tests/es6/Math_methods_Math.acosh.js: Added.
476         (test):
477         * tests/es6/Math_methods_Math.asinh.js: Added.
478         (test):
479         * tests/es6/Math_methods_Math.atanh.js: Added.
480         (test):
481         * tests/es6/Math_methods_Math.cbrt.js: Added.
482         (test):
483         * tests/es6/Math_methods_Math.clz32.js: Added.
484         (test):
485         * tests/es6/Math_methods_Math.cosh.js: Added.
486         (test):
487         * tests/es6/Math_methods_Math.expm1.js: Added.
488         (test):
489         * tests/es6/Math_methods_Math.fround.js: Added.
490         (test):
491         * tests/es6/Math_methods_Math.hypot.js: Added.
492         (test):
493         * tests/es6/Math_methods_Math.imul.js: Added.
494         (test):
495         * tests/es6/Math_methods_Math.log10.js: Added.
496         (test):
497         * tests/es6/Math_methods_Math.log1p.js: Added.
498         (test):
499         * tests/es6/Math_methods_Math.log2.js: Added.
500         (test):
501         * tests/es6/Math_methods_Math.sign.js: Added.
502         (test):
503         * tests/es6/Math_methods_Math.sinh.js: Added.
504         (test):
505         * tests/es6/Math_methods_Math.tanh.js: Added.
506         (test):
507         * tests/es6/Math_methods_Math.trunc.js: Added.
508         (test):
509         * tests/es6/Number_properties_Number.EPSILON.js: Added.
510         (test):
511         * tests/es6/Number_properties_Number.MAX_SAFE_INTEGER.js: Added.
512         (test):
513         * tests/es6/Number_properties_Number.MIN_SAFE_INTEGER.js: Added.
514         (test):
515         * tests/es6/Number_properties_Number.isFinite.js: Added.
516         (test):
517         * tests/es6/Number_properties_Number.isInteger.js: Added.
518         (test):
519         * tests/es6/Number_properties_Number.isNaN.js: Added.
520         (test):
521         * tests/es6/Number_properties_Number.isSafeInteger.js: Added.
522         (test):
523         * tests/es6/Object.prototype.__proto___absent_from_Object.createnull.js: Added.
524         (test):
525         * tests/es6/Object.prototype.__proto___correct_property_descriptor.js: Added.
526         (test.A):
527         (test):
528         * tests/es6/Object.prototype.__proto___get_prototype.js: Added.
529         (test.A):
530         (test):
531         * tests/es6/Object.prototype.__proto___present_in_Object.getOwnPropertyNames.js: Added.
532         (test):
533         * tests/es6/Object.prototype.__proto___present_in_hasOwnProperty.js: Added.
534         (test):
535         * tests/es6/Object.prototype.__proto___set_prototype.js: Added.
536         (test):
537         * tests/es6/Object_static_methods_Object.assign.js: Added.
538         (test):
539         * tests/es6/Object_static_methods_Object.getOwnPropertySymbols.js: Added.
540         (test):
541         * tests/es6/Object_static_methods_Object.is.js: Added.
542         (test):
543         * tests/es6/Object_static_methods_Object.setPrototypeOf.js: Added.
544         (test):
545         * tests/es6/Object_static_methods_accept_primitives_Object.freeze.js: Added.
546         (test):
547         * tests/es6/Object_static_methods_accept_primitives_Object.getOwnPropertyDescriptor.js: Added.
548         (test):
549         * tests/es6/Object_static_methods_accept_primitives_Object.getOwnPropertyNames.js: Added.
550         (test):
551         * tests/es6/Object_static_methods_accept_primitives_Object.getPrototypeOf.js: Added.
552         (test):
553         * tests/es6/Object_static_methods_accept_primitives_Object.isExtensible.js: Added.
554         (test):
555         * tests/es6/Object_static_methods_accept_primitives_Object.isFrozen.js: Added.
556         (test):
557         * tests/es6/Object_static_methods_accept_primitives_Object.isSealed.js: Added.
558         (test):
559         * tests/es6/Object_static_methods_accept_primitives_Object.keys.js: Added.
560         (test):
561         * tests/es6/Object_static_methods_accept_primitives_Object.preventExtensions.js: Added.
562         (test):
563         * tests/es6/Object_static_methods_accept_primitives_Object.seal.js: Added.
564         (test):
565         * tests/es6/Promise_Promise.all.js: Added.
566         (test):
567         * tests/es6/Promise_Promise.all_generic_iterables.js: Added.
568         (test):
569         * tests/es6/Promise_Promise.race.js: Added.
570         (test):
571         * tests/es6/Promise_Promise.race_generic_iterables.js: Added.
572         (test):
573         * tests/es6/Promise_Promise[Symbol.species].js: Added.
574         (test):
575         * tests/es6/Promise_basic_functionality.js: Added.
576         (test.thenFn):
577         (test.catchFn):
578         (test.shouldNotRun):
579         (test):
580         * tests/es6/Promise_constructor_requires_new.js: Added.
581         (test):
582         * tests/es6/Promise_is_subclassable_Promise.all.js: Added.
583         (test.P):
584         (test):
585         * tests/es6/Promise_is_subclassable_Promise.race.js: Added.
586         (test.P):
587         (test):
588         * tests/es6/Promise_is_subclassable_basic_functionality.js: Added.
589         (test.P):
590         (test):
591         (test.catchFn):
592         (test.shouldNotRun):
593         * tests/es6/Promise_is_subclassable_correct_prototype_chain.js: Added.
594         (test.C):
595         (test):
596         * tests/es6/Proxy_Array.isArray_support.js: Added.
597         (test):
598         * tests/es6/Proxy_JSON.stringify_support.js: Added.
599         (test):
600         * tests/es6/Proxy_Proxy.revocable.js: Added.
601         (test.):
602         (test.get var):
603         (test):
604         * tests/es6/Proxy_apply_handler.js: Added.
605         (test.proxied):
606         (test.host.):
607         (test):
608         * tests/es6/Proxy_construct_handler.js: Added.
609         (test.proxied):
610         (test.):
611         (test):
612         * tests/es6/Proxy_constructor_requires_new.js: Added.
613         (test):
614         * tests/es6/Proxy_defineProperty_handler.js: Added.
615         (test.):
616         (test):
617         * tests/es6/Proxy_deleteProperty_handler.js: Added.
618         (test.):
619         (test):
620         * tests/es6/Proxy_enumerate_handler.js: Added.
621         (test.):
622         (test):
623         * tests/es6/Proxy_getOwnPropertyDescriptor_handler.js: Added.
624         (test.):
625         (test):
626         * tests/es6/Proxy_getPrototypeOf_handler.js: Added.
627         (test.):
628         (test):
629         * tests/es6/Proxy_get_handler.js: Added.
630         (test.):
631         * tests/es6/Proxy_get_handler_instances_of_proxies.js: Added.
632         (test.):
633         * tests/es6/Proxy_has_handler.js: Added.
634         (test.):
635         (test):
636         * tests/es6/Proxy_has_handler_instances_of_proxies.js: Added.
637         (test.):
638         (test):
639         * tests/es6/Proxy_internal_defineProperty_calls_SetIntegrityLevel.js: Added.
640         (test.):
641         (test):
642         * tests/es6/Proxy_internal_defineProperty_calls_[[Set]].js: Added.
643         (test.):
644         (test):
645         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.copyWithin.js: Added.
646         (test.):
647         (test):
648         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.pop.js: Added.
649         (test.):
650         (test):
651         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.reverse.js: Added.
652         (test.):
653         (test):
654         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.shift.js: Added.
655         (test.):
656         (test):
657         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.splice.js: Added.
658         (test.):
659         (test):
660         * tests/es6/Proxy_internal_deleteProperty_calls_Array.prototype.unshift.js: Added.
661         (test.):
662         (test):
663         * tests/es6/Proxy_internal_getOwnPropertyDescriptor_calls_Function.prototype.bind.js: Added.
664         (test.):
665         (test):
666         * tests/es6/Proxy_internal_getOwnPropertyDescriptor_calls_Object.assign.js: Added.
667         (test.):
668         (test):
669         * tests/es6/Proxy_internal_getOwnPropertyDescriptor_calls_Object.prototype.hasOwnProperty.js: Added.
670         (test.):
671         (test):
672         * tests/es6/Proxy_internal_getOwnPropertyDescriptor_calls_[[Set]].js: Added.
673         (test.):
674         (test):
675         * tests/es6/Proxy_internal_get_calls_Array.from.js: Added.
676         (test.get var):
677         (test.):
678         * tests/es6/Proxy_internal_get_calls_Array.prototype.concat.js: Added.
679         (test.):
680         (test.get var):
681         * tests/es6/Proxy_internal_get_calls_Array.prototype.pop.js: Added.
682         (test.):
683         (test.get var):
684         * tests/es6/Proxy_internal_get_calls_Array.prototype.reverse.js: Added.
685         (test.):
686         (test.get var):
687         * tests/es6/Proxy_internal_get_calls_Array.prototype.shift.js: Added.
688         (test.):
689         (test.get var):
690         * tests/es6/Proxy_internal_get_calls_Array.prototype.splice.js: Added.
691         (test.):
692         (test.get var):
693         * tests/es6/Proxy_internal_get_calls_Array.prototype.toString.js: Added.
694         (test.get var):
695         (test.):
696         * tests/es6/Proxy_internal_get_calls_Array.prototype_iteration_methods.js: Added.
697         (test.get var):
698         (test.):
699         * tests/es6/Proxy_internal_get_calls_ClassDefinitionEvaluation.js: Added.
700         (test.):
701         (test.get var):
702         (test):
703         * tests/es6/Proxy_internal_get_calls_CreateDynamicFunction.js: Added.
704         (test.):
705         (test.get var):
706         * tests/es6/Proxy_internal_get_calls_CreateListFromArrayLike.js: Added.
707         (test.get var):
708         (test.):
709         (test.get Function):
710         * tests/es6/Proxy_internal_get_calls_Date.prototype.toJSON.js: Added.
711         (test.get var):
712         (test.):
713         * tests/es6/Proxy_internal_get_calls_Error.prototype.toString.js: Added.
714         (test.get var):
715         (test.):
716         * tests/es6/Proxy_internal_get_calls_Function.prototype.bind.js: Added.
717         (test.):
718         (test.get var):
719         * tests/es6/Proxy_internal_get_calls_HasBinding.js: Added.
720         (test.get var):
721         (test.):
722         (test.get p):
723         * tests/es6/Proxy_internal_get_calls_IteratorComplete_IteratorValue.js: Added.
724         (test.get var):
725         (test.iterable.Symbol.iterator.return.next.):
726         (test.iterable.Symbol.iterator.return.next):
727         (test.iterable.Symbol.iterator):
728         * tests/es6/Proxy_internal_get_calls_JSON.stringify.js: Added.
729         (test.get var):
730         (test.):
731         * tests/es6/Proxy_internal_get_calls_Object.assign.js: Added.
732         (test.get var):
733         (test.):
734         (test.get Object):
735         * tests/es6/Proxy_internal_get_calls_Object.defineProperties.js: Added.
736         (test.get var):
737         (test.):
738         (test.get Object):
739         * tests/es6/Proxy_internal_get_calls_Promise_resolve_functions.js: Added.
740         (test.get var):
741         (test.):
742         (test.get new):
743         * tests/es6/Proxy_internal_get_calls_RegExp.prototype.flags.js: Added.
744         (test.get var):
745         (test.):
746         * tests/es6/Proxy_internal_get_calls_RegExp.prototype.test.js: Added.
747         (test.get var.p.new.Proxy):
748         (test.get var):
749         (test.):
750         * tests/es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.match].js: Added.
751         (test.get var.p.new.Proxy):
752         (test.get var):
753         (test.):
754         * tests/es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.replace].js: Added.
755         (test.get var.p.new.Proxy):
756         (test.get var):
757         (test.):
758         * tests/es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.search].js: Added.
759         (test.get var.p.new.Proxy):
760         (test.get var):
761         (test.):
762         * tests/es6/Proxy_internal_get_calls_RegExp.prototype[Symbol.split].js: Added.
763         (test.p.new.Proxy):
764         (test.get var):
765         (test.):
766         * tests/es6/Proxy_internal_get_calls_RegExp_constructor.js: Added.
767         (test.get var):
768         (test.):
769         * tests/es6/Proxy_internal_get_calls_String.prototype.match.js: Added.
770         (test.get var):
771         (test.):
772         * tests/es6/Proxy_internal_get_calls_String.prototype.replace.js: Added.
773         (test.get var):
774         (test.):
775         * tests/es6/Proxy_internal_get_calls_String.prototype.search.js: Added.
776         (test.get var):
777         (test.):
778         * tests/es6/Proxy_internal_get_calls_String.prototype.split.js: Added.
779         (test.get var):
780         (test.):
781         * tests/es6/Proxy_internal_get_calls_String.raw.js: Added.
782         (test.get var):
783         (test.):
784         * tests/es6/Proxy_internal_get_calls_ToPrimitive.js: Added.
785         (test.get var):
786         (test.):
787         * tests/es6/Proxy_internal_get_calls_ToPropertyDescriptor.js: Added.
788         (test.get var):
789         (test.):
790         (test.set get try):
791         * tests/es6/Proxy_internal_get_calls_instanceof_operator.js: Added.
792         (test.):
793         (test.get var):
794         * tests/es6/Proxy_internal_ownKeys_calls_SerializeJSONObject.js: Added.
795         (test.):
796         (test):
797         * tests/es6/Proxy_internal_ownKeys_calls_SetIntegrityLevel.js: Added.
798         (test.):
799         (test):
800         * tests/es6/Proxy_internal_ownKeys_calls_TestIntegrityLevel.js: Added.
801         (test.):
802         (test):
803         * tests/es6/Proxy_internal_set_calls_Array.from.js: Added.
804         (test.set var):
805         (test.):
806         (test.set Array):
807         * tests/es6/Proxy_internal_set_calls_Array.of.js: Added.
808         (test.set var):
809         (test.):
810         (test.set Array):
811         * tests/es6/Proxy_internal_set_calls_Array.prototype.copyWithin.js: Added.
812         (test.):
813         (test.set var):
814         * tests/es6/Proxy_internal_set_calls_Array.prototype.fill.js: Added.
815         (test.):
816         (test.set var):
817         * tests/es6/Proxy_internal_set_calls_Array.prototype.pop.js: Added.
818         (test.):
819         (test.set var):
820         * tests/es6/Proxy_internal_set_calls_Array.prototype.push.js: Added.
821         (test.):
822         (test.set var):
823         * tests/es6/Proxy_internal_set_calls_Array.prototype.reverse.js: Added.
824         (test.):
825         (test.set var):
826         * tests/es6/Proxy_internal_set_calls_Array.prototype.shift.js: Added.
827         (test.):
828         (test.set var):
829         * tests/es6/Proxy_internal_set_calls_Array.prototype.splice.js: Added.
830         (test.):
831         (test.set var):
832         * tests/es6/Proxy_internal_set_calls_Array.prototype.unshift.js: Added.
833         (test.):
834         (test.set var):
835         * tests/es6/Proxy_internal_set_calls_Object.assign.js: Added.
836         (test.set var):
837         (test.):
838         (test.set Object):
839         * tests/es6/Proxy_isExtensible_handler.js: Added.
840         (test.):
841         (test):
842         * tests/es6/Proxy_ownKeys_handler.js: Added.
843         (test.):
844         (test):
845         * tests/es6/Proxy_preventExtensions_handler.js: Added.
846         (test.):
847         (test):
848         * tests/es6/Proxy_setPrototypeOf_handler.js: Added.
849         (test.):
850         (test):
851         * tests/es6/Proxy_set_handler.js: Added.
852         (test.):
853         * tests/es6/Proxy_set_handler_instances_of_proxies.js: Added.
854         (test.):
855         * tests/es6/Reflect_Reflect.apply.js: Added.
856         (test):
857         * tests/es6/Reflect_Reflect.construct.js: Added.
858         (test):
859         * tests/es6/Reflect_Reflect.construct_creates_instance_from_newTarget_argument.js: Added.
860         (test.F):
861         (test):
862         * tests/es6/Reflect_Reflect.construct_sets_new.target_meta_property.js: Added.
863         (test):
864         * tests/es6/Reflect_Reflect.defineProperty.js: Added.
865         (test):
866         * tests/es6/Reflect_Reflect.deleteProperty.js: Added.
867         (test):
868         * tests/es6/Reflect_Reflect.enumerate.js: Added.
869         (test):
870         * tests/es6/Reflect_Reflect.get.js: Added.
871         * tests/es6/Reflect_Reflect.getOwnPropertyDescriptor.js: Added.
872         (test):
873         * tests/es6/Reflect_Reflect.getPrototypeOf.js: Added.
874         (test):
875         * tests/es6/Reflect_Reflect.has.js: Added.
876         (test):
877         * tests/es6/Reflect_Reflect.isExtensible.js: Added.
878         (test):
879         * tests/es6/Reflect_Reflect.ownKeys_string_keys.js: Added.
880         (test):
881         * tests/es6/Reflect_Reflect.ownKeys_symbol_keys.js: Added.
882         (test):
883         * tests/es6/Reflect_Reflect.preventExtensions.js: Added.
884         (test):
885         * tests/es6/Reflect_Reflect.set.js: Added.
886         * tests/es6/Reflect_Reflect.setPrototypeOf.js: Added.
887         (test):
888         * tests/es6/RegExp.prototype.compile.js: Added.
889         (test):
890         * tests/es6/RegExp.prototype_properties_RegExp.prototype.flags.js: Added.
891         (test):
892         * tests/es6/RegExp.prototype_properties_RegExp.prototype[Symbol.match].js: Added.
893         (test):
894         * tests/es6/RegExp.prototype_properties_RegExp.prototype[Symbol.replace].js: Added.
895         (test):
896         * tests/es6/RegExp.prototype_properties_RegExp.prototype[Symbol.search].js: Added.
897         (test):
898         * tests/es6/RegExp.prototype_properties_RegExp.prototype[Symbol.split].js: Added.
899         (test):
900         * tests/es6/RegExp.prototype_properties_RegExp[Symbol.species].js: Added.
901         (test):
902         * tests/es6/RegExp_is_subclassable_RegExp.prototype.exec.js: Added.
903         (test.R):
904         (test):
905         * tests/es6/RegExp_is_subclassable_RegExp.prototype.test.js: Added.
906         (test.R):
907         (test):
908         * tests/es6/RegExp_is_subclassable_basic_functionality.js: Added.
909         (test.R):
910         (test):
911         * tests/es6/RegExp_is_subclassable_correct_prototype_chain.js: Added.
912         (test.R):
913         (test):
914         * tests/es6/RegExp_syntax_extensions_hyphens_in_character_sets.js: Added.
915         (test):
916         * tests/es6/RegExp_syntax_extensions_incomplete_patterns_and_quantifiers.js: Added.
917         * tests/es6/RegExp_syntax_extensions_invalid_Unicode_escapes.js: Added.
918         (test):
919         * tests/es6/RegExp_syntax_extensions_invalid_backreferences_become_octal_escapes.js: Added.
920         (test):
921         * tests/es6/RegExp_syntax_extensions_invalid_character_escapes.js: Added.
922         (test):
923         * tests/es6/RegExp_syntax_extensions_invalid_control-character_escapes.js: Added.
924         (test):
925         * tests/es6/RegExp_syntax_extensions_invalid_hexadecimal_escapes.js: Added.
926         (test):
927         * tests/es6/RegExp_syntax_extensions_octal_escape_sequences.js: Added.
928         (test):
929         * tests/es6/RegExp_y_and_u_flags_u_flag.js: Added.
930         (test):
931         * tests/es6/RegExp_y_and_u_flags_u_flag_Unicode_code_point_escapes.js: Added.
932         (test):
933         * tests/es6/RegExp_y_and_u_flags_y_flag.js: Added.
934         (test):
935         * tests/es6/RegExp_y_and_u_flags_y_flag_lastIndex.js: Added.
936         (test):
937         * tests/es6/Set_-0_key_converts_to_+0.js: Added.
938         (test.set forEach):
939         * tests/es6/Set_Set.prototype.add_returns_this.js: Added.
940         * tests/es6/Set_Set.prototype.clear.js: Added.
941         (test):
942         * tests/es6/Set_Set.prototype.delete.js: Added.
943         (test):
944         * tests/es6/Set_Set.prototype.entries.js: Added.
945         (test):
946         * tests/es6/Set_Set.prototype.forEach.js: Added.
947         (test):
948         * tests/es6/Set_Set.prototype.keys.js: Added.
949         (test):
950         * tests/es6/Set_Set.prototype.size.js: Added.
951         * tests/es6/Set_Set.prototype.values.js: Added.
952         (test):
953         * tests/es6/Set_Set.prototype[Symbol.iterator].js: Added.
954         (test):
955         * tests/es6/Set_Set[Symbol.species].js: Added.
956         (test):
957         * tests/es6/Set_Set_iterator_prototype_chain.js: Added.
958         (test):
959         * tests/es6/Set_basic_functionality.js: Added.
960         * tests/es6/Set_constructor_accepts_null.js: Added.
961         (test):
962         * tests/es6/Set_constructor_arguments.js: Added.
963         * tests/es6/Set_constructor_invokes_add.js: Added.
964         (test.Set.prototype.add):
965         (test):
966         * tests/es6/Set_constructor_requires_new.js: Added.
967         (test):
968         * tests/es6/Set_iterator_closing.js: Added.
969         (test.):
970         (test.Set.prototype.add):
971         (test):
972         * tests/es6/String.prototype_HTML_methods_existence.js: Added.
973         (test):
974         * tests/es6/String.prototype_HTML_methods_quotes_in_arguments_are_escaped.js: Added.
975         (test):
976         * tests/es6/String.prototype_HTML_methods_tags_names_are_lowercase.js: Added.
977         (test):
978         * tests/es6/String.prototype_methods_String.prototype.codePointAt.js: Added.
979         (test):
980         * tests/es6/String.prototype_methods_String.prototype.endsWith.js: Added.
981         (test):
982         * tests/es6/String.prototype_methods_String.prototype.includes.js: Added.
983         (test):
984         * tests/es6/String.prototype_methods_String.prototype.normalize.js: Added.
985         (test):
986         * tests/es6/String.prototype_methods_String.prototype.repeat.js: Added.
987         (test):
988         * tests/es6/String.prototype_methods_String.prototype.startsWith.js: Added.
989         (test):
990         * tests/es6/String.prototype_methods_String.prototype[Symbol.iterator].js: Added.
991         (test):
992         * tests/es6/String.prototype_methods_String_iterator_prototype_chain.js: Added.
993         (test):
994         * tests/es6/String_static_methods_String.fromCodePoint.js: Added.
995         (test):
996         * tests/es6/String_static_methods_String.raw.js: Added.
997         (test):
998         * tests/es6/Symbol_JSON.stringify_ignores_symbols.js: Added.
999         (test):
1000         * tests/es6/Symbol_Object.defineProperty_support.js: Added.
1001         (test):
1002         * tests/es6/Symbol_Objectsymbol.js: Added.
1003         (test):
1004         * tests/es6/Symbol_basic_functionality.js: Added.
1005         (test):
1006         * tests/es6/Symbol_can_convert_with_String.js: Added.
1007         (test):
1008         * tests/es6/Symbol_cannot_coerce_to_string_or_number.js: Added.
1009         (test):
1010         * tests/es6/Symbol_global_symbol_registry.js: Added.
1011         (test):
1012         * tests/es6/Symbol_new_Symbol_throws.js: Added.
1013         (test):
1014         * tests/es6/Symbol_symbol_keys_are_hidden_to_pre-ES6_code.js: Added.
1015         (test):
1016         * tests/es6/Symbol_typeof_support.js: Added.
1017         (test):
1018         * tests/es6/Unicode_code_point_escapes_in_identifiers.js: Added.
1019         (test):
1020         * tests/es6/Unicode_code_point_escapes_in_strings.js: Added.
1021         (test):
1022         * tests/es6/WeakMap_WeakMap.prototype.delete.js: Added.
1023         (test):
1024         * tests/es6/WeakMap_WeakMap.prototype.set_returns_this.js: Added.
1025         * tests/es6/WeakMap_basic_functionality.js: Added.
1026         * tests/es6/WeakMap_constructor_accepts_null.js: Added.
1027         (test):
1028         * tests/es6/WeakMap_constructor_arguments.js: Added.
1029         * tests/es6/WeakMap_constructor_invokes_set.js: Added.
1030         * tests/es6/WeakMap_constructor_requires_new.js: Added.
1031         (test):
1032         * tests/es6/WeakMap_frozen_objects_as_keys.js: Added.
1033         * tests/es6/WeakMap_iterator_closing.js: Added.
1034         (test.):
1035         (test):
1036         * tests/es6/WeakMap_no_WeakMap.prototype.clear_method.js: Added.
1037         * tests/es6/WeakSet_WeakSet.prototype.add_returns_this.js: Added.
1038         (test):
1039         * tests/es6/WeakSet_WeakSet.prototype.delete.js: Added.
1040         (test):
1041         * tests/es6/WeakSet_basic_functionality.js: Added.
1042         (test):
1043         * tests/es6/WeakSet_constructor_accepts_null.js: Added.
1044         (test):
1045         * tests/es6/WeakSet_constructor_arguments.js: Added.
1046         (test):
1047         * tests/es6/WeakSet_constructor_invokes_add.js: Added.
1048         (test.WeakSet.prototype.add):
1049         (test):
1050         * tests/es6/WeakSet_constructor_requires_new.js: Added.
1051         (test):
1052         * tests/es6/WeakSet_iterator_closing.js: Added.
1053         (test.):
1054         (test):
1055         * tests/es6/WeakSet_no_WeakSet.prototype.clear_method.js: Added.
1056         (test):
1057         * tests/es6/__proto___in_object_literals_basic_support.js: Added.
1058         (test):
1059         * tests/es6/__proto___in_object_literals_multiple___proto___is_an_error.js: Added.
1060         (test):
1061         * tests/es6/__proto___in_object_literals_not_a_computed_property.js: Added.
1062         (test):
1063         * tests/es6/__proto___in_object_literals_not_a_shorthand_method.js: Added.
1064         (test):
1065         * tests/es6/__proto___in_object_literals_not_a_shorthand_property.js: Added.
1066         (test):
1067         * tests/es6/arrow_functions_0_parameters.js: Added.
1068         (test):
1069         * tests/es6/arrow_functions_1_parameter_no_brackets.js: Added.
1070         (test):
1071         * tests/es6/arrow_functions_cant_be_bound_can_be_curried.js: Added.
1072         (test.d.y):
1073         (test):
1074         * tests/es6/arrow_functions_correct_precedence.js: Added.
1075         (test):
1076         * tests/es6/arrow_functions_lexical_arguments_binding.js: Added.
1077         (test.f):
1078         (test):
1079         * tests/es6/arrow_functions_lexical_new.target_binding.js: Added.
1080         (test.C):
1081         (test):
1082         * tests/es6/arrow_functions_lexical_super_binding.js: Added.
1083         (test.B.prototype.qux):
1084         (test.B):
1085         (test.C.prototype.baz):
1086         (test.C):
1087         (test):
1088         * tests/es6/arrow_functions_lexical_this_binding.js: Added.
1089         (test.d.y):
1090         (test):
1091         * tests/es6/arrow_functions_multiple_parameters.js: Added.
1092         (test):
1093         * tests/es6/arrow_functions_no_line_break_between_params_and_code_=_code.js: Added.
1094         (test):
1095         * tests/es6/arrow_functions_no_prototype_property.js: Added.
1096         (test):
1097         * tests/es6/arrow_functions_this_unchanged_by_call_or_apply.js: Added.
1098         (test.d.y):
1099         (test):
1100         * tests/es6/block-level_function_declaration.js: Added.
1101         (test.f):
1102         (test):
1103         * tests/es6/class_accessor_properties.js: Added.
1104         (test.C.prototype.get foo):
1105         (test.C.prototype.set bar):
1106         (test.C):
1107         (test):
1108         * tests/es6/class_anonymous_class.js: Added.
1109         * tests/es6/class_class_expression.js: Added.
1110         (test.return.typeof.C):
1111         (test):
1112         * tests/es6/class_class_name_is_lexically_scoped.js: Added.
1113         (test.C.prototype.method):
1114         (test.C):
1115         (test):
1116         * tests/es6/class_class_statement.js: Added.
1117         (test.C):
1118         (test):
1119         * tests/es6/class_computed_accessor_properties.js: Added.
1120         (test.C.prototype.get garply):
1121         (test.C.prototype.set grault):
1122         (test.C):
1123         (test):
1124         * tests/es6/class_computed_names_temporal_dead_zone.js: Added.
1125         (test.try.B.prototype.C):
1126         (test.try.B):
1127         (test):
1128         * tests/es6/class_computed_prototype_methods.js: Added.
1129         (test.C.prototype.foo):
1130         (test.C):
1131         (test):
1132         * tests/es6/class_computed_static_accessor_properties.js: Added.
1133         (test.C.prototype.get garply):
1134         (test.C.prototype.set grault):
1135         (test.C):
1136         (test):
1137         * tests/es6/class_computed_static_methods.js: Added.
1138         (test.C.foo):
1139         (test.C):
1140         (test):
1141         * tests/es6/class_constructor.js: Added.
1142         (test.C):
1143         (test):
1144         * tests/es6/class_constructor_requires_new.js: Added.
1145         (test.C):
1146         (test):
1147         * tests/es6/class_extends.js: Added.
1148         (test.B):
1149         (test.C):
1150         (test):
1151         * tests/es6/class_extends_expressions.js: Added.
1152         (test.C):
1153         (test):
1154         * tests/es6/class_extends_null.js: Added.
1155         (test.C):
1156         (test):
1157         * tests/es6/class_implicit_strict_mode.js: Added.
1158         (test.C.method):
1159         (test.C):
1160         (test):
1161         * tests/es6/class_is_block-scoped.js: Added.
1162         (test.C):
1163         (test):
1164         * tests/es6/class_methods_arent_enumerable.js: Added.
1165         (test.C.prototype.foo):
1166         (test.C.bar):
1167         (test.C):
1168         (test):
1169         * tests/es6/class_new.target.js: Added.
1170         (test.new.f):
1171         (test.A):
1172         (test.B):
1173         (test):
1174         * tests/es6/class_prototype_methods.js: Added.
1175         (test.C.prototype.method):
1176         (test.C):
1177         (test):
1178         * tests/es6/class_static_accessor_properties.js: Added.
1179         (test.C.prototype.get foo):
1180         (test.C.prototype.set bar):
1181         (test.C):
1182         (test):
1183         * tests/es6/class_static_methods.js: Added.
1184         (test.C.method):
1185         (test.C):
1186         (test):
1187         * tests/es6/class_string-keyed_methods.js: Added.
1188         (test.C.prototype.string_appeared_here):
1189         (test.C):
1190         (test):
1191         * tests/es6/const_basic_support.js: Added.
1192         (test):
1193         * tests/es6/const_basic_support_strict_mode.js: Added.
1194         (test):
1195         * tests/es6/const_is_block-scoped.js: Added.
1196         (test):
1197         * tests/es6/const_is_block-scoped_strict_mode.js: Added.
1198         (test):
1199         * tests/es6/const_redefining_a_const_is_an_error.js: Added.
1200         (test):
1201         * tests/es6/const_redefining_a_const_strict_mode.js: Added.
1202         (test):
1203         * tests/es6/const_temporal_dead_zone.js: Added.
1204         (test.passed):
1205         (test):
1206         * tests/es6/const_temporal_dead_zone_strict_mode.js: Added.
1207         (test.passed):
1208         (test):
1209         * tests/es6/default_function_parameters_arguments_object_interaction.js: Added.
1210         (test):
1211         * tests/es6/default_function_parameters_basic_functionality.js: Added.
1212         (test):
1213         * tests/es6/default_function_parameters_defaults_can_refer_to_previous_params.js: Added.
1214         (test):
1215         * tests/es6/default_function_parameters_explicit_undefined_defers_to_the_default.js: Added.
1216         (test):
1217         * tests/es6/default_function_parameters_new_Function_support.js: Added.
1218         (test):
1219         * tests/es6/default_function_parameters_separate_scope.js: Added.
1220         (test.return):
1221         (test):
1222         * tests/es6/default_function_parameters_temporal_dead_zone.js: Added.
1223         (test):
1224         * tests/es6/destructuring_chained_iterable_destructuring.js: Added.
1225         (test):
1226         * tests/es6/destructuring_chained_object_destructuring.js: Added.
1227         (test):
1228         * tests/es6/destructuring_computed_properties.js: Added.
1229         (test):
1230         * tests/es6/destructuring_defaults.js: Added.
1231         (test):
1232         * tests/es6/destructuring_defaults_in_parameters.js: Added.
1233         (test):
1234         * tests/es6/destructuring_defaults_in_parameters_new_Function_support.js: Added.
1235         (test):
1236         * tests/es6/destructuring_defaults_in_parameters_separate_scope.js: Added.
1237         (test.return):
1238         (test):
1239         * tests/es6/destructuring_defaults_let_temporal_dead_zone.js: Added.
1240         (test):
1241         * tests/es6/destructuring_empty_patterns.js: Added.
1242         (test):
1243         * tests/es6/destructuring_empty_patterns_in_parameters.js: Added.
1244         (test):
1245         * tests/es6/destructuring_in_for-in_loop_heads.js: Added.
1246         (test):
1247         * tests/es6/destructuring_in_for-of_loop_heads.js: Added.
1248         (test):
1249         * tests/es6/destructuring_in_parameters.js: Added.
1250         (test):
1251         * tests/es6/destructuring_in_parameters_arguments_interaction.js: Added.
1252         (test):
1253         * tests/es6/destructuring_in_parameters_function_length_property.js: Added.
1254         (test):
1255         * tests/es6/destructuring_in_parameters_new_Function_support.js: Added.
1256         (test):
1257         * tests/es6/destructuring_iterable_destructuring_expression.js: Added.
1258         (test):
1259         * tests/es6/destructuring_iterator_closing.js: Added.
1260         (test.):
1261         (test):
1262         * tests/es6/destructuring_multiples_in_a_single_var_statement.js: Added.
1263         (test):
1264         * tests/es6/destructuring_nested.js: Added.
1265         (test):
1266         * tests/es6/destructuring_nested_rest.js: Added.
1267         (test):
1268         * tests/es6/destructuring_object_destructuring_expression.js: Added.
1269         (test):
1270         * tests/es6/destructuring_object_destructuring_with_primitives.js: Added.
1271         (test):
1272         * tests/es6/destructuring_parenthesised_left-hand-side_is_a_syntax_error.js: Added.
1273         (test):
1274         * tests/es6/destructuring_rest.js: Added.
1275         (test):
1276         * tests/es6/destructuring_throws_on_null_and_undefined.js: Added.
1277         (test):
1278         * tests/es6/destructuring_trailing_commas_in_iterable_patterns.js: Added.
1279         (test):
1280         * tests/es6/destructuring_trailing_commas_in_object_patterns.js: Added.
1281         (test):
1282         * tests/es6/destructuring_with_arrays.js: Added.
1283         (test):
1284         * tests/es6/destructuring_with_astral_plane_strings.js: Added.
1285         (test):
1286         * tests/es6/destructuring_with_generator_instances.js: Added.
1287         (test.c):
1288         (test.e):
1289         (test):
1290         * tests/es6/destructuring_with_generic_iterables.js: Added.
1291         (test):
1292         * tests/es6/destructuring_with_instances_of_generic_iterables.js: Added.
1293         (test):
1294         * tests/es6/destructuring_with_objects.js: Added.
1295         (test):
1296         * tests/es6/destructuring_with_sparse_arrays.js: Added.
1297         (test):
1298         * tests/es6/destructuring_with_strings.js: Added.
1299         (test):
1300         * tests/es6/for..of_loops_iterator_closing_break.js: Added.
1301         (test.):
1302         (test):
1303         * tests/es6/for..of_loops_iterator_closing_throw.js: Added.
1304         (test.):
1305         (test):
1306         * tests/es6/for..of_loops_with_arrays.js: Added.
1307         (test):
1308         * tests/es6/for..of_loops_with_astral_plane_strings.js: Added.
1309         (test):
1310         * tests/es6/for..of_loops_with_generator_instances.js: Added.
1311         (test.iterable):
1312         (test):
1313         * tests/es6/for..of_loops_with_generic_iterables.js: Added.
1314         (test):
1315         * tests/es6/for..of_loops_with_instances_of_generic_iterables.js: Added.
1316         (test):
1317         * tests/es6/for..of_loops_with_sparse_arrays.js: Added.
1318         (test):
1319         * tests/es6/for..of_loops_with_strings.js: Added.
1320         (test):
1321         * tests/es6/function_name_property_accessor_properties.js: Added.
1322         (test.o.get foo):
1323         (test.o.set foo):
1324         * tests/es6/function_name_property_bound_functions.js: Added.
1325         (test.foo):
1326         (test):
1327         * tests/es6/function_name_property_class_expressions.js: Added.
1328         (test.return.foo):
1329         (test.name.string_appeared_here.typeof.bar.name):
1330         (test.name.string_appeared_here.typeof.bar):
1331         (test):
1332         * tests/es6/function_name_property_class_prototype_methods.js: Added.
1333         (test.C.prototype.foo):
1334         (test.C):
1335         (test):
1336         * tests/es6/function_name_property_class_statements.js: Added.
1337         (test.foo):
1338         (test.bar.name):
1339         (test.bar):
1340         (test):
1341         * tests/es6/function_name_property_class_static_methods.js: Added.
1342         (test.C.foo):
1343         (test.C):
1344         (test):
1345         * tests/es6/function_name_property_function_expressions.js: Added.
1346         (test):
1347         * tests/es6/function_name_property_function_statements.js: Added.
1348         (test.foo):
1349         (test):
1350         * tests/es6/function_name_property_isnt_writable_is_configurable.js: Added.
1351         (test):
1352         * tests/es6/function_name_property_new_Function.js: Added.
1353         (test):
1354         * tests/es6/function_name_property_object_methods_class.js: Added.
1355         (test.o):
1356         * tests/es6/function_name_property_object_methods_function.js: Added.
1357         (test.o.foo):
1358         (test.o.bar):
1359         (test.o.qux):
1360         (test):
1361         * tests/es6/function_name_property_shorthand_methods.js: Added.
1362         (test):
1363         * tests/es6/function_name_property_shorthand_methods_no_lexical_binding.js: Added.
1364         (test):
1365         * tests/es6/function_name_property_symbol-keyed_methods.js: Added.
1366         (test.o.sym1):
1367         (test.o.sym2):
1368         (test):
1369         * tests/es6/function_name_property_variables_class.js: Added.
1370         (test.bar):
1371         (test.qux):
1372         * tests/es6/function_name_property_variables_function.js: Added.
1373         (test.foo):
1374         (test.bar):
1375         (test):
1376         * tests/es6/generators_%GeneratorPrototype%.constructor.js: Added.
1377         (test.g):
1378         (test):
1379         * tests/es6/generators_%GeneratorPrototype%.js: Added.
1380         (test.generatorFn):
1381         (test):
1382         * tests/es6/generators_%GeneratorPrototype%.return.js: Added.
1383         (test.generator):
1384         (test):
1385         * tests/es6/generators_%GeneratorPrototype%.throw.js: Added.
1386         (test.generator):
1387         (test):
1388         * tests/es6/generators_basic_functionality.js: Added.
1389         (test.generator):
1390         (test):
1391         * tests/es6/generators_cant_use_this_with_new.js: Added.
1392         (test.generator):
1393         (test):
1394         * tests/es6/generators_computed_shorthand_generators.js: Added.
1395         (test):
1396         * tests/es6/generators_computed_shorthand_generators_classes.js: Added.
1397         (test.C.prototype.garply):
1398         (test.C):
1399         (test):
1400         * tests/es6/generators_correct_this_binding.js: Added.
1401         (test.generator):
1402         (test):
1403         * tests/es6/generators_generator_function_expressions.js: Added.
1404         (test.generator):
1405         (test):
1406         * tests/es6/generators_sending.js: Added.
1407         (test.generator):
1408         (test):
1409         * tests/es6/generators_shorthand_generator_methods.js: Added.
1410         (test):
1411         * tests/es6/generators_shorthand_generator_methods_classes.js: Added.
1412         (test.C.prototype.generator):
1413         (test.C):
1414         (test):
1415         * tests/es6/generators_string-keyed_shorthand_generator_methods.js: Added.
1416         (test):
1417         * tests/es6/generators_yield_*_arrays.js: Added.
1418         (test.iterator):
1419         (test):
1420         * tests/es6/generators_yield_*_astral_plane_strings.js: Added.
1421         (test.iterator):
1422         (test):
1423         * tests/es6/generators_yield_*_generator_instances.js: Added.
1424         (test.iterator):
1425         (test):
1426         * tests/es6/generators_yield_*_generic_iterables.js: Added.
1427         (test.iterator):
1428         (test):
1429         * tests/es6/generators_yield_*_instances_of_iterables.js: Added.
1430         (test.iterator):
1431         (test):
1432         * tests/es6/generators_yield_*_iterator_closing.js: Added.
1433         (test.):
1434         (test.gen):
1435         (test):
1436         * tests/es6/generators_yield_*_iterator_closing_via_throw.js: Added.
1437         (test.):
1438         (test.gen):
1439         (test):
1440         * tests/es6/generators_yield_*_on_non-iterables_is_a_runtime_error.js: Added.
1441         (test.iterator):
1442         (test):
1443         * tests/es6/generators_yield_*_sparse_arrays.js: Added.
1444         (test.iterator):
1445         (test):
1446         * tests/es6/generators_yield_*_strings.js: Added.
1447         (test.iterator):
1448         (test):
1449         * tests/es6/generators_yield_operator_precedence.js: Added.
1450         (test.generator):
1451         (test):
1452         * tests/es6/let_basic_support.js: Added.
1453         (test):
1454         * tests/es6/let_basic_support_strict_mode.js: Added.
1455         (test):
1456         * tests/es6/let_for-loop_iteration_scope.js: Added.
1457         (test):
1458         * tests/es6/let_for-loop_iteration_scope_strict_mode.js: Added.
1459         (test):
1460         * tests/es6/let_for-loop_statement_scope.js: Added.
1461         (test):
1462         * tests/es6/let_for-loop_statement_scope_strict_mode.js: Added.
1463         (test):
1464         * tests/es6/let_is_block-scoped.js: Added.
1465         (test):
1466         * tests/es6/let_is_block-scoped_strict_mode.js: Added.
1467         (test):
1468         * tests/es6/let_temporal_dead_zone.js: Added.
1469         (test.passed):
1470         (test):
1471         * tests/es6/let_temporal_dead_zone_strict_mode.js: Added.
1472         (test.passed):
1473         (test):
1474         * tests/es6/miscellaneous_Invalid_Date.js: Added.
1475         (test):
1476         * tests/es6/miscellaneous_RegExp_constructor_can_alter_flags.js: Added.
1477         (test):
1478         * tests/es6/miscellaneous_String.prototype_case_methods_Unicode_support.js: Added.
1479         (test):
1480         * tests/es6/miscellaneous_accessors_arent_constructors.js: Added.
1481         (test.get catch):
1482         (test):
1483         * tests/es6/miscellaneous_built-in_prototypes_are_not_instances.js: Added.
1484         (test):
1485         * tests/es6/miscellaneous_duplicate_property_names_in_strict_mode.js: Added.
1486         (test):
1487         * tests/es6/miscellaneous_function_length_is_configurable.js: Added.
1488         (test.fn):
1489         (test):
1490         * tests/es6/miscellaneous_no_assignments_allowed_in_for-in_head.js: Added.
1491         (test):
1492         * tests/es6/miscellaneous_no_escaped_reserved_words_as_identifiers.js: Added.
1493         (test):
1494         * tests/es6/miscellaneous_no_semicolon_needed_after_do-while.js: Added.
1495         (test):
1496         * tests/es6/miscellaneous_subclassables_Boolean_is_subclassable.js: Added.
1497         (test.C):
1498         (test):
1499         * tests/es6/miscellaneous_subclassables_Map_is_subclassable.js: Added.
1500         (test):
1501         * tests/es6/miscellaneous_subclassables_Number_is_subclassable.js: Added.
1502         (test.C):
1503         (test):
1504         * tests/es6/miscellaneous_subclassables_Set_is_subclassable.js: Added.
1505         (test):
1506         * tests/es6/miscellaneous_subclassables_String_is_subclassable.js: Added.
1507         (test.C):
1508         (test):
1509         * tests/es6/new.target_assignment_is_an_early_error.js: Added.
1510         (test.new.f):
1511         (test):
1512         * tests/es6/new.target_in_constructors.js: Added.
1513         (test.new.f):
1514         (test):
1515         * tests/es6/non-strict_function_semantics_function_statements_in_if-statement_clauses.js: Added.
1516         (test.foo):
1517         (test.else.bar):
1518         (test.baz):
1519         (test.qux):
1520         (test.else.qux):
1521         (test):
1522         * tests/es6/non-strict_function_semantics_hoisted_block-level_function_declaration.js: Added.
1523         (test.f):
1524         (test.g):
1525         (test.h):
1526         (test):
1527         * tests/es6/non-strict_function_semantics_labeled_function_statements.js: Added.
1528         (test.label):
1529         (test):
1530         * tests/es6/object_literal_extensions_computed_accessors.js: Added.
1531         (test.obj.get x):
1532         (test.obj.set x):
1533         (test):
1534         * tests/es6/object_literal_extensions_computed_properties.js: Added.
1535         (test):
1536         * tests/es6/object_literal_extensions_computed_shorthand_methods.js: Added.
1537         (test):
1538         * tests/es6/object_literal_extensions_shorthand_methods.js: Added.
1539         (test):
1540         * tests/es6/object_literal_extensions_shorthand_properties.js: Added.
1541         (test):
1542         * tests/es6/object_literal_extensions_string-keyed_shorthand_methods.js: Added.
1543         (test):
1544         * tests/es6/octal_and_binary_literals_binary_literals.js: Added.
1545         (test):
1546         * tests/es6/octal_and_binary_literals_binary_supported_by_Number.js: Added.
1547         (test):
1548         * tests/es6/octal_and_binary_literals_octal_literals.js: Added.
1549         (test):
1550         * tests/es6/octal_and_binary_literals_octal_supported_by_Number.js: Added.
1551         (test):
1552         * tests/es6/own_property_order_JSON.parse.js: Added.
1553         (test):
1554         * tests/es6/own_property_order_JSON.stringify.js: Added.
1555         (test):
1556         * tests/es6/own_property_order_Object.assign.js: Added.
1557         * tests/es6/own_property_order_Object.getOwnPropertyNames.js: Added.
1558         (test):
1559         * tests/es6/own_property_order_Object.keys.js: Added.
1560         (test):
1561         * tests/es6/own_property_order_Reflect.ownKeys_string_key_order.js: Added.
1562         (test):
1563         * tests/es6/own_property_order_Reflect.ownKeys_symbol_key_order.js: Added.
1564         (test):
1565         * tests/es6/own_property_order_for..in.js: Added.
1566         (test):
1567         * tests/es6/proper_tail_calls_tail_call_optimisation_direct_recursion.js: Added.
1568         (test):
1569         * tests/es6/proper_tail_calls_tail_call_optimisation_mutual_recursion.js: Added.
1570         (test.f):
1571         (test.g):
1572         (test):
1573         * tests/es6/prototype_of_bound_functions_arrow_functions.js: Added.
1574         (test.correctProtoBound):
1575         (test):
1576         * tests/es6/prototype_of_bound_functions_basic_functions.js: Added.
1577         (test.correctProtoBound.f):
1578         (test.correctProtoBound):
1579         (test):
1580         * tests/es6/prototype_of_bound_functions_classes.js: Added.
1581         (test.correctProtoBound.C):
1582         (test.correctProtoBound):
1583         (test):
1584         * tests/es6/prototype_of_bound_functions_generator_functions.js: Added.
1585         (test.correctProtoBound.f):
1586         (test.correctProtoBound):
1587         (test):
1588         * tests/es6/prototype_of_bound_functions_subclasses.js: Added.
1589         (test.correctProtoBound.C):
1590         (test.correctProtoBound):
1591         (test):
1592         * tests/es6/rest_parameters_arguments_object_interaction.js: Added.
1593         (test):
1594         * tests/es6/rest_parameters_basic_functionality.js: Added.
1595         (test):
1596         * tests/es6/rest_parameters_cant_be_used_in_setters.js: Added.
1597         (test):
1598         * tests/es6/rest_parameters_function_length_property.js: Added.
1599         (test):
1600         * tests/es6/rest_parameters_new_Function_support.js: Added.
1601         (test):
1602         * tests/es6/spread_..._operator_spreading_non-iterables_is_a_runtime_error.js: Added.
1603         (test):
1604         * tests/es6/spread_..._operator_with_arrays_in_array_literals.js: Added.
1605         (test):
1606         * tests/es6/spread_..._operator_with_arrays_in_function_calls.js: Added.
1607         (test):
1608         * tests/es6/spread_..._operator_with_astral_plane_strings_in_array_literals.js: Added.
1609         (test):
1610         * tests/es6/spread_..._operator_with_astral_plane_strings_in_function_calls.js: Added.
1611         (test):
1612         * tests/es6/spread_..._operator_with_generator_instances_in_arrays.js: Added.
1613         (test.iterable):
1614         (test):
1615         * tests/es6/spread_..._operator_with_generator_instances_in_calls.js: Added.
1616         (test.iterable):
1617         (test):
1618         * tests/es6/spread_..._operator_with_generic_iterables_in_arrays.js: Added.
1619         (test):
1620         * tests/es6/spread_..._operator_with_generic_iterables_in_calls.js: Added.
1621         (test):
1622         * tests/es6/spread_..._operator_with_instances_of_iterables_in_arrays.js: Added.
1623         (test):
1624         * tests/es6/spread_..._operator_with_instances_of_iterables_in_calls.js: Added.
1625         (test):
1626         * tests/es6/spread_..._operator_with_sparse_arrays_in_array_literals.js: Added.
1627         (test):
1628         * tests/es6/spread_..._operator_with_sparse_arrays_in_function_calls.js: Added.
1629         (test):
1630         * tests/es6/spread_..._operator_with_strings_in_array_literals.js: Added.
1631         (test):
1632         * tests/es6/spread_..._operator_with_strings_in_function_calls.js: Added.
1633         (test):
1634         * tests/es6/super_constructor_calls_use_correct_new.target_binding.js: Added.
1635         (test.B):
1636         (test):
1637         * tests/es6/super_expression_in_constructors.js: Added.
1638         (test.B):
1639         (test.C):
1640         (test):
1641         * tests/es6/super_in_methods_method_calls.js: Added.
1642         (test.B.prototype.qux):
1643         (test.B):
1644         (test.C.prototype.qux):
1645         (test.C):
1646         (test):
1647         * tests/es6/super_in_methods_property_access.js: Added.
1648         (test.B):
1649         (test.C.prototype.quux):
1650         (test.C):
1651         (test):
1652         * tests/es6/super_is_statically_bound.js: Added.
1653         (test.B.prototype.qux):
1654         (test.B):
1655         (test.C.prototype.qux):
1656         (test.C):
1657         (test):
1658         * tests/es6/super_method_calls_use_correct_this_binding.js: Added.
1659         (test.B.prototype.qux):
1660         (test.B):
1661         (test.C.prototype.qux):
1662         (test.C):
1663         (test):
1664         * tests/es6/super_statement_in_constructors.js: Added.
1665         (test.B):
1666         (test):
1667         * tests/es6/template_strings_basic_functionality.js: Added.
1668         (test):
1669         * tests/es6/template_strings_line_break_normalisation.js: Added.
1670         (test):
1671         * tests/es6/template_strings_passed_array_is_frozen.js: Added.
1672         (test):
1673         * tests/es6/template_strings_tagged_template_strings.js: Added.
1674         (test.fn):
1675         (test):
1676         * tests/es6/template_strings_toString_conversion.js: Added.
1677         (test.a.toString):
1678         (test.a.valueOf):
1679         (test):
1680         * tests/es6/typed_arrays_%TypedArray%.from.js: Added.
1681         (test):
1682         * tests/es6/typed_arrays_%TypedArray%.of.js: Added.
1683         (test):
1684         * tests/es6/typed_arrays_%TypedArray%.prototype.copyWithin.js: Added.
1685         (test):
1686         * tests/es6/typed_arrays_%TypedArray%.prototype.entries.js: Added.
1687         (test):
1688         * tests/es6/typed_arrays_%TypedArray%.prototype.every.js: Added.
1689         (test):
1690         * tests/es6/typed_arrays_%TypedArray%.prototype.fill.js: Added.
1691         (test):
1692         * tests/es6/typed_arrays_%TypedArray%.prototype.filter.js: Added.
1693         (test):
1694         * tests/es6/typed_arrays_%TypedArray%.prototype.find.js: Added.
1695         (test):
1696         * tests/es6/typed_arrays_%TypedArray%.prototype.findIndex.js: Added.
1697         (test):
1698         * tests/es6/typed_arrays_%TypedArray%.prototype.forEach.js: Added.
1699         (test):
1700         * tests/es6/typed_arrays_%TypedArray%.prototype.indexOf.js: Added.
1701         (test):
1702         * tests/es6/typed_arrays_%TypedArray%.prototype.join.js: Added.
1703         (test):
1704         * tests/es6/typed_arrays_%TypedArray%.prototype.keys.js: Added.
1705         (test):
1706         * tests/es6/typed_arrays_%TypedArray%.prototype.lastIndexOf.js: Added.
1707         (test):
1708         * tests/es6/typed_arrays_%TypedArray%.prototype.map.js: Added.
1709         (test):
1710         * tests/es6/typed_arrays_%TypedArray%.prototype.reduce.js: Added.
1711         (test):
1712         * tests/es6/typed_arrays_%TypedArray%.prototype.reduceRight.js: Added.
1713         (test):
1714         * tests/es6/typed_arrays_%TypedArray%.prototype.reverse.js: Added.
1715         (test):
1716         * tests/es6/typed_arrays_%TypedArray%.prototype.slice.js: Added.
1717         (test):
1718         * tests/es6/typed_arrays_%TypedArray%.prototype.some.js: Added.
1719         (test):
1720         * tests/es6/typed_arrays_%TypedArray%.prototype.sort.js: Added.
1721         (test):
1722         * tests/es6/typed_arrays_%TypedArray%.prototype.subarray.js: Added.
1723         (test):
1724         * tests/es6/typed_arrays_%TypedArray%.prototype.values.js: Added.
1725         (test):
1726         * tests/es6/typed_arrays_%TypedArray%.prototype[Symbol.iterator].js: Added.
1727         (test):
1728         * tests/es6/typed_arrays_%TypedArray%[Symbol.species].js: Added.
1729         (test):
1730         * tests/es6/typed_arrays_ArrayBuffer[Symbol.species].js: Added.
1731         (test):
1732         * tests/es6/typed_arrays_DataView_Float32.js: Added.
1733         (test):
1734         * tests/es6/typed_arrays_DataView_Float64.js: Added.
1735         (test):
1736         * tests/es6/typed_arrays_DataView_Int16.js: Added.
1737         (test):
1738         * tests/es6/typed_arrays_DataView_Int32.js: Added.
1739         (test):
1740         * tests/es6/typed_arrays_DataView_Int8.js: Added.
1741         (test):
1742         * tests/es6/typed_arrays_DataView_Uint16.js: Added.
1743         (test):
1744         * tests/es6/typed_arrays_DataView_Uint32.js: Added.
1745         (test):
1746         * tests/es6/typed_arrays_DataView_Uint8.js: Added.
1747         (test):
1748         * tests/es6/typed_arrays_Float32Array.js: Added.
1749         (test):
1750         * tests/es6/typed_arrays_Float64Array.js: Added.
1751         (test):
1752         * tests/es6/typed_arrays_Int16Array.js: Added.
1753         (test):
1754         * tests/es6/typed_arrays_Int32Array.js: Added.
1755         (test):
1756         * tests/es6/typed_arrays_Int8Array.js: Added.
1757         (test):
1758         * tests/es6/typed_arrays_Uint16Array.js: Added.
1759         (test):
1760         * tests/es6/typed_arrays_Uint32Array.js: Added.
1761         (test):
1762         * tests/es6/typed_arrays_Uint8Array.js: Added.
1763         (test):
1764         * tests/es6/typed_arrays_Uint8ClampedArray.js: Added.
1765         (test):
1766         * tests/es6/typed_arrays_constructors_require_new.js: Added.
1767         (test):
1768         * tests/es6/typed_arrays_correct_prototype_chains.js: Added.
1769         (test):
1770         * tests/es6/well-known_symbols_Symbol.hasInstance.js: Added.
1771         (test.C):
1772         (test.):
1773         (test):
1774         * tests/es6/well-known_symbols_Symbol.isConcatSpreadable.js: Added.
1775         (test):
1776         * tests/es6/well-known_symbols_Symbol.iterator_arguments_object.js: Added.
1777         (test):
1778         * tests/es6/well-known_symbols_Symbol.iterator_existence.js: Added.
1779         (test):
1780         * tests/es6/well-known_symbols_Symbol.match.js: Added.
1781         (test.O.Symbol.match):
1782         (test):
1783         * tests/es6/well-known_symbols_Symbol.replace.js: Added.
1784         (test.O.Symbol.replace):
1785         (test):
1786         * tests/es6/well-known_symbols_Symbol.search.js: Added.
1787         (test.O.Symbol.search):
1788         (test):
1789         * tests/es6/well-known_symbols_Symbol.species_Array.prototype.concat.js: Added.
1790         (test.obj.Symbol.species):
1791         (test):
1792         * tests/es6/well-known_symbols_Symbol.species_Array.prototype.filter.js: Added.
1793         (test.obj.Symbol.species):
1794         (test):
1795         * tests/es6/well-known_symbols_Symbol.species_Array.prototype.map.js: Added.
1796         (test.obj.Symbol.species):
1797         (test):
1798         * tests/es6/well-known_symbols_Symbol.species_Array.prototype.slice.js: Added.
1799         (test.obj.Symbol.species):
1800         (test):
1801         * tests/es6/well-known_symbols_Symbol.species_Array.prototype.splice.js: Added.
1802         (test.obj.Symbol.species):
1803         (test):
1804         * tests/es6/well-known_symbols_Symbol.species_RegExp.prototype[Symbol.split].js: Added.
1805         (test.obj.Symbol.species):
1806         (test):
1807         * tests/es6/well-known_symbols_Symbol.species_existence.js: Added.
1808         (test):
1809         * tests/es6/well-known_symbols_Symbol.split.js: Added.
1810         (test.O.Symbol.split):
1811         (test):
1812         * tests/es6/well-known_symbols_Symbol.toPrimitive.js: Added.
1813         (test.a.Symbol.toPrimitive):
1814         (test.b.Symbol.toPrimitive):
1815         (test.c.Symbol.toPrimitive):
1816         (test):
1817         * tests/es6/well-known_symbols_Symbol.toStringTag.js: Added.
1818         (test):
1819         * tests/es6/well-known_symbols_Symbol.toStringTag_misc._built-ins.js: Added.
1820         (test):
1821         * tests/es6/well-known_symbols_Symbol.unscopables.js: Added.
1822         (test):
1823
1824 2015-09-03  Filip Pizlo  <fpizlo@apple.com>
1825
1826         WatchpointsOnStructureStubInfo doesn't need to be reference counted
1827         https://bugs.webkit.org/show_bug.cgi?id=148766
1828
1829         Reviewed by Saam Barati.
1830
1831         It doesn't need to be reference counted because the only RefPtr to it is in
1832         StructureStubInfo. Therefore, it can be a unique_ptr.
1833
1834         * bytecode/StructureStubClearingWatchpoint.cpp:
1835         (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
1836         (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
1837         * bytecode/StructureStubClearingWatchpoint.h:
1838         (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
1839         (JSC::WatchpointsOnStructureStubInfo::codeBlock):
1840         * bytecode/StructureStubInfo.h:
1841         (JSC::getStructureStubInfoCodeOrigin):
1842
1843 2015-09-03  Basile Clement  <basile_clement@apple.com>
1844
1845         JavaScript functions should restore the stack pointer after a call
1846         https://bugs.webkit.org/show_bug.cgi?id=148659
1847
1848         Reviewed by Michael Saboff.
1849
1850         This patch makes it so that the various places where we are making a
1851         JS-to-JS call restore the stack pointer afterwards. This allows us to
1852         no longer rely on the stack pointer still being valid after a call, and
1853         is a prerequisite for getting rid of the arity fixup return thunk.
1854
1855         * dfg/DFGSpeculativeJIT32_64.cpp:
1856         (JSC::DFG::SpeculativeJIT::emitCall):
1857         * dfg/DFGSpeculativeJIT64.cpp:
1858         (JSC::DFG::SpeculativeJIT::emitCall):
1859         * ftl/FTLCompile.cpp:
1860         (JSC::FTL::mmAllocateDataSection):
1861         * ftl/FTLInlineCacheSize.cpp:
1862         (JSC::FTL::sizeOfCall):
1863         * ftl/FTLJSCall.cpp:
1864         (JSC::FTL::JSCall::emit):
1865         * ftl/FTLJSCall.h:
1866         * ftl/FTLStackMaps.h:
1867         (JSC::FTL::StackMaps::stackSizeForLocals):
1868         * jit/Repatch.cpp:
1869         (JSC::generateByIdStub):
1870         * tests/stress/tail-call-in-inline-cache.js: Added.
1871         (tail):
1872         (obj.get x):
1873
1874 2015-09-03  Filip Pizlo  <fpizlo@apple.com>
1875
1876         StructureStubInfo should be able to reset itself without going through CodeBlock
1877         https://bugs.webkit.org/show_bug.cgi?id=148743
1878
1879         Reviewed by Geoffrey Garen.
1880
1881         We had some resetStub...() methods in CodeBlock that didn't really do anything that
1882         StructureStubInfo couldn't do by itself. It makes sense for the functionality to reset a
1883         stub to be in the stub class, not in CodeBlock.
1884
1885         It's still true that:
1886
1887         - In order to mess with a StructureStubInfo, you either have to be in GC or you have to
1888           be holding the owning CodeBlock's lock.
1889
1890         - StructureStubInfo doesn't remember which CodeBlock owns it (to save space), and all
1891           of the callers of StructureStubInfo methods know which CodeBlock own it. So, many stub
1892           methods take CodeBlock* as an argument.
1893
1894         * bytecode/CodeBlock.cpp:
1895         (JSC::CodeBlock::finalizeUnconditionally):
1896         (JSC::CodeBlock::addCallLinkInfo):
1897         (JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):
1898         (JSC::CodeBlock::resetStub): Deleted.
1899         (JSC::CodeBlock::resetStubInternal): Deleted.
1900         (JSC::CodeBlock::resetStubDuringGCInternal): Deleted.
1901         * bytecode/CodeBlock.h:
1902         * bytecode/StructureStubClearingWatchpoint.cpp:
1903         (JSC::StructureStubClearingWatchpoint::fireInternal):
1904         * bytecode/StructureStubInfo.cpp:
1905         (JSC::StructureStubInfo::deref):
1906         (JSC::StructureStubInfo::reset):
1907         (JSC::StructureStubInfo::visitWeakReferences):
1908         * bytecode/StructureStubInfo.h:
1909         (JSC::StructureStubInfo::initInList):
1910         (JSC::StructureStubInfo::seenOnce):
1911         (JSC::StructureStubInfo::reset): Deleted.
1912
1913 2015-09-03  Sukolsak Sakshuwong  <sukolsak@gmail.com>
1914
1915         Implement some arithmetic instructions in WebAssembly
1916         https://bugs.webkit.org/show_bug.cgi?id=148737
1917
1918         Reviewed by Geoffrey Garen.
1919
1920         This patch implements the addition and subtraction instructions in
1921         WebAssembly using a stack-based approach: each instruction reads its
1922         operands from the top of the 'temporary' stack, pops them, and
1923         optionally pushes a return value to the stack. Since operands are passed
1924         on the stack, we don't use the arguments that are passed to the methods
1925         of WASMFunctionCompiler, and we don't use the return values from these
1926         methods. (We will use them when we implement LLVM IR generation for
1927         WebAssembly, where each expression is an LLVMValueRef.)
1928
1929         * tests/stress/wasm-arithmetic.js: Added.
1930         * tests/stress/wasm-arithmetic.wasm: Added.
1931         * wasm/WASMFunctionCompiler.h:
1932         (JSC::WASMFunctionCompiler::endFunction):
1933         (JSC::WASMFunctionCompiler::buildReturn):
1934         (JSC::WASMFunctionCompiler::buildImmediateI32):
1935         (JSC::WASMFunctionCompiler::buildBinaryI32):
1936         (JSC::WASMFunctionCompiler::temporaryAddress):
1937         * wasm/WASMFunctionParser.cpp:
1938         (JSC::WASMFunctionParser::parseReturnStatement):
1939         (JSC::WASMFunctionParser::parseExpressionI32):
1940         (JSC::WASMFunctionParser::parseImmediateExpressionI32):
1941         (JSC::WASMFunctionParser::parseBinaryExpressionI32):
1942         * wasm/WASMFunctionParser.h:
1943         * wasm/WASMFunctionSyntaxChecker.h:
1944         (JSC::WASMFunctionSyntaxChecker::startFunction):
1945         (JSC::WASMFunctionSyntaxChecker::endFunction):
1946         (JSC::WASMFunctionSyntaxChecker::buildReturn):
1947         (JSC::WASMFunctionSyntaxChecker::buildImmediateI32):
1948         (JSC::WASMFunctionSyntaxChecker::buildBinaryI32):
1949         (JSC::WASMFunctionSyntaxChecker::stackHeight):
1950         (JSC::WASMFunctionSyntaxChecker::updateTempStackHeight):
1951
1952 2015-09-03  Brian Burg  <bburg@apple.com>
1953
1954         Web Inspector: should crash on purpose if InjectedScriptSource.js is unparseable
1955         https://bugs.webkit.org/show_bug.cgi?id=148750
1956
1957         Reviewed by Timothy Hatcher.
1958
1959         If an injected script cannot be parsed or executed without exception, we should abort as
1960         soon as possible. This patch adds a release assertion after creating the injected
1961         script and dumps the bad injected script's source as it was embedded into the binary.
1962
1963         * inspector/InjectedScriptManager.cpp:
1964         (Inspector::InjectedScriptManager::injectedScriptFor):
1965
1966 2015-09-03  Basile Clement  <basile_clement@apple.com> and Michael Saboff  <msaboff@apple.com>
1967
1968         Clean up register naming
1969         https://bugs.webkit.org/show_bug.cgi?id=148658
1970
1971         Reviewed by Geoffrey Garen.
1972
1973         This changes register naming conventions in the llint and baseline JIT
1974         in order to use as few (native) callee-save registers as possible on
1975         64-bits platforms. It also introduces significant changes in the way
1976         registers names are defined in the LLint and baseline JIT in order to
1977         enable a simpler convention about which registers can be aliased. That
1978         convention is valid across all architecture, and described in
1979         llint/LowLevelInterpreter.asm.
1980
1981         Callee save registers are now called out regCS<n> (in the JIT) or
1982         csr<n> (in the LLInt) with a common numbering across all tiers. Some
1983         registers are unused in some tiers.
1984
1985         As a part of this change, rdi was removed from the list of temporary
1986         registers for X86-64 Windows as it is a callee saves register. This
1987         reduced the number of temporary registers for X86-64 Windows.
1988
1989         This is in preparation for properly handling callee save register
1990         preservation and restoration.
1991
1992         * dfg/DFGJITCompiler.cpp:
1993         (JSC::DFG::JITCompiler::compileFunction):
1994         * ftl/FTLLink.cpp:
1995         (JSC::FTL::link):
1996         * jit/FPRInfo.h:
1997         (JSC::FPRInfo::toRegister):
1998         (JSC::FPRInfo::toIndex):
1999         * jit/GPRInfo.h:
2000         (JSC::GPRInfo::toIndex):
2001         (JSC::GPRInfo::toRegister):
2002         (JSC::GPRInfo::debugName): Deleted.
2003         * jit/JIT.cpp:
2004         (JSC::JIT::privateCompile):
2005         * jit/JITArithmetic.cpp:
2006         (JSC::JIT::emit_op_mod):
2007         * jit/JITOpcodes.cpp:
2008         (JSC::JIT::emitSlow_op_loop_hint):
2009         * jit/JITOpcodes32_64.cpp:
2010         (JSC::JIT::emit_op_end):
2011         (JSC::JIT::emit_op_new_object):
2012         * jit/RegisterPreservationWrapperGenerator.cpp:
2013         (JSC::generateRegisterPreservationWrapper):
2014         (JSC::generateRegisterRestoration):
2015         * jit/ThunkGenerators.cpp:
2016         (JSC::arityFixupGenerator):
2017         (JSC::nativeForGenerator): Deleted.
2018         * llint/LowLevelInterpreter.asm:
2019         * llint/LowLevelInterpreter32_64.asm:
2020         * llint/LowLevelInterpreter64.asm:
2021         * offlineasm/arm.rb:
2022         * offlineasm/arm64.rb:
2023         * offlineasm/cloop.rb:
2024         * offlineasm/mips.rb:
2025         * offlineasm/registers.rb:
2026         * offlineasm/sh4.rb:
2027         * offlineasm/x86.rb:
2028
2029 2015-09-03  Filip Pizlo  <fpizlo@apple.com>
2030
2031         Get rid of RepatchBuffer and replace it with static functions
2032         https://bugs.webkit.org/show_bug.cgi?id=148742
2033
2034         Reviewed by Geoffrey Garen and Mark Lam.
2035
2036         RepatchBuffer is an object that doesn't have any state. All of its instance methods are
2037         just wrappers for methods on MacroAssembler. So, we should make those MacroAssembler
2038         methods public and call them directly.
2039
2040         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2041         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2042         * JavaScriptCore.xcodeproj/project.pbxproj:
2043         * assembler/AbstractMacroAssembler.h:
2044         (JSC::AbstractMacroAssembler::linkJump):
2045         (JSC::AbstractMacroAssembler::linkPointer):
2046         (JSC::AbstractMacroAssembler::getLinkerAddress):
2047         (JSC::AbstractMacroAssembler::getLinkerCallReturnOffset):
2048         (JSC::AbstractMacroAssembler::repatchJump):
2049         (JSC::AbstractMacroAssembler::repatchNearCall):
2050         (JSC::AbstractMacroAssembler::repatchCompact):
2051         (JSC::AbstractMacroAssembler::repatchInt32):
2052         (JSC::AbstractMacroAssembler::repatchPointer):
2053         (JSC::AbstractMacroAssembler::readPointer):
2054         (JSC::AbstractMacroAssembler::replaceWithLoad):
2055         (JSC::AbstractMacroAssembler::replaceWithAddressComputation):
2056         (JSC::AbstractMacroAssembler::AbstractMacroAssembler):
2057         * assembler/MacroAssemblerARM64.h:
2058         (JSC::MacroAssemblerARM64::revertJumpReplacementToPatchableBranch32WithPatch):
2059         (JSC::MacroAssemblerARM64::repatchCall):
2060         (JSC::MacroAssemblerARM64::makeBranch):
2061         (JSC::MacroAssemblerARM64::linkCall):
2062         * assembler/MacroAssemblerARMv7.h:
2063         (JSC::MacroAssemblerARMv7::revertJumpReplacementToPatchableBranch32WithPatch):
2064         (JSC::MacroAssemblerARMv7::repatchCall):
2065         (JSC::MacroAssemblerARMv7::linkCall):
2066         (JSC::MacroAssemblerARMv7::trustedImm32FromPtr):
2067         * assembler/MacroAssemblerX86.h:
2068         (JSC::MacroAssemblerX86::revertJumpReplacementToPatchableBranch32WithPatch):
2069         (JSC::MacroAssemblerX86::repatchCall):
2070         (JSC::MacroAssemblerX86::linkCall):
2071         * assembler/MacroAssemblerX86_64.h:
2072         (JSC::MacroAssemblerX86_64::revertJumpReplacementToBranchPtrWithPatch):
2073         (JSC::MacroAssemblerX86_64::repatchCall):
2074         (JSC::MacroAssemblerX86_64::linkCall):
2075         * assembler/RepatchBuffer.h: Removed.
2076         * bytecode/CallLinkInfo.cpp:
2077         (JSC::CallLinkInfo::clearStub):
2078         (JSC::CallLinkInfo::unlink):
2079         (JSC::CallLinkInfo::visitWeak):
2080         * bytecode/CallLinkInfo.h:
2081         (JSC::CallLinkInfo::registerPreservationMode):
2082         (JSC::CallLinkInfo::isLinked):
2083         (JSC::CallLinkInfo::setUpCall):
2084         (JSC::CallLinkInfo::codeOrigin):
2085         * bytecode/CodeBlock.cpp:
2086         (JSC::CodeBlock::finalizeUnconditionally):
2087         (JSC::CodeBlock::resetStub):
2088         (JSC::CodeBlock::resetStubInternal):
2089         (JSC::CodeBlock::resetStubDuringGCInternal):
2090         (JSC::CodeBlock::unlinkIncomingCalls):
2091         * bytecode/CodeBlock.h:
2092         * bytecode/PolymorphicGetByIdList.cpp:
2093         (JSC::GetByIdAccess::fromStructureStubInfo):
2094         (JSC::GetByIdAccess::visitWeak):
2095         (JSC::PolymorphicGetByIdList::didSelfPatching):
2096         (JSC::PolymorphicGetByIdList::visitWeak):
2097         * bytecode/PolymorphicGetByIdList.h:
2098         (JSC::GetByIdAccess::doesCalls):
2099         * bytecode/PolymorphicPutByIdList.cpp:
2100         (JSC::PutByIdAccess::fromStructureStubInfo):
2101         (JSC::PutByIdAccess::visitWeak):
2102         (JSC::PolymorphicPutByIdList::addAccess):
2103         (JSC::PolymorphicPutByIdList::visitWeak):
2104         * bytecode/PolymorphicPutByIdList.h:
2105         (JSC::PutByIdAccess::customSetter):
2106         (JSC::PolymorphicPutByIdList::kind):
2107         * bytecode/StructureStubInfo.cpp:
2108         (JSC::StructureStubInfo::deref):
2109         (JSC::StructureStubInfo::visitWeakReferences):
2110         * bytecode/StructureStubInfo.h:
2111         (JSC::StructureStubInfo::seenOnce):
2112         * dfg/DFGOSRExitCompiler.cpp:
2113         * ftl/FTLCompile.cpp:
2114         (JSC::FTL::mmAllocateDataSection):
2115         * ftl/FTLOSRExitCompiler.cpp:
2116         (JSC::FTL::compileFTLOSRExit):
2117         * jit/AccessorCallJITStubRoutine.cpp:
2118         (JSC::AccessorCallJITStubRoutine::~AccessorCallJITStubRoutine):
2119         (JSC::AccessorCallJITStubRoutine::visitWeak):
2120         * jit/AccessorCallJITStubRoutine.h:
2121         * jit/JIT.cpp:
2122         (JSC::ctiPatchCallByReturnAddress):
2123         (JSC::JIT::JIT):
2124         (JSC::ctiPatchNearCallByReturnAddress): Deleted.
2125         * jit/JIT.h:
2126         * jit/JITCall.cpp:
2127         * jit/JITOpcodes.cpp:
2128         (JSC::JIT::privateCompileHasIndexedProperty):
2129         (JSC::JIT::emit_op_has_indexed_property):
2130         * jit/JITOperations.cpp:
2131         (JSC::getByVal):
2132         * jit/JITPropertyAccess.cpp:
2133         (JSC::JIT::privateCompileGetByVal):
2134         (JSC::JIT::privateCompileGetByValWithCachedId):
2135         (JSC::JIT::privateCompilePutByVal):
2136         (JSC::JIT::privateCompilePutByValWithCachedId):
2137         * jit/JITPropertyAccess32_64.cpp:
2138         * jit/JITStubRoutine.cpp:
2139         (JSC::JITStubRoutine::~JITStubRoutine):
2140         (JSC::JITStubRoutine::visitWeak):
2141         * jit/JITStubRoutine.h:
2142         * jit/PolymorphicCallStubRoutine.cpp:
2143         (JSC::PolymorphicCallNode::~PolymorphicCallNode):
2144         (JSC::PolymorphicCallNode::unlink):
2145         (JSC::PolymorphicCallStubRoutine::clearCallNodesFor):
2146         (JSC::PolymorphicCallStubRoutine::visitWeak):
2147         * jit/PolymorphicCallStubRoutine.h:
2148         (JSC::PolymorphicCallNode::hasCallLinkInfo):
2149         * jit/Repatch.cpp:
2150         (JSC::readCallTarget):
2151         (JSC::repatchCall):
2152         (JSC::repatchByIdSelfAccess):
2153         (JSC::checkObjectPropertyConditions):
2154         (JSC::replaceWithJump):
2155         (JSC::tryCacheGetByID):
2156         (JSC::repatchGetByID):
2157         (JSC::patchJumpToGetByIdStub):
2158         (JSC::tryBuildGetByIDList):
2159         (JSC::tryCachePutByID):
2160         (JSC::tryBuildPutByIdList):
2161         (JSC::tryRepatchIn):
2162         (JSC::repatchIn):
2163         (JSC::linkSlowFor):
2164         (JSC::linkFor):
2165         (JSC::revertCall):
2166         (JSC::unlinkFor):
2167         (JSC::linkVirtualFor):
2168         (JSC::linkPolymorphicCall):
2169         (JSC::resetGetByID):
2170         (JSC::resetPutByID):
2171         (JSC::resetIn):
2172         * jit/Repatch.h:
2173
2174 2015-09-03  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2175
2176         Initial implementation of WebAssembly function compiler
2177         https://bugs.webkit.org/show_bug.cgi?id=148734
2178
2179         Reviewed by Filip Pizlo.
2180
2181         This patch introduces WASMFunctionCompiler, a class for generating
2182         baseline JIT code for WebAssembly functions. The source for each
2183         WebAssembly function is parsed in two passes.
2184         - The first pass is done by WASMFunctionSyntaxChecker when the
2185           WebAssembly module is initialized. It validates the syntax,
2186           determines the start and the end offsets in the source, and
2187           calculates the stack height of the function.
2188         - The second pass is done by WASMFunctionCompiler when the function
2189           is about to be executed.
2190         This patch doesn't calculate the correct stack height nor generate
2191         the correct code. That will be done in a subsequent patch.
2192
2193         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2194         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2195         * JavaScriptCore.xcodeproj/project.pbxproj:
2196         * wasm/JSWASMModule.h:
2197         (JSC::JSWASMModule::functionStartOffsetsInSource):
2198         (JSC::JSWASMModule::functionStackHeights):
2199         * wasm/WASMFunctionCompiler.h: Added.
2200         (JSC::WASMFunctionCompiler::WASMFunctionCompiler):
2201         (JSC::WASMFunctionCompiler::startFunction):
2202         (JSC::WASMFunctionCompiler::endFunction):
2203         (JSC::WASMFunctionCompiler::throwStackOverflowError):
2204         (JSC::WASMFunctionCompiler::localAddress):
2205         * wasm/WASMFunctionParser.cpp:
2206         (JSC::WASMFunctionParser::checkSyntax):
2207         (JSC::WASMFunctionParser::compile):
2208         (JSC::WASMFunctionParser::parseFunction):
2209         * wasm/WASMFunctionParser.h:
2210         * wasm/WASMFunctionSyntaxChecker.h:
2211         (JSC::WASMFunctionSyntaxChecker::startFunction):
2212         (JSC::WASMFunctionSyntaxChecker::endFunction):
2213         (JSC::WASMFunctionSyntaxChecker::stackHeight):
2214         * wasm/WASMModuleParser.cpp:
2215         (JSC::WASMModuleParser::parseFunctionDeclarationSection):
2216         (JSC::WASMModuleParser::parseFunctionDefinition):
2217
2218 2015-09-03  Saam barati  <sbarati@apple.com>
2219
2220         Block scoped variables should be visible across scripts
2221         https://bugs.webkit.org/show_bug.cgi?id=147813
2222
2223         Reviewed by Filip Pizlo.
2224
2225         This patch properly implements the global lexical tier described in
2226         http://www.ecma-international.org/ecma-262/6.0/index.html#sec-globaldeclarationinstantiation.
2227         The sepcification mandates that there is a global lexical environment
2228         that wrtaps all program execution. This global lexical environment
2229         holds let/const/class variables defined at the top-level scope
2230         inside a program. These variables can never shadow other program-level
2231         "var"s, global object properties, or other global lexical environment
2232         declarations. Doing so is a SyntaxError.
2233
2234         This patch adds new ResolveTypes that describe the global lexical environment:
2235         GlobalLexicalVar and GlobalLexiclaVarWithInjectionChecks. Resolving to
2236         these means we're doing a load/store from the JSGlobalLexicalEnvironment.
2237         This patch also addes new ResolveTypes: UnresolvedProperty and
2238         UnresolvedPropertyWithVarInjectionChecks. Before, we used GlobalProperty
2239         to encompass this category because if JSScope::abstractAccess didn't
2240         resolve to anything, we could safely assume that this property is
2241         on the global object. Such an assumption is no longer true in ES6.
2242         When we have a resolve_scope/put_to_scope/get_from_scope with this
2243         ResolveType, we try to transition it to either a GlobalProperty
2244         ResolveType or a GlobalLexicalVar resolve type.
2245
2246         JSGlobalLexicalEnvironment is a subclass of JSSegmentedVariableObject.
2247         This means get_from_scopes are direct pointer reads and
2248         put_to_scopes are direct pointer stores.
2249
2250         * CMakeLists.txt:
2251         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
2252         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
2253         * JavaScriptCore.xcodeproj/project.pbxproj:
2254         * bytecode/CodeBlock.cpp:
2255         (JSC::CodeBlock::dumpBytecode):
2256         (JSC::CodeBlock::CodeBlock):
2257         (JSC::CodeBlock::finalizeUnconditionally):
2258         * bytecode/EvalCodeCache.h:
2259         (JSC::EvalCodeCache::clear):
2260         (JSC::EvalCodeCache::isCacheableScope):
2261         (JSC::EvalCodeCache::isCacheable):
2262         * bytecode/SpeculatedType.h:
2263         * bytecode/UnlinkedCodeBlock.h:
2264         * bytecompiler/BytecodeGenerator.cpp:
2265         (JSC::BytecodeGenerator::generate):
2266         (JSC::BytecodeGenerator::BytecodeGenerator):
2267         (JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
2268         (JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
2269         (JSC::BytecodeGenerator::emitGetFromScope):
2270         (JSC::BytecodeGenerator::emitPutToScope):
2271         (JSC::BytecodeGenerator::initializeVariable):
2272         (JSC::BytecodeGenerator::emitInstanceOf):
2273         (JSC::BytecodeGenerator::emitPushFunctionNameScope):
2274         (JSC::BytecodeGenerator::pushScopedControlFlowContext):
2275         (JSC::BytecodeGenerator::emitPushCatchScope):
2276         (JSC::BytecodeGenerator::emitPopCatchScope):
2277         * bytecompiler/BytecodeGenerator.h:
2278         * bytecompiler/NodesCodegen.cpp:
2279         (JSC::PostfixNode::emitResolve):
2280         (JSC::PrefixNode::emitResolve):
2281         (JSC::ReadModifyResolveNode::emitBytecode):
2282         (JSC::AssignResolveNode::emitBytecode):
2283         (JSC::EmptyLetExpression::emitBytecode):
2284         (JSC::ForInNode::emitLoopHeader):
2285         (JSC::ForOfNode::emitBytecode):
2286         (JSC::BindingNode::bindValue):
2287         * debugger/DebuggerScope.cpp:
2288         (JSC::DebuggerScope::isGlobalScope):
2289         (JSC::DebuggerScope::isGlobalLexicalEnvironment):
2290         (JSC::DebuggerScope::isClosureScope):
2291         (JSC::DebuggerScope::caughtValue):
2292         (JSC::DebuggerScope::isFunctionOrEvalScope): Deleted.
2293         * debugger/DebuggerScope.h:
2294         * dfg/DFGAbstractInterpreterInlines.h:
2295         (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
2296         * dfg/DFGByteCodeParser.cpp:
2297         (JSC::DFG::ByteCodeParser::parseBlock):
2298         * dfg/DFGCapabilities.cpp:
2299         (JSC::DFG::capabilityLevel):
2300         * dfg/DFGClobberize.h:
2301         (JSC::DFG::clobberize):
2302         * dfg/DFGDoesGC.cpp:
2303         (JSC::DFG::doesGC):
2304         * dfg/DFGFixupPhase.cpp:
2305         (JSC::DFG::FixupPhase::fixupNode):
2306         * dfg/DFGGraph.cpp:
2307         (JSC::DFG::Graph::dump):
2308         * dfg/DFGNode.h:
2309         (JSC::DFG::Node::hasRegisterPointer):
2310         (JSC::DFG::Node::variablePointer):
2311         (JSC::DFG::Node::hasHeapPrediction):
2312         * dfg/DFGNodeType.h:
2313         * dfg/DFGPredictionPropagationPhase.cpp:
2314         (JSC::DFG::PredictionPropagationPhase::propagate):
2315         * dfg/DFGSafeToExecute.h:
2316         (JSC::DFG::safeToExecute):
2317         * dfg/DFGSpeculativeJIT32_64.cpp:
2318         (JSC::DFG::SpeculativeJIT::compile):
2319         * dfg/DFGSpeculativeJIT64.cpp:
2320         (JSC::DFG::SpeculativeJIT::compile):
2321         * dfg/DFGStoreBarrierInsertionPhase.cpp:
2322         * ftl/FTLCapabilities.cpp:
2323         (JSC::FTL::canCompile):
2324         * ftl/FTLLowerDFGToLLVM.cpp:
2325         (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
2326         (JSC::FTL::DFG::LowerDFGToLLVM::compileMultiPutByOffset):
2327         (JSC::FTL::DFG::LowerDFGToLLVM::compileGetGlobalVariable):
2328         (JSC::FTL::DFG::LowerDFGToLLVM::compilePutGlobalVariable):
2329         (JSC::FTL::DFG::LowerDFGToLLVM::compileGetGlobalVar): Deleted.
2330         (JSC::FTL::DFG::LowerDFGToLLVM::compilePutGlobalVar): Deleted.
2331         * inspector/JSJavaScriptCallFrame.cpp:
2332         (Inspector::JSJavaScriptCallFrame::scopeType):
2333         * interpreter/Interpreter.cpp:
2334         (JSC::Interpreter::execute):
2335         * jit/JIT.h:
2336         * jit/JITOperations.cpp:
2337         * jit/JITOperations.h:
2338         * jit/JITPropertyAccess.cpp:
2339         (JSC::JIT::emit_op_resolve_scope):
2340         (JSC::JIT::emitSlow_op_resolve_scope):
2341         (JSC::JIT::emitLoadWithStructureCheck):
2342         (JSC::JIT::emitGetGlobalProperty):
2343         (JSC::JIT::emitGetVarFromPointer):
2344         (JSC::JIT::emitGetClosureVar):
2345         (JSC::JIT::emit_op_get_from_scope):
2346         (JSC::JIT::emitSlow_op_get_from_scope):
2347         (JSC::JIT::emitPutGlobalProperty):
2348         (JSC::JIT::emitPutGlobalVariable):
2349         (JSC::JIT::emit_op_put_to_scope):
2350         (JSC::JIT::emitSlow_op_put_to_scope):
2351         (JSC::JIT::emitGetGlobalVar): Deleted.
2352         (JSC::JIT::emitPutGlobalVar): Deleted.
2353         * jit/JITPropertyAccess32_64.cpp:
2354         (JSC::JIT::emit_op_resolve_scope):
2355         (JSC::JIT::emitSlow_op_resolve_scope):
2356         (JSC::JIT::emitLoadWithStructureCheck):
2357         (JSC::JIT::emitGetGlobalProperty):
2358         (JSC::JIT::emitGetVarFromPointer):
2359         (JSC::JIT::emitGetClosureVar):
2360         (JSC::JIT::emit_op_get_from_scope):
2361         (JSC::JIT::emitSlow_op_get_from_scope):
2362         (JSC::JIT::emitPutGlobalProperty):
2363         (JSC::JIT::emitPutGlobalVariable):
2364         (JSC::JIT::emit_op_put_to_scope):
2365         (JSC::JIT::emitSlow_op_put_to_scope):
2366         (JSC::JIT::emitGetGlobalVar): Deleted.
2367         (JSC::JIT::emitPutGlobalVar): Deleted.
2368         * llint/LLIntData.cpp:
2369         (JSC::LLInt::Data::performAssertions):
2370         * llint/LLIntSlowPaths.cpp:
2371         (JSC::LLInt::LLINT_SLOW_PATH_DECL):
2372         * llint/LLIntSlowPaths.h:
2373         * llint/LowLevelInterpreter.asm:
2374         * llint/LowLevelInterpreter32_64.asm:
2375         * llint/LowLevelInterpreter64.asm:
2376         * runtime/CommonSlowPaths.cpp:
2377         (JSC::SLOW_PATH_DECL):
2378         * runtime/CommonSlowPaths.h:
2379         (JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
2380         (JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):
2381         * runtime/Executable.cpp:
2382         (JSC::ProgramExecutable::initializeGlobalProperties):
2383         * runtime/GetPutInfo.h: Added.
2384         (JSC::resolveModeName):
2385         (JSC::resolveTypeName):
2386         (JSC::initializationModeName):
2387         (JSC::makeType):
2388         (JSC::needsVarInjectionChecks):
2389         (JSC::ResolveOp::ResolveOp):
2390         (JSC::GetPutInfo::GetPutInfo):
2391         (JSC::GetPutInfo::resolveType):
2392         (JSC::GetPutInfo::initializationMode):
2393         (JSC::GetPutInfo::resolveMode):
2394         (JSC::GetPutInfo::operand):
2395         * runtime/JSGlobalLexicalEnvironment.cpp: Added.
2396         (JSC::JSGlobalLexicalEnvironment::getOwnPropertySlot):
2397         (JSC::JSGlobalLexicalEnvironment::put):
2398         * runtime/JSGlobalLexicalEnvironment.h: Added.
2399         (JSC::JSGlobalLexicalEnvironment::create):
2400         (JSC::JSGlobalLexicalEnvironment::isEmpty):
2401         (JSC::JSGlobalLexicalEnvironment::createStructure):
2402         (JSC::JSGlobalLexicalEnvironment::JSGlobalLexicalEnvironment):
2403         * runtime/JSGlobalObject.cpp:
2404         (JSC::JSGlobalObject::init):
2405         (JSC::JSGlobalObject::put):
2406         (JSC::JSGlobalObject::addGlobalVar):
2407         (JSC::JSGlobalObject::visitChildren):
2408         (JSC::JSGlobalObject::addStaticGlobals):
2409         * runtime/JSGlobalObject.h:
2410         (JSC::JSGlobalObject::addVar):
2411         (JSC::JSGlobalObject::globalScope):
2412         (JSC::JSGlobalObject::globalLexicalEnvironment):
2413         (JSC::JSGlobalObject::hasOwnPropertyForWrite):
2414         (JSC::constructEmptyArray):
2415         (JSC::JSGlobalObject::symbolTableHasProperty): Deleted.
2416         * runtime/JSGlobalObjectFunctions.cpp:
2417         (JSC::globalFuncEval):
2418         (JSC::globalFuncParseInt):
2419         * runtime/JSLexicalEnvironment.h:
2420         (JSC::JSLexicalEnvironment::createStructure):
2421         * runtime/JSObject.h:
2422         (JSC::JSObject::isGlobalObject):
2423         (JSC::JSObject::isErrorInstance):
2424         (JSC::JSObject::isVariableObject): Deleted.
2425         (JSC::JSObject::isStaticScopeObject): Deleted.
2426         (JSC::JSObject::isNameScopeObject): Deleted.
2427         (JSC::JSObject::isActivationObject): Deleted.
2428         * runtime/JSScope.cpp:
2429         (JSC::JSScope::visitChildren):
2430         (JSC::abstractAccess):
2431         (JSC::JSScope::resolve):
2432         (JSC::JSScope::abstractResolve):
2433         (JSC::JSScope::collectVariablesUnderTDZ):
2434         (JSC::isScopeType):
2435         (JSC::JSScope::isVarScope):
2436         (JSC::JSScope::isLexicalScope):
2437         (JSC::JSScope::isCatchScope):
2438         (JSC::JSScope::isFunctionNameScopeObject):
2439         (JSC::JSScope::isGlobalLexicalEnvironment):
2440         (JSC::JSScope::constantScopeForCodeBlock):
2441         (JSC::resolveModeName): Deleted.
2442         (JSC::resolveTypeName): Deleted.
2443         * runtime/JSScope.h:
2444         (JSC::makeType): Deleted.
2445         (JSC::needsVarInjectionChecks): Deleted.
2446         (JSC::ResolveOp::ResolveOp): Deleted.
2447         (JSC::ResolveModeAndType::ResolveModeAndType): Deleted.
2448         (JSC::ResolveModeAndType::mode): Deleted.
2449         (JSC::ResolveModeAndType::type): Deleted.
2450         (JSC::ResolveModeAndType::operand): Deleted.
2451         * runtime/JSSegmentedVariableObject.cpp:
2452         (JSC::JSSegmentedVariableObject::findVariableIndex):
2453         (JSC::JSSegmentedVariableObject::addVariables):
2454         * runtime/JSSegmentedVariableObject.h:
2455         * runtime/JSSymbolTableObject.h:
2456         (JSC::symbolTablePut):
2457         * runtime/JSType.h:
2458         * runtime/PutPropertySlot.h:
2459         (JSC::PutPropertySlot::PutPropertySlot):
2460         (JSC::PutPropertySlot::isCacheablePut):
2461         (JSC::PutPropertySlot::isCacheableSetter):
2462         (JSC::PutPropertySlot::isCacheableCustom):
2463         (JSC::PutPropertySlot::isInitialization):
2464         (JSC::PutPropertySlot::cachedOffset):
2465         * runtime/SymbolTable.h:
2466         * tests/stress/global-lexical-let-no-rhs.js: Added.
2467         (assert):
2468         (foo):
2469         * tests/stress/global-lexical-redeclare-variable.js: Added.
2470         (globalFunction):
2471         (globalClass):
2472         (assert):
2473         (assertExpectations):
2474         (assertProperError):
2475         * tests/stress/global-lexical-redefine-const.js: Added.
2476         * tests/stress/global-lexical-var-injection.js: Added.
2477         (assert):
2478         (baz):
2479         * tests/stress/global-lexical-variable-tdz.js: Added.
2480         * tests/stress/global-lexical-variable-unresolved-property.js: Added.
2481         * tests/stress/global-lexical-variable-with-statement.js: Added.
2482         (assert):
2483         (shouldThrowInvalidConstAssignment):
2484         (makeObj):
2485         * tests/stress/multiple-files-tests: Added.
2486         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable: Added.
2487         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/fifth.js: Added.
2488         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/first.js: Added.
2489         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/fourth.js: Added.
2490         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/second.js: Added.
2491         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/sixth.js: Added.
2492         * tests/stress/multiple-files-tests/global-lexical-redeclare-variable/third.js: Added.
2493         * tests/stress/multiple-files-tests/global-lexical-redefine-const: Added.
2494         * tests/stress/multiple-files-tests/global-lexical-redefine-const/first.js: Added.
2495         (assert):
2496         (shouldThrowInvalidConstAssignment):
2497         * tests/stress/multiple-files-tests/global-lexical-redefine-const/second.js: Added.
2498         (foo):
2499         (bar):
2500         (baz):
2501         * tests/stress/multiple-files-tests/global-lexical-variable-tdz: Added.
2502         * tests/stress/multiple-files-tests/global-lexical-variable-tdz/first.js: Added.
2503         (assert):
2504         (shouldThrowTDZ):
2505         (foo):
2506         (bar):
2507         * tests/stress/multiple-files-tests/global-lexical-variable-tdz/second.js: Added.
2508         * tests/stress/multiple-files-tests/global-lexical-variable-unresolved-property: Added.
2509         * tests/stress/multiple-files-tests/global-lexical-variable-unresolved-property/first.js: Added.
2510         (assert):
2511         (shouldThrowTDZ):
2512         (foo):
2513         * tests/stress/multiple-files-tests/global-lexical-variable-unresolved-property/second.js: Added.
2514
2515 2015-09-03  Filip Pizlo  <fpizlo@apple.com>
2516
2517         RepatchBuffer should be stateless
2518         https://bugs.webkit.org/show_bug.cgi?id=148741
2519
2520         Reviewed by Geoffrey Garen.
2521
2522         This removes our reliance on RepatchBuffer having a pointer to CodeBlock. This is in
2523         preparation for removing RepatchBuffer entirely (see
2524         https://bugs.webkit.org/show_bug.cgi?id=148742). In the longer term, this is necessary
2525         for making inline cache code, particularly in StructureStubInfo, more self-contained.
2526         Currently StructureStubInfo relies on very pointless-looking methods in CodeBlock to
2527         clear itself, and the only thing that those methods do is create a RepatchBuffer. It's
2528         quite silly.
2529
2530         * assembler/LinkBuffer.cpp:
2531         (JSC::LinkBuffer::allocate):
2532         (JSC::LinkBuffer::performFinalization):
2533         * assembler/RepatchBuffer.h:
2534         (JSC::RepatchBuffer::RepatchBuffer):
2535         (JSC::RepatchBuffer::~RepatchBuffer):
2536         (JSC::RepatchBuffer::relink):
2537         (JSC::RepatchBuffer::revertJumpReplacementToPatchableBranch32WithPatch):
2538         (JSC::RepatchBuffer::codeBlock): Deleted.
2539         * bytecode/CallLinkInfo.cpp:
2540         (JSC::CallLinkInfo::clearStub):
2541         (JSC::CallLinkInfo::unlink):
2542         (JSC::CallLinkInfo::visitWeak):
2543         * bytecode/CallLinkInfo.h:
2544         (JSC::CallLinkInfo::registerPreservationMode):
2545         (JSC::CallLinkInfo::isLinked):
2546         (JSC::CallLinkInfo::setUpCall):
2547         (JSC::CallLinkInfo::codeOrigin):
2548         * bytecode/CodeBlock.cpp:
2549         (JSC::CodeBlock::finalizeUnconditionally):
2550         (JSC::CodeBlock::resetStubInternal):
2551         (JSC::CodeBlock::unlinkIncomingCalls):
2552         * bytecode/PolymorphicGetByIdList.cpp:
2553         (JSC::GetByIdAccess::fromStructureStubInfo):
2554         (JSC::GetByIdAccess::visitWeak):
2555         (JSC::PolymorphicGetByIdList::didSelfPatching):
2556         (JSC::PolymorphicGetByIdList::visitWeak):
2557         * bytecode/PolymorphicGetByIdList.h:
2558         (JSC::GetByIdAccess::doesCalls):
2559         * bytecode/PolymorphicPutByIdList.cpp:
2560         (JSC::PutByIdAccess::fromStructureStubInfo):
2561         (JSC::PutByIdAccess::visitWeak):
2562         (JSC::PolymorphicPutByIdList::addAccess):
2563         (JSC::PolymorphicPutByIdList::visitWeak):
2564         * bytecode/PolymorphicPutByIdList.h:
2565         (JSC::PutByIdAccess::customSetter):
2566         (JSC::PolymorphicPutByIdList::kind):
2567         * bytecode/StructureStubInfo.cpp:
2568         (JSC::StructureStubInfo::deref):
2569         (JSC::StructureStubInfo::visitWeakReferences):
2570         * bytecode/StructureStubInfo.h:
2571         (JSC::StructureStubInfo::seenOnce):
2572         * jit/AccessorCallJITStubRoutine.cpp:
2573         (JSC::AccessorCallJITStubRoutine::~AccessorCallJITStubRoutine):
2574         (JSC::AccessorCallJITStubRoutine::visitWeak):
2575         * jit/AccessorCallJITStubRoutine.h:
2576         * jit/ExecutableAllocator.h:
2577         (JSC::ExecutableAllocator::makeWritable): Deleted.
2578         (JSC::ExecutableAllocator::makeExecutable): Deleted.
2579         (JSC::ExecutableAllocator::allocator): Deleted.
2580         * jit/JITStubRoutine.cpp:
2581         (JSC::JITStubRoutine::~JITStubRoutine):
2582         (JSC::JITStubRoutine::visitWeak):
2583         * jit/JITStubRoutine.h:
2584         * jit/PolymorphicCallStubRoutine.cpp:
2585         (JSC::PolymorphicCallNode::~PolymorphicCallNode):
2586         (JSC::PolymorphicCallNode::unlink):
2587         (JSC::PolymorphicCallStubRoutine::clearCallNodesFor):
2588         (JSC::PolymorphicCallStubRoutine::visitWeak):
2589         * jit/PolymorphicCallStubRoutine.h:
2590         (JSC::PolymorphicCallNode::hasCallLinkInfo):
2591         * jit/Repatch.cpp:
2592         (JSC::readCallTarget):
2593         (JSC::repatchCall):
2594         (JSC::repatchByIdSelfAccess):
2595         (JSC::tryCacheGetByID):
2596         (JSC::tryCachePutByID):
2597         (JSC::tryBuildPutByIdList):
2598         (JSC::revertCall):
2599         (JSC::unlinkFor):
2600         (JSC::linkVirtualFor):
2601         (JSC::linkPolymorphicCall):
2602         (JSC::resetGetByID):
2603         (JSC::resetPutByID):
2604         (JSC::resetIn):
2605         * jit/Repatch.h:
2606
2607 2015-09-02  Filip Pizlo  <fpizlo@apple.com>
2608
2609         Replace all the various forms of branchStructure() with a single method in AssemblyHelpers
2610         https://bugs.webkit.org/show_bug.cgi?id=148725
2611
2612         Reviewed by Saam Barati.
2613
2614         Previously there were the following branchStructure() implementations:
2615
2616         JSC::JIT::branchStructure()
2617         JSC::branchStructure()
2618         JSC::DFG::JITCompiler::branchStructurePtr()
2619
2620         They all did the same thing.  Now there is only one, AssemblyHelpers::branchStructure().
2621
2622         * dfg/DFGJITCompiler.h:
2623         (JSC::DFG::JITCompiler::branchWeakStructure):
2624         (JSC::DFG::JITCompiler::jitCode):
2625         (JSC::DFG::JITCompiler::branchStructurePtr): Deleted.
2626         * dfg/DFGSpeculativeJIT.cpp:
2627         (JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOnCell):
2628         (JSC::DFG::SpeculativeJIT::speculateStringOrStringObject):
2629         * dfg/DFGSpeculativeJIT.h:
2630         (JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
2631         * jit/AssemblyHelpers.h:
2632         (JSC::AssemblyHelpers::branchIfEmpty):
2633         (JSC::AssemblyHelpers::branchStructure):
2634         (JSC::AssemblyHelpers::addressForByteOffset):
2635         * jit/JIT.h:
2636         * jit/JITInlines.h:
2637         (JSC::JIT::branchStructure): Deleted.
2638         (JSC::branchStructure): Deleted.
2639         * jit/JITPropertyAccess.cpp:
2640         (JSC::JIT::stringGetByValStubGenerator):
2641         * jit/JITPropertyAccess32_64.cpp:
2642         (JSC::JIT::stringGetByValStubGenerator):
2643         * jit/Repatch.cpp:
2644         (JSC::checkObjectPropertyCondition):
2645         (JSC::checkObjectPropertyConditions):
2646         (JSC::generateByIdStub):
2647         (JSC::emitPutReplaceStub):
2648         (JSC::emitPutTransitionStub):
2649         (JSC::tryRepatchIn):
2650         * jit/SpecializedThunkJIT.h:
2651         (JSC::SpecializedThunkJIT::loadJSStringArgument):
2652
2653 2015-09-02  Filip Pizlo  <fpizlo@apple.com>
2654
2655         Remove some unused methods from GetByIdAccess.
2656
2657         Rubber stamped by Michael Saboff.
2658
2659         * bytecode/PolymorphicGetByIdList.h:
2660         (JSC::GetByIdAccess::stubRoutine):
2661         (JSC::GetByIdAccess::doesCalls):
2662         (JSC::GetByIdAccess::isWatched): Deleted.
2663         (JSC::GetByIdAccess::isSimple): Deleted.
2664
2665 2015-09-02  Geoffrey Garen  <ggaren@apple.com>
2666
2667         Fix the no JIT build.
2668
2669         Unreviewed.
2670
2671         * heap/Heap.cpp:
2672         (JSC::Heap::markRoots):
2673
2674 2015-09-02  Geoffrey Garen  <ggaren@apple.com>
2675
2676         CodeBlock should have a more explicit "strongly referenced" state
2677         https://bugs.webkit.org/show_bug.cgi?id=148714
2678
2679         Reviewed by Filip Pizlo.
2680
2681         Previously, CodeBlock had a "may be executing" bit, which was used by
2682         both the stack visitor and the compiler to indicate "this CodeBlock must
2683         not jettison itself".
2684
2685         Now, CodeBlock has an explicit "is strongly referenced" bit to do the
2686         same.
2687
2688         For now, there is no behavior change. In future, I will use the "is
2689         strongly referenced" bit to indicate the set of all references that
2690         cause a CodeBlock not to jettison itself. Strong references and stack
2691         references will be different because:
2692
2693             (1) A stack reference requires a write barrier at the end of GC
2694             (since CodeBlocks only barrier themselves on function entry,
2695             and GC will clear that barrier); but a strong reference does not
2696             need or want a write barrier at the end of GC.
2697
2698             (2) Visiting more heap objects might reveal more strong references
2699             but, by definition, it cannot reveal more stack references.
2700
2701         Also, this patch adds an explicit mark clearing phase for compiler
2702         CodeBlocks, which does the work that would normally be done by a write
2703         barrier. A compiler CodeBlock can't rely on a normal write barrier 
2704         because the compiler writes to CodeBlocks without invoking a write
2705         barrier, and because the CodeBlock write barrier operates on an
2706         executable, but an in-flight compilation is not pointed to by any
2707         executable. This bug does not appear to be noticeable in the current
2708         system, but I will probably make it noticeable.
2709
2710         * bytecode/CodeBlock.cpp:
2711         (JSC::CodeBlock::CodeBlock):
2712         (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan):
2713         (JSC::CodeBlock::isKnownToBeLiveDuringGC):
2714         * bytecode/CodeBlock.h:
2715         (JSC::ExecState::uncheckedR):
2716         (JSC::CodeBlockSet::clearMarks):
2717         (JSC::CodeBlockSet::mark):
2718         * dfg/DFGPlan.cpp:
2719         (JSC::DFG::Plan::key):
2720         (JSC::DFG::Plan::clearCodeBlockMarks):
2721         (JSC::DFG::Plan::checkLivenessAndVisitChildren):
2722         * dfg/DFGPlan.h:
2723         * dfg/DFGWorklist.cpp:
2724         (JSC::DFG::Worklist::completeAllPlansForVM):
2725         (JSC::DFG::Worklist::clearCodeBlockMarks):
2726         (JSC::DFG::Worklist::suspendAllThreads):
2727         (JSC::DFG::Worklist::visitWeakReferences):
2728         (JSC::DFG::completeAllPlansForVM):
2729         (JSC::DFG::clearCodeBlockMarks):
2730         * dfg/DFGWorklist.h:
2731         (JSC::DFG::worklistForIndexOrNull):
2732         * heap/CodeBlockSet.cpp:
2733         (JSC::CodeBlockSet::clearMarksForFullCollection):
2734         (JSC::CodeBlockSet::clearMarksForEdenCollection):
2735         (JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
2736         (JSC::CodeBlockSet::traceMarked):
2737         (JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks):
2738         * heap/CodeBlockSet.h:
2739         * heap/Heap.cpp:
2740         (JSC::Heap::markRoots):
2741
2742 2015-09-01  Brian Burg  <bburg@apple.com>
2743
2744         Web Inspector: protocol generator should not allow non-boolean values for "optional" key
2745         https://bugs.webkit.org/show_bug.cgi?id=148679
2746
2747         Reviewed by Joseph Pecoraro.
2748
2749         In Python, the 'bool' type inherits from 'int'. In the runtime, True and False are
2750         just numbers to Python. So, the existing check for boolean literals was not quite right.
2751
2752         * inspector/scripts/codegen/models.py: Use isinstance instead.
2753         (TypeMember.__init__):
2754         (Parameter.__init__):
2755         * inspector/scripts/tests/expected/fail-on-number-typed-optional-parameter-flag.json-error: Added.
2756         * inspector/scripts/tests/expected/fail-on-number-typed-optional-type-member.json-error: Added.
2757         * inspector/scripts/tests/fail-on-number-typed-optional-parameter-flag.json: Added.
2758         * inspector/scripts/tests/fail-on-number-typed-optional-type-member.json: Added.
2759
2760 2015-09-01  Filip Pizlo  <fpizlo@apple.com>
2761
2762         DFG AI assertions about not having to do type checks at the point of a Known use kind are unsound
2763         https://bugs.webkit.org/show_bug.cgi?id=148649
2764
2765         Reviewed by Saam Barati.
2766
2767         We often generate IR like:
2768
2769         Check(Int32:@x)
2770         ...
2771         Foo(KnownInt32:@x)
2772
2773         It would be valid for any optimization that somehow proves the type of @x to remove the
2774         Check node entirely. But then, AI might fail on an assertion at Foo() because of the
2775         KnownInt32 use kind, if AI isn't smart enough to construct the same proof that the former
2776         optimization used for removing the Check.
2777
2778         The correct solution is to remove the compile-time assertions about Known use kinds
2779         having already been checked.
2780
2781         * dfg/DFGAbstractInterpreterInlines.h:
2782         (JSC::DFG::AbstractInterpreter<AbstractStateType>::verifyEdge):
2783
2784 2015-09-01  Brian Burg  <bburg@apple.com>
2785
2786         Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
2787         https://bugs.webkit.org/show_bug.cgi?id=148612
2788
2789         Reviewed by Joseph Pecoraro.
2790
2791         Both InjectedScriptManager and AgentRegistry (thus all agents) are
2792         owned by JSGlobalObjectInspectorController. So, use references.
2793
2794         Add brace initalizers for scalar and pointer members in agent classes.
2795
2796         * inspector/ConsoleMessage.cpp:
2797         (Inspector::ConsoleMessage::addToFrontend):
2798         (Inspector::ConsoleMessage::updateRepeatCountInConsole):
2799         (Inspector::ConsoleMessage::ConsoleMessage):
2800         * inspector/ConsoleMessage.h:
2801         * inspector/JSGlobalObjectInspectorController.cpp:
2802         (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
2803         * inspector/agents/InspectorAgent.cpp:
2804         (Inspector::InspectorAgent::InspectorAgent):
2805         * inspector/agents/InspectorAgent.h:
2806         * inspector/agents/InspectorConsoleAgent.cpp:
2807         (Inspector::InspectorConsoleAgent::InspectorConsoleAgent):
2808         (Inspector::InspectorConsoleAgent::enable):
2809         (Inspector::InspectorConsoleAgent::clearMessages):
2810         (Inspector::InspectorConsoleAgent::addMessageToConsole):
2811         (Inspector::InspectorConsoleAgent::addConsoleMessage):
2812         * inspector/agents/InspectorConsoleAgent.h:
2813         * inspector/agents/InspectorDebuggerAgent.cpp:
2814         (Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
2815         (Inspector::InspectorDebuggerAgent::removeBreakpoint):
2816         (Inspector::InspectorDebuggerAgent::getFunctionDetails):
2817         (Inspector::InspectorDebuggerAgent::evaluateOnCallFrame):
2818         (Inspector::InspectorDebuggerAgent::didPause):
2819         (Inspector::InspectorDebuggerAgent::breakpointActionProbe):
2820         (Inspector::InspectorDebuggerAgent::didContinue):
2821         (Inspector::InspectorDebuggerAgent::clearExceptionValue):
2822         * inspector/agents/InspectorDebuggerAgent.h:
2823         * inspector/agents/InspectorRuntimeAgent.cpp:
2824         (Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
2825         (Inspector::InspectorRuntimeAgent::callFunctionOn):
2826         (Inspector::InspectorRuntimeAgent::getProperties):
2827         (Inspector::InspectorRuntimeAgent::getDisplayableProperties):
2828         (Inspector::InspectorRuntimeAgent::getCollectionEntries):
2829         (Inspector::InspectorRuntimeAgent::saveResult):
2830         (Inspector::InspectorRuntimeAgent::releaseObject):
2831         (Inspector::InspectorRuntimeAgent::releaseObjectGroup):
2832         * inspector/agents/InspectorRuntimeAgent.h:
2833         * inspector/agents/JSGlobalObjectConsoleAgent.cpp:
2834         (Inspector::JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent):
2835         * inspector/agents/JSGlobalObjectConsoleAgent.h:
2836         * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
2837         (Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
2838         (Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
2839         * inspector/agents/JSGlobalObjectDebuggerAgent.h:
2840         * inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
2841         (Inspector::JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent):
2842         (Inspector::JSGlobalObjectRuntimeAgent::injectedScriptForEval):
2843         * inspector/agents/JSGlobalObjectRuntimeAgent.h:
2844
2845 2015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2846
2847         [ES6] Introduce ModuleProgramExecutable families and compile Module code to bytecode
2848         https://bugs.webkit.org/show_bug.cgi?id=148581
2849
2850         Reviewed by Saam Barati.
2851
2852         This patch introduces ModuleProgramExecutable, that is new executable type for the ES6 modules.
2853         And related code block types, UninkedModuleProgramCodeBlock and ModuleProgramCodeBlock are also
2854         introduced. BytecodeGenerator now recognizes these types and emits the bytecode and constructs
2855         the symbol table for the module environment. While this patch introduces the bytecode generation
2856         for the ES6 modules, the module environment instantiation initialization and imported binding
2857         resolution are not included in this patch. They will be implemented in the subsequent patch.
2858
2859         The interesting part is the symbol table construction for the module environment.
2860         Since the module code will be only executed once, the module environment need not to be allocated
2861         and instantiated inside the module code; In the case of the function code, the function code need
2862         to allocate the environment inside the prologue of it because the function code can be executed
2863         more than once and the function environments are different in each time of the executions.
2864         The module environment will be instantiated outside the module code before executing the module code.
2865         This is required because we need to link the module environments to import the bindings before
2866         executing the any module code in the dependency graph. And this is because the function inside the
2867         module may be executed before the module top-level body is executed. (See the code comment for more
2868         detailed situations)
2869
2870         The module environment will hold the top-most heap allocated variables in the module code.
2871         This has the following benefits.
2872         1) This enables JSC to perform the usual LocalClosureVar operations onto it.
2873         2) It also makes the exported lexical variables just the heap allocated lexical variables.
2874         3) Make it possible to initialize the heap allocated function declarations before executing the module
2875            code. It is required under the circular dependency (see the code comment for more details).
2876
2877         To do so, the module environment will be constructed with the symbol table that is generated by the
2878         bytecode generator. And the symbol table is held by the unlinked code block. That means, once the module
2879         environment is instantiated, we cannot clear the unlinked code block before executing the module since
2880         the layout of the instantiated module environment is coupled with the unlinked code block. This is OK
2881         because the module code can be cleared once we executed the module code. If we failed to execute the
2882         module (some errors occur), we can throw away the both, the module environment and the unlinked code block.
2883
2884         The unlinked module program code block holds the symbol table, but it does not hold the module environment.
2885         So the unlinked module program code block can be cached. While unlinked code block can be cached, the linked
2886         code block cannot be cached because it is already linked to the specific set of the module environment to
2887         resolve the imported bindings.
2888
2889         * JavaScriptCore.xcodeproj/project.pbxproj:
2890         * bytecode/BytecodeList.json:
2891         * bytecode/CodeBlock.cpp:
2892         (JSC::CodeBlock::inferredName):
2893         (JSC::ModuleProgramCodeBlock::replacement):
2894         (JSC::ProgramCodeBlock::capabilityLevelInternal):
2895         (JSC::ModuleProgramCodeBlock::capabilityLevelInternal):
2896         * bytecode/CodeBlock.h:
2897         (JSC::ModuleProgramCodeBlock::ModuleProgramCodeBlock):
2898         (JSC::EvalCodeBlock::EvalCodeBlock):
2899         (JSC::FunctionCodeBlock::FunctionCodeBlock):
2900         * bytecode/CodeType.cpp:
2901         (WTF::printInternal):
2902         * bytecode/CodeType.h:
2903         * bytecode/UnlinkedCodeBlock.cpp:
2904         (JSC::UnlinkedModuleProgramCodeBlock::visitChildren):
2905         (JSC::UnlinkedModuleProgramCodeBlock::destroy):
2906         (JSC::UnlinkedCodeBlock::visitChildren): Deleted.
2907         * bytecode/UnlinkedCodeBlock.h:
2908         (JSC::UnlinkedCodeBlock::finishCreation): Deleted.
2909         * bytecompiler/BytecodeGenerator.cpp:
2910         (JSC::BytecodeGenerator::generate):
2911         (JSC::BytecodeGenerator::BytecodeGenerator):
2912         (JSC::BytecodeGenerator::instantiateLexicalVariables):
2913         (JSC::BytecodeGenerator::emitPrefillStackTDZVariables):
2914         (JSC::BytecodeGenerator::pushLexicalScopeInternal):
2915         * bytecompiler/BytecodeGenerator.h:
2916         * bytecompiler/NodesCodegen.cpp:
2917         (JSC::emitProgramNodeBytecode):
2918         (JSC::ProgramNode::emitBytecode):
2919         (JSC::ModuleProgramNode::emitBytecode):
2920         (JSC::ImportDeclarationNode::emitBytecode):
2921         (JSC::ExportAllDeclarationNode::emitBytecode):
2922         (JSC::ExportDefaultDeclarationNode::emitBytecode):
2923         (JSC::ExportLocalDeclarationNode::emitBytecode):
2924         (JSC::ExportNamedDeclarationNode::emitBytecode):
2925         * interpreter/Interpreter.cpp:
2926         (JSC::StackFrame::friendlySourceURL):
2927         (JSC::StackFrame::friendlyFunctionName):
2928         (JSC::getStackFrameCodeType):
2929         * interpreter/Interpreter.h:
2930         * interpreter/StackVisitor.cpp:
2931         (JSC::StackVisitor::Frame::codeType):
2932         (JSC::StackVisitor::Frame::functionName):
2933         (JSC::StackVisitor::Frame::sourceURL):
2934         * interpreter/StackVisitor.h:
2935         * jit/JIT.cpp:
2936         (JSC::JIT::privateCompile):
2937         * llint/LLIntData.cpp:
2938         (JSC::LLInt::Data::performAssertions):
2939         * llint/LLIntEntrypoint.cpp:
2940         (JSC::LLInt::setModuleProgramEntrypoint):
2941         (JSC::LLInt::setEntrypoint):
2942         * llint/LLIntOffsetsExtractor.cpp:
2943         * llint/LLIntThunks.cpp:
2944         (JSC::LLInt::moduleProgramEntryThunkGenerator):
2945         * llint/LLIntThunks.h:
2946         * llint/LowLevelInterpreter.asm:
2947         * parser/ModuleAnalyzer.cpp:
2948         (JSC::ModuleAnalyzer::exportVariable):
2949         * parser/Parser.cpp:
2950         (JSC::Parser<LexerType>::parseImportClauseItem):
2951         (JSC::Parser<LexerType>::parseExportDeclaration):
2952         * parser/Parser.h:
2953         (JSC::Scope::declareLexicalVariable):
2954         * parser/VariableEnvironment.h:
2955         (JSC::VariableEnvironmentEntry::isImportedNamespace):
2956         (JSC::VariableEnvironmentEntry::setIsImportedNamespace):
2957         (JSC::VariableEnvironment::find):
2958         * runtime/CodeCache.cpp:
2959         (JSC::CodeCache::getGlobalCodeBlock):
2960         (JSC::CodeCache::getModuleProgramCodeBlock):
2961         * runtime/CodeCache.h:
2962         * runtime/Executable.cpp:
2963         (JSC::ScriptExecutable::installCode):
2964         (JSC::ScriptExecutable::newCodeBlockFor):
2965         (JSC::ScriptExecutable::newReplacementCodeBlockFor):
2966         (JSC::ModuleProgramExecutable::ModuleProgramExecutable):
2967         (JSC::ModuleProgramExecutable::create):
2968         (JSC::ModuleProgramExecutable::destroy):
2969         (JSC::ModuleProgramExecutable::visitChildren):
2970         (JSC::ModuleProgramExecutable::clearCode):
2971         (JSC::ExecutableBase::dump):
2972         * runtime/Executable.h:
2973         (JSC::ExecutableBase::isModuleProgramExecutable):
2974         (JSC::ExecutableBase::clearCodeVirtual):
2975         * runtime/JSGlobalObject.cpp:
2976         (JSC::JSGlobalObject::createModuleProgramCodeBlock):
2977         * runtime/JSGlobalObject.h:
2978         * runtime/JSModuleRecord.cpp:
2979         (JSC::JSModuleRecord::visitChildren):
2980         (JSC::JSModuleRecord::link):
2981         * runtime/JSModuleRecord.h:
2982         (JSC::JSModuleRecord::moduleProgramExecutable):
2983         * runtime/JSType.h:
2984         * runtime/ModuleLoaderObject.cpp:
2985         (JSC::moduleLoaderObjectModuleDeclarationInstantiation):
2986         * runtime/VM.cpp:
2987         (JSC::VM::VM):
2988         * runtime/VM.h:
2989
2990 2015-08-31  Basile Clement  <basile_clement@apple.com>
2991
2992         Unreviewed, build fix after r189292
2993
2994         * bytecode/ValueRecovery.h:
2995         (JSC::ValueRecovery::jsValueRegs): Deleted.
2996
2997 2015-08-24  Basile Clement  <basile_clement@apple.com>
2998
2999         ValueRecovery should distinguish between doubles in an FPR and JSValues in an FPR
3000         https://bugs.webkit.org/show_bug.cgi?id=148336
3001
3002         Reviewed by Michael Saboff.
3003
3004         Currently, ValueRecovery::InFPR means "this is a *double* value in an
3005         FPR". Let's change the semantics to be "this is a *JSValue* in an FPR"
3006         (to match ValueRecovery::InGPR), and introduce
3007         ValueRecovery::UnboxedDoubleInFPR to mean "this is a double value in an
3008         FPR".
3009
3010         * bytecode/ValueRecovery.cpp:
3011         (JSC::ValueRecovery::dumpInContext):
3012         * bytecode/ValueRecovery.h:
3013         (JSC::ValueRecovery::operator bool):
3014         (JSC::ValueRecovery::inFPR):
3015         (JSC::ValueRecovery::isInGPR):
3016         (JSC::ValueRecovery::isInFPR):
3017         (JSC::ValueRecovery::isInRegisters):
3018         (JSC::ValueRecovery::isInJSStack):
3019         (JSC::ValueRecovery::dataFormat):
3020         (JSC::ValueRecovery::gpr):
3021         (JSC::ValueRecovery::isInJSValueRegs):
3022         (JSC::ValueRecovery::jsValueRegs):
3023         (JSC::ValueRecovery::fpr):
3024         (JSC::ValueRecovery::virtualRegister):
3025         (JSC::ValueRecovery::constant):
3026         * dfg/DFGOSRExitCompiler32_64.cpp:
3027         (JSC::DFG::OSRExitCompiler::compileExit):
3028         * dfg/DFGOSRExitCompiler64.cpp:
3029         (JSC::DFG::OSRExitCompiler::compileExit):
3030         * dfg/DFGVariableEventStream.cpp:
3031         (JSC::DFG::VariableEventStream::reconstruct):
3032
3033 2015-08-31  Chris Dumez  <cdumez@apple.com>
3034
3035         NodeFilter.SHOW_ALL has wrong value on 32-bit
3036         https://bugs.webkit.org/show_bug.cgi?id=148602
3037
3038         Reviewed by Geoffrey Garen.
3039
3040         NodeFilter.SHOW_ALL has wrong value on 32-bit. This is because
3041         NodeFilter.SHOW_ALL is an unsigned long whose value is 0xFFFFFFFF but
3042         our bindings code is casting it to an intptr_t type which is not wide
3043         enough on 32-bit.
3044
3045         * create_hash_table:
3046         Add extra curly brackets to initialize the union.
3047
3048         * runtime/Lookup.h:
3049         Use a union type to store either a struct containing 2 intptr_t members
3050         (value1 / value2) or a large constant of type unsigned long long. When
3051         storing a constant, we only need one of the values so this allows us to
3052         support larger constants without increasing the actual HashTableValue
3053         size.
3054
3055 2015-08-31  Mark Lam  <mark.lam@apple.com>
3056
3057         Watchdog timer callback should release the lock before deref'ing the watchdog.
3058         https://bugs.webkit.org/show_bug.cgi?id=148635
3059
3060         Reviewed by Filip Pizlo.
3061
3062         The deref'ing of the watchdog may free it.  The lock may not be available to be unlocked
3063         after the deref.
3064
3065         * runtime/Watchdog.cpp:
3066         (JSC::Watchdog::Watchdog):
3067
3068 2015-08-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3069
3070         [ES6] JSON.stringify should ignore object properties that have symbol values and convert the symbol values in array to null
3071         https://bugs.webkit.org/show_bug.cgi?id=148628
3072
3073         Reviewed by Saam Barati.
3074
3075         As per ECMA262 6.0,
3076
3077         1. JSON.stringify should ignore object properties that have symbol values.
3078
3079             SerializeJSONProperty[1] will return undefined if the value of the property is a symbol.
3080             In this case, SerializeJSONObject[2] does not append any string for this property.
3081
3082         2. JSON.stringify should convert the symbol values in array to null
3083
3084             As the same to the object case, SerializeJSONProperty will return undefined if the value of the property is a symbol.
3085             But in the case of arrays, if the result of SerializeJSONProperty is undefined, it will emit "null"[3].
3086             This behavior is already implemented in the existing JSON.stringify. Added tests to ensure that.
3087
3088         [1]: http://www.ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty
3089         [2]: http://www.ecma-international.org/ecma-262/6.0/#sec-serializejsonobject
3090         [3]: http://www.ecma-international.org/ecma-262/6.0/#sec-serializejsonarray
3091
3092         * runtime/JSONObject.cpp:
3093         (JSC::unwrapBoxedPrimitive):
3094         (JSC::Stringifier::appendStringifiedValue):
3095         (JSC::Stringifier::Holder::appendNextProperty):
3096         * tests/stress/symbol-with-json.js:
3097         (shouldBe):
3098
3099 2015-08-30  Filip Pizlo  <fpizlo@apple.com>
3100
3101         JSC property attributes should fit in a byte
3102         https://bugs.webkit.org/show_bug.cgi?id=148611
3103
3104         Reviewed by Sam Weinig.
3105
3106         I want to make room in PropertyMapEntry for more things to support property type inference (see
3107         https://bugs.webkit.org/show_bug.cgi?id=148610). The most obvious candidate for a size reduction is
3108         attributes, since we only have a small number of attribute bits. Even without complex changes, it
3109         would have been possible to reduce the attribute field from 32 bits to 16 bits. Specifically, prior
3110         to this change, the attributes field needed 9 bits. This made it very tempting to trim it so that
3111         it could fit in a byte.
3112
3113         Luckily, many of the attributes bits are for the static lookup hashtables that we use for lazily
3114         building objects in the standard library. Those bits don't need to stay around after the property
3115         has been created, since they are just for telling the code in Lookup how to create the property.
3116         So, this change separates the attributes bits into those that are interesting for Structure and
3117         those that aren't. The ones used by Structure sit in the low 8 bits, allowing for the attributes
3118         field in PropertyMapEntry to be a uint8_t. The attributes bits used only by Lookup use the higher
3119         bits. In production, the conversion from the Lookup attributes to the Structure attributes is just
3120         a cast to uint8_t. In debug, we assert that those bits are not dropped by accident. Code that
3121         intentionally drops those bits calls attributesForStructure().
3122
3123         It turned out that there was a lot of code that was using the Function bit even in code that didn't
3124         involve Lookup. This change removes those uses of Function. Structure does not need to know if we
3125         think that a property points to a function.
3126
3127         * jsc.cpp:
3128         (GlobalObject::finishCreation):
3129         * runtime/JSGlobalObject.cpp:
3130         (JSC::JSGlobalObject::init):
3131         * runtime/JSObject.h:
3132         * runtime/Lookup.cpp:
3133         (JSC::setUpStaticFunctionSlot):
3134         * runtime/Lookup.h:
3135         (JSC::getStaticPropertySlot):
3136         (JSC::getStaticValueSlot):
3137         (JSC::reifyStaticProperties):
3138         * runtime/MathObject.cpp:
3139         (JSC::MathObject::finishCreation):
3140         * runtime/NumberConstructor.cpp:
3141         (JSC::NumberConstructor::finishCreation):
3142         * runtime/PropertySlot.h:
3143         (JSC::attributesForStructure):
3144         (JSC::PropertySlot::setValue):
3145         (JSC::PropertySlot::setCustom):
3146         (JSC::PropertySlot::setCacheableCustom):
3147         (JSC::PropertySlot::setGetterSlot):
3148         (JSC::PropertySlot::setCacheableGetterSlot):
3149         * runtime/Structure.h:
3150         (JSC::PropertyMapEntry::PropertyMapEntry):
3151
3152 2015-08-29  Chris Dumez  <cdumez@apple.com>
3153
3154         Unreviewed, fix PropertyName::isNull() that was introduced in r188994.
3155
3156         The condition was reversed.
3157
3158         * runtime/PropertyName.h:
3159         (JSC::PropertyName::isNull):
3160
3161 2015-08-28  Commit Queue  <commit-queue@webkit.org>
3162
3163         Unreviewed, rolling out r189136.
3164         https://bugs.webkit.org/show_bug.cgi?id=148608
3165
3166         Made JSC tests flaky (Requested by ap on #webkit).
3167
3168         Reverted changeset:
3169
3170         "[JSC][x86] Improve the compare functions when comparing with
3171         zero"
3172         https://bugs.webkit.org/show_bug.cgi?id=148536
3173         http://trac.webkit.org/changeset/189136
3174
3175 2015-08-28  Benjamin Poulain  <bpoulain@apple.com>
3176
3177         [JSC] Get rid of DFG's MergeMode
3178         https://bugs.webkit.org/show_bug.cgi?id=148245
3179
3180         Reviewed by Mark Lam.
3181
3182         That code has become useless, the merge mode is always MergeToSuccessors.
3183
3184         * JavaScriptCore.xcodeproj/project.pbxproj:
3185         * dfg/DFGCFAPhase.cpp:
3186         (JSC::DFG::CFAPhase::performBlockCFA):
3187         * dfg/DFGInPlaceAbstractState.cpp:
3188         (JSC::DFG::InPlaceAbstractState::endBasicBlock):
3189         * dfg/DFGInPlaceAbstractState.h:
3190         * dfg/DFGMergeMode.h: Removed.
3191
3192 2015-08-28  Benjamin Poulain  <bpoulain@apple.com>
3193
3194         [JSC][x86] Improve the compare functions when comparing with zero
3195         https://bugs.webkit.org/show_bug.cgi?id=148536
3196
3197         Reviewed by Geoffrey Garen.
3198
3199         This patch has two parts:
3200         1) The macro assembler gets an additional cmp->test optimization
3201            for LessThan and GreaterThanOrEqual.
3202            Instead of comparing the value with an immediate, test the value
3203            with itself and use the flag.
3204         2) Extend the DFG JIT optimization of compare.
3205            In particular, use the same optimization in compileInt32Compare()
3206            as we have in compilePeepHoleBooleanBranch().
3207            The generator compileInt32Compare() is unfortunately very
3208            common due to MoveHints placed between the Compare node and the Branch
3209            node.
3210
3211         * assembler/MacroAssembler.h:
3212         (JSC::MacroAssembler::compare32):
3213         * assembler/MacroAssemblerX86Common.h:
3214         (JSC::MacroAssemblerX86Common::branch32):
3215         (JSC::MacroAssemblerX86Common::compare32):
3216         * dfg/DFGSpeculativeJIT.cpp:
3217         (JSC::DFG::SpeculativeJIT::compilePeepHoleBooleanBranch):
3218         * dfg/DFGSpeculativeJIT64.cpp:
3219         (JSC::DFG::SpeculativeJIT::compileInt32Compare):
3220
3221 2015-08-28  Mark Lam  <mark.lam@apple.com>
3222
3223         Add MacroAssemblerPrinter support for printing memory.
3224         https://bugs.webkit.org/show_bug.cgi?id=148600
3225
3226         Reviewed by Saam Barati.
3227
3228         Previously, we can dump registers at runtime.  Now we can dump memory too.
3229         See comment in MacroAssemblerPrinter.h for examples of how to do this.
3230
3231         * assembler/MacroAssemblerPrinter.cpp:
3232         (JSC::printMemory):
3233         (JSC::MacroAssemblerPrinter::printCallback):
3234         * assembler/MacroAssemblerPrinter.h:
3235         (JSC::Memory::Memory):
3236         (JSC::MemWord::MemWord):
3237         (JSC::MacroAssemblerPrinter::PrintArg::PrintArg):
3238
3239 2015-08-28  Khem Raj  <raj.khem@gmail.com>
3240
3241         JavaScriptCore fails to build using GCC 5
3242         https://bugs.webkit.org/show_bug.cgi?id=147815
3243
3244         Reviewed by Filip Pizlo.
3245
3246         * runtime/JSObject.cpp: Explicitly instantiate all variants of
3247         putByIndexBeyondVectorLengthWithAttributes used by JSArray.cpp.
3248
3249 2015-08-28  Mark Lam  <mark.lam@apple.com>
3250
3251         Refactor the JIT printer out of the AbstractMacroAssembler into MacroAssemblerPrinter.
3252         https://bugs.webkit.org/show_bug.cgi?id=148595
3253
3254         Reviewed by Geoffrey Garen.
3255
3256         Why do this?
3257         1. MacroAssembler::print() code (except for the prototype) need no longer be parsed
3258            when compiling C++ files that don't need it.
3259         2. Adding support for more printable types to MacroAssemblerPrinter::PrintArg
3260            triggers recompilation of less files.
3261         3. The printing code is for most the part common between all target platforms and
3262            was previously duplicated by cut-and-paste to all the varieties of MacroAssemblers
3263            that support the MASM_PROBE mechanism.  Now, there is only one copy in
3264            MacroAssemblerPrinter.
3265
3266         * CMakeLists.txt:
3267         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
3268         * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
3269         * JavaScriptCore.xcodeproj/project.pbxproj:
3270
3271         * assembler/AbstractMacroAssembler.h:
3272         (JSC::AbstractMacroAssembler::ProbeContext::print): Deleted.
3273         - Removed this function because it is no longer useful since we have this more
3274           flexible print() functionality.
3275
3276         (JSC::AbstractMacroAssembler::printIndent): Deleted.
3277         (JSC::AbstractMacroAssembler::printCPU): Deleted.
3278         (JSC::AbstractMacroAssembler::print): Deleted.
3279         (JSC::AbstractMacroAssembler::PrintArg::PrintArg): Deleted.
3280         (JSC::AbstractMacroAssembler::appendPrintArg): Deleted.
3281         (JSC::AbstractMacroAssembler::printInternal): Deleted.
3282         (JSC::AbstractMacroAssembler::printCallback): Deleted.
3283         - These got moved into MacroAssemblerPrinter.cpp.
3284
3285         * assembler/MacroAssembler.h:
3286         * assembler/MacroAssemblerARM.cpp:
3287         (JSC::MacroAssemblerARM::printCPURegisters): Deleted.
3288         (JSC::MacroAssemblerARM::printRegister): Deleted.
3289         * assembler/MacroAssemblerARM.h:
3290         * assembler/MacroAssemblerARMv7.cpp:
3291         (JSC::MacroAssemblerARMv7::printCPURegisters): Deleted.
3292         (JSC::MacroAssemblerARMv7::printRegister): Deleted.
3293         * assembler/MacroAssemblerARMv7.h:
3294         * assembler/MacroAssemblerX86Common.cpp:
3295         (JSC::MacroAssemblerX86Common::printCPURegisters): Deleted.
3296         (JSC::MacroAssemblerX86Common::printRegister): Deleted.
3297         * assembler/MacroAssemblerX86Common.h:
3298         - Deleted a whole bunch of mostly duplicated code.
3299
3300         * assembler/MacroAssemblerPrinter.cpp: Added.
3301         (JSC::printIndent):
3302         (JSC::printCPU):
3303         (JSC::printCPURegisters):
3304         (JSC::printRegister):
3305         (JSC::MacroAssemblerPrinter::printCallback):
3306         * assembler/MacroAssemblerPrinter.h: Added.
3307         (JSC::MacroAssemblerPrinter::print):
3308         (JSC::MacroAssemblerPrinter::PrintArg::PrintArg):
3309         (JSC::MacroAssemblerPrinter::appendPrintArg):
3310         (JSC::MacroAssembler::print):
3311
3312 2015-08-28  Filip Pizlo  <fpizlo@apple.com>
3313
3314         LICM should be sound even if the CFG has changed
3315         https://bugs.webkit.org/show_bug.cgi?id=148259
3316
3317         Reviewed by Benjamin Poulain.
3318
3319         Prior to this change, LICM expected a certain CFG shape around a loop: broken critical edges,
3320         a pre-header, and the pre-header's terminal has exitOK. LICM would either crash on an
3321         assertion, or generate code that fails validation, if these conditions weren't met.
3322
3323         The broken critical edge assumption is fine; so far we are assuming that SSA means broken
3324         critical edges. We may revisit this, but we don't have to right now.
3325
3326         The other assumptions are not fine, because it's hard to guarantee that every phase will
3327         preserve the presence of pre-headers. Even if we required that pre-headers are regenerated
3328         before LICM, that regeneration wouldn't be guaranteed to create pre-headers that have exitOK at
3329         the terminal. That's because once in SSA, the loop header probably has exitOK=false at the
3330         head because of Phi's. Pre-header creation has no choice but to use the Node::origin from the
3331         loop header, which means creating a pre-header that has exitOK=false. Regardless of whether
3332         that's a fixable problem, it seems that our best short-term approach is just to be defensive
3333         and turn undesirable pathologies into performance bugs and not crashes.
3334
3335         For the foreseeable future, once pre-headers are created they will probably not be removed. Our
3336         current CFG simplification phase doesn't have a rule for removing pre-headers (since it doesn't
3337         have any jump threading). So, it wouldn't be profitable to put effort towards reneration of
3338         pre-headers for LICM's benefit.
3339
3340         Also, we cannot guarantee that some sequence of CFG transformations will not create a loop that
3341         doesn't have a pre-header. This would be super rare. But you could imagine that some program
3342         has control flow encoded using relooping (like
3343         https://github.com/kripken/Relooper/blob/master/paper.pdf). If that happens, our compiler will
3344         probably incrementally discover the "original" CFG. That may happen only after SSA conversion,
3345         and so after pre-header generation. This is super unlikely for a bunch of reasons, but it
3346         *could* happen.
3347
3348         So, this patch just makes sure that if pre-headers are missing or cannot be exited from, LICM
3349         will simply avoid hoisting out of that block. At some point later, we can worry about a more
3350         comprehensive solution to the pre-header problem. That's covered by this bug:
3351         https://bugs.webkit.org/show_bug.cgi?id=148586
3352
3353         * dfg/DFGLICMPhase.cpp:
3354