Source/JavaScriptCore/ChangeLog

 12015-10-20 Brian Burg <bburg@apple.com>
 2
 3 Restructure generate-js-bindings script to be modular and testable
 4 https://bugs.webkit.org/show_bug.cgi?id=149929
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This is a new code generator, based on the replay inputs code generator and
 9 the inspector protocol code generator, which produces various files for JS
 10 builtins.
 11
 12 Relative to the generator it replaces, this one consolidates two scripts in
 13 JavaScriptCore and WebCore into a single script with multiple files. Parsed
 14 information about the builtins file is stored in backend-independent model
 15 objects. Each output file has its own code generator that uses the model to
 16 produce resulting code. Generators are additionally parameterized by the target
 17 framework (to choose correct macros and includes) and output mode (one
 18 header/implementation file per builtin or per framework).
 19
 20 It includes a few simple tests of the generator's functionality. These result-
 21 based tests will become increasingly more important as we start to add support
 22 for builtins annotation such as @optional, @internal, etc. to the code generator.
 23
 24 Some of these complexities, such as having two output modes, will be removed in
 25 subsequent patches. This patch is intended to exactly replace the existing
 26 functionality with a unified script that makes additional cleanups straightforward.
 27
 28 Additional cleanup and consolidation between inspector code generator scripts
 29 and this script will be pursued in followup patches.
 30
 31 New tests:
 32
 33 Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Combined.js
 34 Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Separate.js
 35 Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js
 36 Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Separate.js
 37 Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Combined.js
 38 Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Separate.js
 39 Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js
 40 Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js
 41 Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js
 42 Scripts/tests/builtins/WebCore-xmlCasingTest-Separate.js
 43
 44
 45 * CMakeLists.txt:
 46
 47 Define JavaScriptCore_SCRIPTS_DIR explicitly so the add_custom_command and
 48 shared file lists are identical between JavaScriptCore and WebCore.
 49
 50 The output files additionally depend on all builtin generator script files
 51 and input files that are combined into the single header/implementation file.
 52
 53 * DerivedSources.make:
 54
 55 Define JavaScriptCore_SCRIPTS_DIR explicitly so the rule for code generation and
 56 shared file lists are identical between JavaScriptCore and WebCore.
 57
 58 The output files additionally depend on all builtin generator script files
 59 and input files that are combined into the single header/implementation file.
 60
 61 * JavaScriptCore.xcodeproj/project.pbxproj:
 62
 63 Mark the new builtins generator files as private headers so we can use them from
 64 WebCore.
 65
 66 * Scripts/UpdateContents.py: Renamed from Source/JavaScriptCore/UpdateContents.py.
 67 * Scripts/builtins/__init__.py: Added.
 68 * Scripts/builtins/builtins.py: Added.
 69 * Scripts/builtins/builtins_generator.py: Added. This file contains the base generator.
 70 (WK_lcfirst):
 71 (WK_ucfirst):
 72 (BuiltinsGenerator):
 73 (BuiltinsGenerator.__init__):
 74 (BuiltinsGenerator.model):
 75 (BuiltinsGenerator.generate_license):
 76 (BuiltinsGenerator.generate_includes_from_entries):
 77 (BuiltinsGenerator.generate_output):
 78 (BuiltinsGenerator.output_filename):
 79 (BuiltinsGenerator.mangledNameForFunction):
 80 (BuiltinsGenerator.mangledNameForFunction.toCamel):
 81 (BuiltinsGenerator.generate_embedded_code_string_section_for_function):
 82 * Scripts/builtins/builtins_model.py: Added. This file contains builtins model objects.
 83 (ParseException):
 84 (Framework):
 85 (Framework.__init__):
 86 (Framework.setting):
 87 (Framework.fromString):
 88 (Frameworks):
 89 (BuiltinObject):
 90 (BuiltinObject.__init__):
 91 (BuiltinFunction):
 92 (BuiltinFunction.__init__):
 93 (BuiltinFunction.fromString):
 94 (BuiltinFunction.__str__):
 95 (BuiltinsCollection):
 96 (BuiltinsCollection.__init__):
 97 (BuiltinsCollection.parse_builtins_file):
 98 (BuiltinsCollection.copyrights):
 99 (BuiltinsCollection.all_functions):
 100 (BuiltinsCollection._parse_copyright_lines):
 101 (BuiltinsCollection._parse_functions):
 102 * Scripts/builtins/builtins_templates.py: Added.
 103 (BuiltinsGeneratorTemplates):
 104 * Scripts/builtins/builtins_generate_combined_header.py: Added.
 105 (BuiltinsCombinedHeaderGenerator):
 106 (BuiltinsCombinedHeaderGenerator.__init__):
 107 (BuiltinsCombinedHeaderGenerator.output_filename):
 108 (BuiltinsCombinedHeaderGenerator.generate_output):
 109 (BuiltinsCombinedHeaderGenerator.generate_forward_declarations):
 110 (FunctionExecutable):
 111 (VM):
 112 (ConstructAbility):
 113 (generate_section_for_object):
 114 (generate_externs_for_object):
 115 (generate_macros_for_object):
 116 (generate_defines_for_object):
 117 (generate_section_for_code_table_macro):
 118 (generate_section_for_code_name_macro):
 119 * Scripts/builtins/builtins_generate_combined_implementation.py: Added.
 120 (BuiltinsCombinedImplementationGenerator):
 121 (BuiltinsCombinedImplementationGenerator.__init__):
 122 (BuiltinsCombinedImplementationGenerator.output_filename):
 123 (BuiltinsCombinedImplementationGenerator.generate_output):
 124 (BuiltinsCombinedImplementationGenerator.generate_header_includes):
 125 * Scripts/builtins/builtins_generate_separate_header.py: Added.
 126 (BuiltinsSeparateHeaderGenerator):
 127 (BuiltinsSeparateHeaderGenerator.__init__):
 128 (BuiltinsSeparateHeaderGenerator.output_filename):
 129 (BuiltinsSeparateHeaderGenerator.macro_prefix):
 130 (BuiltinsSeparateHeaderGenerator.generate_output):
 131 (BuiltinsSeparateHeaderGenerator.generate_forward_declarations):
 132 (FunctionExecutable):
 133 (generate_header_includes):
 134 (generate_section_for_object):
 135 (generate_externs_for_object):
 136 (generate_macros_for_object):
 137 (generate_defines_for_object):
 138 (generate_section_for_code_table_macro):
 139 (generate_section_for_code_name_macro):
 140 * Scripts/builtins/builtins_generate_separate_implementation.py: Added.
 141 (BuiltinsSeparateImplementationGenerator):
 142 (BuiltinsSeparateImplementationGenerator.__init__):
 143 (BuiltinsSeparateImplementationGenerator.output_filename):
 144 (BuiltinsSeparateImplementationGenerator.macro_prefix):
 145 (BuiltinsSeparateImplementationGenerator.generate_output):
 146 (BuiltinsSeparateImplementationGenerator.generate_header_includes):
 147 * Scripts/builtins/builtins_generate_separate_wrapper.py: Added.
 148 (BuiltinsSeparateWrapperGenerator):
 149 (BuiltinsSeparateWrapperGenerator.__init__):
 150 (BuiltinsSeparateWrapperGenerator.output_filename):
 151 (BuiltinsSeparateWrapperGenerator.macro_prefix):
 152 (BuiltinsSeparateWrapperGenerator.generate_output):
 153 (BuiltinsSeparateWrapperGenerator.generate_header_includes):
 154 * Scripts/generate-js-builtins.py: Added.
 155
 156 Parse command line options, decide which generators and output modes to use.
 157
 158 (generate_bindings_for_builtins_files):
 159 * Scripts/lazywriter.py: Copied from the inspector protocol generator.
 160 (LazyFileWriter):
 161 (LazyFileWriter.__init__):
 162 (LazyFileWriter.write):
 163 (LazyFileWriter.close):
 164 * Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Combined.js: Added.
 165 * Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Separate.js: Added.
 166 * Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js: Added.
 167 * Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Separate.js: Added.
 168 * Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Combined.js: Added.
 169 * Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Separate.js: Added.
 170 * Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js: Added.
 171 * Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js: Added.
 172 * Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js: Added.
 173 * Scripts/tests/builtins/WebCore-xmlCasingTest-Separate.js: Added.
 174 * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result: Added.
 175 * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result: Added.
 176 * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result: Added.
 177 * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result: Added.
 178 * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result: Added.
 179 * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result: Added.
 180 * Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result: Added.
 181 * Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result: Added.
 182 * Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result: Added.
 183 * Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result: Added.
 184 * builtins/BuiltinExecutables.cpp:
 185 (JSC::BuiltinExecutables::BuiltinExecutables):
 186 * builtins/BuiltinExecutables.h:
 187 * create_hash_table:
 188
 189 Update the generated builtin macro names.
 190
 191 * generate-js-builtins: Removed.
 192
11932015-10-20 Michael Saboff <msaboff@apple.com>
2194
3195 REGRESSION (r191175): OSR Exit from an inlined tail callee trashes callee save registers

Source/WebCore/ChangeLog

 12015-10-20 Brian Burg <bburg@apple.com>
 2
 3 Restructure generate-js-bindings script to be modular and testable
 4 https://bugs.webkit.org/show_bug.cgi?id=149929
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * CMakeLists.txt:
 9
 10 Define JavaScriptCore_SCRIPTS_DIR explicitly so the add_custom_command and
 11 shared file lists are identical between JavaScriptCore and WebCore.
 12
 13 The output files additionally depend on all builtin generator script files.
 14
 15 * DerivedSources.make:
 16
 17 Use JavaScriptCore_SCRIPTS_DIR so that the rule for code generation and
 18 shared file lists are identical between JavaScriptCore and WebCore.
 19
 20 The output files additionally depend on all builtin generator script files.
 21
 22 * WebCore.xcodeproj/project.pbxproj:
 23
 24 Define JavaScriptCore_SCRIPTS_DIR before calling DerivedSources.make.
 25 This will eventually be merged with the other similar script paths.
 26
 27 * bindings/js/JSDOMWindowBase.cpp:
 28 (WebCore::JSDOMWindowBase::finishCreation):
 29
 30 Update the generated builtin macro names.
 31
 32 * generate-js-builtins: Removed.
 33
1342015-10-20 Chris Dumez <cdumez@apple.com>
235
336 Unreviewed, Another GTK build fix after r191351.

Source/JavaScriptCore/CMakeLists.txt

@@set(JavaScriptCore_LUT_FILES
700700 runtime/SymbolPrototype.cpp
701701)
702702
703 set(JavaScriptCore_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
704 
705703set(JavaScriptCore_LIBRARIES
706704 WTF${DEBUG_SUFFIX}
707705 ${ICU_I18N_LIBRARIES}
708706)
709707
 708set(JavaScriptCore_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
 709
 710# Globbing relies on the fact that generator-specific file names are prefixed with their directory.
 711# Top-level scripts should have a file extension, since they are invoked during the build.
 712
 713set(JavaScriptCore_SCRIPTS_PATHS
 714 ${JavaScriptCore_SCRIPTS_DIR}/*.pl
 715 ${JavaScriptCore_SCRIPTS_DIR}/*.py
 716 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins*.py
 717)
 718
 719# The directory flattening performed below mirrors what the Mac port does with private headers.
 720
 721file(GLOB JavaScriptCore_SCRIPTS ${JavaScriptCore_SCRIPTS_PATHS})
 722foreach (_script ${JavaScriptCore_SCRIPTS})
 723 file(COPY ${_script} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts)
 724endforeach ()
 725
710726if (USE_UDIS86)
711727 set(UDIS_GEN_DEP
712728 disassembler/udis86/ud_opcode.py

@@set(HASH_LUT_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/create_hash_table)
941957macro(GENERATE_HASH_LUT _input _output)
942958 add_custom_command(
943959 OUTPUT ${_output}
944  DEPENDS ${HASH_LUT_GENERATOR} ${_input} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins
 960 DEPENDS ${HASH_LUT_GENERATOR} ${_input} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
945961 COMMAND ${PERL_EXECUTABLE} ${HASH_LUT_GENERATOR} ${_input} -i > ${_output}
946962 VERBATIM)
947963 list(APPEND JavaScriptCore_HEADERS ${_output})

@@add_custom_command(
10801096 VERBATIM)
10811097
10821098# JSCBuiltins
 1099
 1100set(BUILTINS_GENERATOR_SCRIPTS
 1101 ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
 1102 ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
 1103 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins.py
 1104 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generator.py
 1105 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_model.py
 1106 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_templates.py
 1107 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_combined_header.py
 1108 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_combined_implementation.py
 1109 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_separate_header.py
 1110 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_separate_implementation.py
 1111 ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_separate_wrapper.py
 1112)
 1113
10831114set(JavaScriptCore_BUILTINS_SOURCES
10841115 ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
10851116 ${JAVASCRIPTCORE_DIR}/builtins/ArrayIterator.prototype.js

@@set(JavaScriptCore_BUILTINS_SOURCES
11021133)
11031134
11041135add_custom_command(
1105  OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
1106  MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins
1107  DEPENDS ${JavaScriptCore_BUILTINS_SOURCES}
1108  COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins --input-directory ${CMAKE_CURRENT_SOURCE_DIR}/builtins --output ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
 1136 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.cpp
 1137 ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/JSCBuiltins.h
 1138 MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
 1139 DEPENDS ${JavaScriptCore_BUILTINS_SOURCES} ${BUILTINS_GENERATOR_SCRIPTS}
 1140 COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework JavaScriptCore --output-directory ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR} --combined ${JavaScriptCore_BUILTINS_SOURCES}
11091141 VERBATIM)
11101142
11111143list(APPEND JavaScriptCore_SOURCES

Source/JavaScriptCore/DerivedSources.make

@@all : \
7171 udis86_itab.h \
7272 Bytecodes.h \
7373 InitBytecodes.asm \
74  JSCBuiltins \
 74 JSCBuiltins.h \
7575#
7676
77 # builtin functions
7877PYTHON = python
7978PERL = perl
8079

@@else
8786endif
8887# --------
8988
90 .PHONY: JSCBuiltins
91 JSCBuiltins: $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins JSCBuiltins.h JSCBuiltins.cpp
92 JSCBuiltins.h: $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins $(JavaScriptCore)/builtins JSCBuiltinsSources
93  $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins --input-directory $(JavaScriptCore)/builtins --output $@
94 
95 JSCBuiltins.cpp: JSCBuiltins.h
 89# JavaScript builtins.
 90
 91BUILTINS_GENERATOR_SCRIPTS = \
 92 $(JavaScriptCore_SCRIPTS_DIR)/builtins/__init__.py \
 93 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins.py \
 94 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generator.py \
 95 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_model.py \
 96 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_templates.py \
 97 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_combined_header.py \
 98 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_combined_implementation.py \
 99 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_separate_header.py \
 100 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_separate_implementation.py \
 101 $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_separate_wrapper.py \
 102 $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py \
 103 $(JavaScriptCore_SCRIPTS_DIR)/lazywriter.py \
 104#
96105
97 .PHONY: JSCBuiltinsSources
98 JSCBuiltinsSources: \
 106JavaScriptCore_BUILTINS_SOURCES = \
99107 $(JavaScriptCore)/builtins/ArrayConstructor.js \
100108 $(JavaScriptCore)/builtins/ArrayIterator.prototype.js \
101109 $(JavaScriptCore)/builtins/Array.prototype.js \

@@JSCBuiltinsSources: \
112120 $(JavaScriptCore)/builtins/ReflectObject.js \
113121 $(JavaScriptCore)/builtins/StringConstructor.js \
114122 $(JavaScriptCore)/builtins/StringIterator.prototype.js \
 123 $(JavaScriptCore)/builtins/TypedArrayConstructor.js \
 124 $(JavaScriptCore)/builtins/TypedArray.prototype.js \
115125#
116126
 127# The combined output file depends on the contents of builtins and generator scripts, so
 128# adding, modifying, or removing builtins or scripts will trigger regeneration of files.
 129
 130.PHONY: force
 131JavaScriptCore_BUILTINS_DEPENDENCIES_LIST : $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py force
 132 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py '$(JavaScriptCore_BUILTINS_SOURCES) $(BUILTINS_GENERATOR_SCRIPTS)' $@
 133
 134JSCBuiltins.h: $(BUILTINS_GENERATOR_SCRIPTS) $(JavaScriptCore_BUILTINS_SOURCES) JavaScriptCore_BUILTINS_DEPENDENCIES_LIST
 135 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py --combined --output-directory . --framework JavaScriptCore $(JavaScriptCore_BUILTINS_SOURCES)
 136
117137# lookup tables for classes
118138
119139%.lut.h: create_hash_table %.cpp

@@all : \
201221# adding, modifying, or removing domains will trigger regeneration of inspector files.
202222
203223.PHONY: force
204 EnabledInspectorDomains : $(JavaScriptCore)/UpdateContents.py force
205  $(PYTHON) $(JavaScriptCore)/UpdateContents.py '$(INSPECTOR_DOMAINS)' $@
 224EnabledInspectorDomains : $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py force
 225 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py '$(INSPECTOR_DOMAINS)' $@
206226
207227CombinedDomains.json : $(JavaScriptCore_SCRIPTS_DIR)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) EnabledInspectorDomains
208228 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) > ./CombinedDomains.json

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

12141214 9928FF3B18AC4AEC00B8CF12 /* JSReplayInputs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9928FF3918AC4AEC00B8CF12 /* JSReplayInputs.cpp */; };
12151215 9928FF3C18AC4AEC00B8CF12 /* JSReplayInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 9928FF3A18AC4AEC00B8CF12 /* JSReplayInputs.h */; settings = {ATTRIBUTES = (Private, ); }; };
12161216 9959E92B1BD17FA4001AA413 /* cssmin.py in Headers */ = {isa = PBXBuildFile; fileRef = 9959E9271BD17FA0001AA413 /* cssmin.py */; settings = {ATTRIBUTES = (Private, ); }; };
1217  9959E92C1BD17FA4001AA413 /* generate-js-builtins in Headers */ = {isa = PBXBuildFile; fileRef = 9959E9281BD17FA0001AA413 /* generate-js-builtins */; settings = {ATTRIBUTES = (Private, ); }; };
12181217 9959E92D1BD17FA4001AA413 /* jsmin.py in Headers */ = {isa = PBXBuildFile; fileRef = 9959E9291BD17FA0001AA413 /* jsmin.py */; settings = {ATTRIBUTES = (Private, ); }; };
12191218 9959E92E1BD17FA4001AA413 /* xxd.pl in Headers */ = {isa = PBXBuildFile; fileRef = 9959E92A1BD17FA0001AA413 /* xxd.pl */; settings = {ATTRIBUTES = (Private, ); }; };
12201219 9959E9311BD18272001AA413 /* generate-combined-inspector-json.py in Headers */ = {isa = PBXBuildFile; fileRef = 9959E92F1BD181F6001AA413 /* generate-combined-inspector-json.py */; settings = {ATTRIBUTES = (Private, ); }; };

12221221 996231E918D1804200C03FDA /* InspectorBackendCommands.js in Headers */ = {isa = PBXBuildFile; fileRef = A53243961856A475002ED692 /* InspectorBackendCommands.js */; settings = {ATTRIBUTES = (Private, ); }; };
12231222 99CC0B6218BE9946006CEBCC /* CodeGeneratorReplayInputsTemplates.py in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1E18A1B1E70026D88F /* CodeGeneratorReplayInputsTemplates.py */; settings = {ATTRIBUTES = (Private, ); }; };
12241223 99CC0B6318BE9950006CEBCC /* CodeGeneratorReplayInputs.py in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1D18A1B1E70026D88F /* CodeGeneratorReplayInputs.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1224 99DA00A31BD5993100F4575C /* builtins_generator.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009A1BD5992700F4575C /* builtins_generator.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1225 99DA00A41BD5993100F4575C /* builtins_model.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009B1BD5992700F4575C /* builtins_model.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1226 99DA00A51BD5993100F4575C /* builtins_templates.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009C1BD5992700F4575C /* builtins_templates.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1227 99DA00A61BD5993100F4575C /* builtins.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009D1BD5992700F4575C /* builtins.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1228 99DA00A71BD5993100F4575C /* builtins_generate_combined_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009E1BD5992700F4575C /* builtins_generate_combined_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1229 99DA00A81BD5993100F4575C /* builtins_generate_combined_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009F1BD5992700F4575C /* builtins_generate_combined_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1230 99DA00A91BD5993100F4575C /* builtins_generate_separate_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A01BD5992700F4575C /* builtins_generate_separate_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1231 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A11BD5992700F4575C /* builtins_generate_separate_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1232 99DA00AB1BD5993100F4575C /* builtins_generate_separate_wrapper.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A21BD5992700F4575C /* builtins_generate_separate_wrapper.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1233 99DA00AF1BD5994E00F4575C /* generate-js-builtins.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1234 99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AD1BD5993E00F4575C /* lazywriter.py */; settings = {ATTRIBUTES = (Private, ); }; };
 1235 99DA00B11BD5994E00F4575C /* UpdateContents.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AE1BD5993E00F4575C /* UpdateContents.py */; settings = {ATTRIBUTES = (Private, ); }; };
12251236 99E45A2418A1B2590026D88F /* EmptyInputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1F18A1B2590026D88F /* EmptyInputCursor.h */; settings = {ATTRIBUTES = (Private, ); }; };
12261237 99E45A2518A1B2590026D88F /* EncodedValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99E45A2018A1B2590026D88F /* EncodedValue.cpp */; };
12271238 99E45A2618A1B2590026D88F /* EncodedValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A2118A1B2590026D88F /* EncodedValue.h */; settings = {ATTRIBUTES = (Private, ); }; };

17941805 FE7C41961B97FC4B00F4D598 /* PingPongStackOverflowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */; };
17951806 FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
17961807 FEA08621182B7A0400F6D851 /* DebuggerPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861F182B7A0400F6D851 /* DebuggerPrimitives.h */; settings = {ATTRIBUTES = (Private, ); }; };
1797  FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */; settings = {ASSET_TAGS = (); }; };
 1808 FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB137561BB11EEE00CD5100 /* MacroAssemblerARM64.cpp */; };
17981809 FEB51F6C1A97B688001F921C /* Regress141809.mm in Sources */ = {isa = PBXBuildFile; fileRef = FEB51F6B1A97B688001F921C /* Regress141809.mm */; };
17991810 FEB58C14187B8B160098EF0B /* ErrorHandlingScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB58C12187B8B160098EF0B /* ErrorHandlingScope.cpp */; };
18001811 FEB58C15187B8B160098EF0B /* ErrorHandlingScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FEB58C13187B8B160098EF0B /* ErrorHandlingScope.h */; settings = {ATTRIBUTES = (Private, ); }; };

31183129 9928FF3A18AC4AEC00B8CF12 /* JSReplayInputs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReplayInputs.h; sourceTree = "<group>"; };
31193130 9928FF3D18AC4B1C00B8CF12 /* JSInputs.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = JSInputs.json; sourceTree = "<group>"; };
31203131 9959E9271BD17FA0001AA413 /* cssmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = cssmin.py; sourceTree = "<group>"; };
3121  9959E9281BD17FA0001AA413 /* generate-js-builtins */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-js-builtins"; sourceTree = "<group>"; };
31223132 9959E9291BD17FA0001AA413 /* jsmin.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = jsmin.py; sourceTree = "<group>"; };
31233133 9959E92A1BD17FA0001AA413 /* xxd.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = xxd.pl; sourceTree = "<group>"; };
31243134 9959E92F1BD181F6001AA413 /* generate-combined-inspector-json.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-combined-inspector-json.py"; sourceTree = "<group>"; };
31253135 9959E9301BD181F6001AA413 /* inline-and-minify-stylesheets-and-scripts.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "inline-and-minify-stylesheets-and-scripts.py"; sourceTree = "<group>"; };
 3136 99DA00991BD5992700F4575C /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = "<group>"; };
 3137 99DA009A1BD5992700F4575C /* builtins_generator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generator.py; sourceTree = "<group>"; };
 3138 99DA009B1BD5992700F4575C /* builtins_model.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_model.py; sourceTree = "<group>"; };
 3139 99DA009C1BD5992700F4575C /* builtins_templates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_templates.py; sourceTree = "<group>"; };
 3140 99DA009D1BD5992700F4575C /* builtins.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins.py; sourceTree = "<group>"; };
 3141 99DA009E1BD5992700F4575C /* builtins_generate_combined_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generate_combined_header.py; sourceTree = "<group>"; };
 3142 99DA009F1BD5992700F4575C /* builtins_generate_combined_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generate_combined_implementation.py; sourceTree = "<group>"; };
 3143 99DA00A01BD5992700F4575C /* builtins_generate_separate_header.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generate_separate_header.py; sourceTree = "<group>"; };
 3144 99DA00A11BD5992700F4575C /* builtins_generate_separate_implementation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generate_separate_implementation.py; sourceTree = "<group>"; };
 3145 99DA00A21BD5992700F4575C /* builtins_generate_separate_wrapper.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = builtins_generate_separate_wrapper.py; sourceTree = "<group>"; };
 3146 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-js-builtins.py"; sourceTree = "<group>"; };
 3147 99DA00AD1BD5993E00F4575C /* lazywriter.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = lazywriter.py; sourceTree = "<group>"; };
 3148 99DA00AE1BD5993E00F4575C /* UpdateContents.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = UpdateContents.py; sourceTree = "<group>"; };
31263149 99E45A1D18A1B1E70026D88F /* CodeGeneratorReplayInputs.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CodeGeneratorReplayInputs.py; sourceTree = "<group>"; };
31273150 99E45A1E18A1B1E70026D88F /* CodeGeneratorReplayInputsTemplates.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = CodeGeneratorReplayInputsTemplates.py; sourceTree = "<group>"; };
31283151 99E45A1F18A1B2590026D88F /* EmptyInputCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmptyInputCursor.h; sourceTree = "<group>"; };

38103833 034768DFFF38A50411DB9C8B /* Products */ = {
38113834 isa = PBXGroup;
38123835 children = (
 3836 0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */,
38133837 932F5BD90822A1C700736975 /* JavaScriptCore.framework */,
38143838 932F5BE10822A1C700736975 /* jsc */,
3815  0FF922CF14F46B130041A24E /* JSCLLIntOffsetsExtractor */,
38163839 0FCEFAB61805D61600472CE4 /* libllvmForJSC.dylib */,
38173840 141211200A48793C00480255 /* minidom */,
38183841 14BD59BF0A3E8F9000BAF59C /* testapi */,

57325755 9959E9251BD17F1E001AA413 /* Scripts */ = {
57335756 isa = PBXGroup;
57345757 children = (
5735  9959E9281BD17FA0001AA413 /* generate-js-builtins */,
 5758 99DA00971BD598E000F4575C /* builtins */,
57365759 9959E9271BD17FA0001AA413 /* cssmin.py */,
57375760 9959E92F1BD181F6001AA413 /* generate-combined-inspector-json.py */,
 5761 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */,
57385762 9959E9301BD181F6001AA413 /* inline-and-minify-stylesheets-and-scripts.py */,
57395763 9959E9291BD17FA0001AA413 /* jsmin.py */,
 5764 99DA00AD1BD5993E00F4575C /* lazywriter.py */,
 5765 99DA00AE1BD5993E00F4575C /* UpdateContents.py */,
57405766 9959E92A1BD17FA0001AA413 /* xxd.pl */,
57415767 );
57425768 path = Scripts;
57435769 sourceTree = "<group>";
57445770 };
 5771 99DA00971BD598E000F4575C /* builtins */ = {
 5772 isa = PBXGroup;
 5773 children = (
 5774 99DA00991BD5992700F4575C /* __init__.py */,
 5775 99DA009D1BD5992700F4575C /* builtins.py */,
 5776 99DA009E1BD5992700F4575C /* builtins_generate_combined_header.py */,
 5777 99DA009F1BD5992700F4575C /* builtins_generate_combined_implementation.py */,
 5778 99DA00A01BD5992700F4575C /* builtins_generate_separate_header.py */,
 5779 99DA00A11BD5992700F4575C /* builtins_generate_separate_implementation.py */,
 5780 99DA00A21BD5992700F4575C /* builtins_generate_separate_wrapper.py */,
 5781 99DA009A1BD5992700F4575C /* builtins_generator.py */,
 5782 99DA009B1BD5992700F4575C /* builtins_model.py */,
 5783 99DA009C1BD5992700F4575C /* builtins_templates.py */,
 5784 );
 5785 path = builtins;
 5786 sourceTree = "<group>";
 5787 };
57455788 99E45A0C18A01E930026D88F /* replay */ = {
57465789 isa = PBXGroup;
57475790 children = (

60376080 FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */,
60386081 A7D801A51880D66E0026C39B /* BuiltinExecutables.h in Headers */,
60396082 A75EE9B218AAB7E200AAD043 /* BuiltinNames.h in Headers */,
 6083 99DA00A61BD5993100F4575C /* builtins.py in Headers */,
 6084 99DA00A71BD5993100F4575C /* builtins_generate_combined_header.py in Headers */,
 6085 99DA00A81BD5993100F4575C /* builtins_generate_combined_implementation.py in Headers */,
 6086 99DA00A91BD5993100F4575C /* builtins_generate_separate_header.py in Headers */,
 6087 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */,
 6088 99DA00AB1BD5993100F4575C /* builtins_generate_separate_wrapper.py in Headers */,
 6089 99DA00A31BD5993100F4575C /* builtins_generator.py in Headers */,
 6090 99DA00A41BD5993100F4575C /* builtins_model.py in Headers */,
 6091 99DA00A51BD5993100F4575C /* builtins_templates.py in Headers */,
60406092 41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */,
60416093 9E72940B190F0514001A91B5 /* BundlePath.h in Headers */,
60426094 0FB7F39715ED8E4600F167B2 /* Butterfly.h in Headers */,

61046156 C2FC9BD316644DFB00810D33 /* CopiedBlockInlines.h in Headers */,
61056157 C2EAA3FA149A835E00FCE112 /* CopiedSpace.h in Headers */,
61066158 C2C8D02D14A3C6E000578E65 /* CopiedSpaceInlines.h in Headers */,
 6159 0F7C11AD1BC3862C00C74CDB /* CopyBarrier.h in Headers */,
61076160 0F5A52D017ADD717008ECB2D /* CopyToken.h in Headers */,
61086161 C2239D1816262BDD005AC5FD /* CopyVisitor.h in Headers */,
61096162 C2239D1916262BDD005AC5FD /* CopyVisitorInlines.h in Headers */,

61746227 0F38B01A17CFE75500B144D3 /* DFGCompilationMode.h in Headers */,
61756228 0F3B3A1B153E68F4003ED0FF /* DFGConstantFoldingPhase.h in Headers */,
61766229 0FED67BA1B26256D0066CE15 /* DFGConstantHoistingPhase.h in Headers */,
 6230 0F0981F81BC5E565004814F8 /* DFGCopyBarrierOptimizationPhase.h in Headers */,
61776231 0FBE0F7316C1DB050082C5E8 /* DFGCPSRethreadingPhase.h in Headers */,
61786232 A7D89CF617A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.h in Headers */,
61796233 0FFFC95A14EF90A900C72532 /* DFGCSEPhase.h in Headers */,

64106464 A54E8EB118BFFBBE00556D28 /* GCSegmentedArrayInlines.h in Headers */,
64116465 9959E9311BD18272001AA413 /* generate-combined-inspector-json.py in Headers */,
64126466 C4703CC0192844960013FBEA /* generate-inspector-protocol-bindings.py in Headers */,
6413  9959E92C1BD17FA4001AA413 /* generate-js-builtins in Headers */,
 6467 99DA00AF1BD5994E00F4575C /* generate-js-builtins.py in Headers */,
64146468 A5EA70EC19F5B3EA0098F5EC /* generate_cpp_alternate_backend_dispatcher_header.py in Headers */,
64156469 A5EF9B141A1D43F600702E90 /* generate_cpp_backend_dispatcher_header.py in Headers */,
64166470 A5EF9B151A1D43FA00702E90 /* generate_cpp_backend_dispatcher_implementation.py in Headers */,

65426596 0F766D2C15A8CC3A008F363E /* JITStubRoutineSet.h in Headers */,
65436597 0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */,
65446598 0FC712E317CD8793008CC93C /* JITToDFGDeferredCompilationCallback.h in Headers */,
6545  0F0981F81BC5E565004814F8 /* DFGCopyBarrierOptimizationPhase.h in Headers */,
65466599 A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
65476600 840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
65486601 C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */,

66016654 797E07AA1B8FCFB9008400BA /* JSGlobalLexicalEnvironment.h in Headers */,
66026655 BC18C4210E16F5CD00B34460 /* JSGlobalObject.h in Headers */,
66036656 A5FD0086189B1B7E00633231 /* JSGlobalObjectConsoleAgent.h in Headers */,
6604  534C457C1BC72411007476A7 /* JSTypedArrayViewConstructor.h in Headers */,
66056657 A5C3A1A618C0490200C9593A /* JSGlobalObjectConsoleClient.h in Headers */,
66066658 A59455931824744700CC3843 /* JSGlobalObjectDebuggable.h in Headers */,
66076659 A57D23EA1891B0770031C7FA /* JSGlobalObjectDebuggerAgent.h in Headers */,

66706722 0F2B66FB17B6B5AB00A7AE3F /* JSTypedArrayConstructors.h in Headers */,
66716723 0F2B66FD17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.h in Headers */,
66726724 0F2B66FF17B6B5AB00A7AE3F /* JSTypedArrays.h in Headers */,
 6725 534C457C1BC72411007476A7 /* JSTypedArrayViewConstructor.h in Headers */,
66736726 DEA7E2451BBC677F00D78440 /* JSTypedArrayViewPrototype.h in Headers */,
66746727 6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */,
66756728 0F2B670217B6B5AB00A7AE3F /* JSUint16Array.h in Headers */,

66946747 969A072A0ED1CE6900F1F681 /* Label.h in Headers */,
66956748 960097A60EBABB58007A7297 /* LabelScope.h in Headers */,
66966749 0FB5467714F59B5C002C2989 /* LazyOperandValueProfile.h in Headers */,
 6750 99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */,
66976751 BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */,
66986752 BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
66996753 BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,

67906844 868916B0155F286300CB2B9A /* PrivateName.h in Headers */,
67916845 BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
67926846 95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */,
6793  0F7C11AD1BC3862C00C74CDB /* CopyBarrier.h in Headers */,
67946847 BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */,
67956848 0FF729A5166AD351000F5BA3 /* ProfilerBytecode.h in Headers */,
67966849 0FF729B9166AD360000F5BA3 /* ProfilerBytecodes.h in Headers */,

69497002 A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */,
69507003 14142E511B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h in Headers */,
69517004 0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
 7005 99DA00B11BD5994E00F4575C /* UpdateContents.py in Headers */,
69527006 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
69537007 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
69547008 79EE0C001B4AFB85000385C9 /* VariableEnvironment.h in Headers */,

74887542 0F63945415D07055006A597C /* ArrayProfile.cpp in Sources */,
74897543 147F39C0107EC37600427A48 /* ArrayPrototype.cpp in Sources */,
74907544 0F24E54017EA9F5900ABB217 /* AssemblyHelpers.cpp in Sources */,
7491  FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */,
74927545 52678F8E1A031009006A306D /* BasicBlockLocation.cpp in Sources */,
74937546 0F64B2711A784BAF006E4E66 /* BinarySwitch.cpp in Sources */,
74947547 14280863107EC11A0013E7B2 /* BooleanConstructor.cpp in Sources */,

75207573 A77F1821164088B200640A47 /* CodeCache.cpp in Sources */,
75217574 0F8F9446166764F100D61971 /* CodeOrigin.cpp in Sources */,
75227575 86B5826714D2796C00A9C306 /* CodeProfile.cpp in Sources */,
7523  DE5A0A001BA3AC3E003D4424 /* IntrinsicEmitter.cpp in Sources */,
75247576 86B5826914D2797000A9C306 /* CodeProfiling.cpp in Sources */,
75257577 0F8F943C1667631300D61971 /* CodeSpecializationKind.cpp in Sources */,
75267578 0F8F94421667633500D61971 /* CodeType.cpp in Sources */,

75387590 1428082E107EC0570013E7B2 /* ConstructData.cpp in Sources */,
75397591 A57D23F11891B5B40031C7FA /* ContentSearchUtilities.cpp in Sources */,
75407592 52B717B51A0597E1007AF4F3 /* ControlFlowProfiler.cpp in Sources */,
 7593 0FBADF541BD1F4B800E073C1 /* CopiedBlock.cpp in Sources */,
75417594 C240305514B404E60079EB64 /* CopiedSpace.cpp in Sources */,
75427595 C2239D1716262BDD005AC5FD /* CopyVisitor.cpp in Sources */,
75437596 2A111245192FCE79005EE18D /* CustomGetterSetter.cpp in Sources */,

75847637 0F38B01917CFE75500B144D3 /* DFGCompilationMode.cpp in Sources */,
75857638 0F3B3A1A153E68F2003ED0FF /* DFGConstantFoldingPhase.cpp in Sources */,
75867639 0FED67B91B26256D0066CE15 /* DFGConstantHoistingPhase.cpp in Sources */,
 7640 0F0981F71BC5E565004814F8 /* DFGCopyBarrierOptimizationPhase.cpp in Sources */,
75877641 0FBE0F7216C1DB030082C5E8 /* DFGCPSRethreadingPhase.cpp in Sources */,
75887642 A7D89CF517A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */,
75897643 0FFFC95914EF90A600C72532 /* DFGCSEPhase.cpp in Sources */,

78247878 A1D792FE1B43864B004516F5 /* IntlNumberFormatConstructor.cpp in Sources */,
78257879 A1D793001B43864B004516F5 /* IntlNumberFormatPrototype.cpp in Sources */,
78267880 A12BBFF41B044A9800664B69 /* IntlObject.cpp in Sources */,
 7881 DE5A0A001BA3AC3E003D4424 /* IntrinsicEmitter.cpp in Sources */,
78277882 70113D4B1A8DB093003848C4 /* IteratorOperations.cpp in Sources */,
78287883 70DC3E091B2DF2C700054299 /* IteratorPrototype.cpp in Sources */,
78297884 A503FA19188E0FB000110F14 /* JavaScriptCallFrame.cpp in Sources */,

78417896 0F24E54C17EE274900ABB217 /* JITOperations.cpp in Sources */,
78427897 86CC85C40EE7A89400288682 /* JITPropertyAccess.cpp in Sources */,
78437898 A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */,
7844  0FBADF541BD1F4B800E073C1 /* CopiedBlock.cpp in Sources */,
78457899 0F766D2815A8CC1E008F363E /* JITStubRoutine.cpp in Sources */,
78467900 0F766D2B15A8CC38008F363E /* JITStubRoutineSet.cpp in Sources */,
78477901 0F5EF91E16878F7A003E5C25 /* JITThunks.cpp in Sources */,

79347988 0F2B66FA17B6B5AB00A7AE3F /* JSTypedArrayConstructors.cpp in Sources */,
79357989 0F2B66FC17B6B5AB00A7AE3F /* JSTypedArrayPrototypes.cpp in Sources */,
79367990 0F2B66FE17B6B5AB00A7AE3F /* JSTypedArrays.cpp in Sources */,
 7991 534C457E1BC72549007476A7 /* JSTypedArrayViewConstructor.cpp in Sources */,
79377992 DEA7E2441BBC677200D78440 /* JSTypedArrayViewPrototype.cpp in Sources */,
79387993 86E3C61A167BABEE006D760A /* JSValue.mm in Sources */,
79397994 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */,

79658020 14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
79668021 0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
79678022 86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
 8023 FEB137571BB11EF900CD5100 /* MacroAssemblerARM64.cpp in Sources */,
79688024 A729009C17976C6000317298 /* MacroAssemblerARMv7.cpp in Sources */,
79698025 FE68C6381B90DE0B0042BCB3 /* MacroAssemblerPrinter.cpp in Sources */,
79708026 A7A4AE0817973B26005612B1 /* MacroAssemblerX86Common.cpp in Sources */,

80448100 6540C7A01B82E1C3000F6B79 /* RegisterAtOffset.cpp in Sources */,
80458101 6540C7A11B82E1C3000F6B79 /* RegisterAtOffsetList.cpp in Sources */,
80468102 0FC3141518146D7000033232 /* RegisterSet.cpp in Sources */,
8047  534C457E1BC72549007476A7 /* JSTypedArrayViewConstructor.cpp in Sources */,
80488103 A57D23ED1891B5540031C7FA /* RegularExpression.cpp in Sources */,
80498104 A5BA15E9182340B300A82E69 /* RemoteInspector.mm in Sources */,
80508105 A594558F18245EFD00CC3843 /* RemoteInspectorDebuggable.cpp in Sources */,

81458200 709FB86B1AE335C60039D069 /* WeakSetPrototype.cpp in Sources */,
81468201 2A4EC90B1860D6C20094F782 /* WriteBarrierBuffer.cpp in Sources */,
81478202 0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
8148  0F0981F71BC5E565004814F8 /* DFGCopyBarrierOptimizationPhase.cpp in Sources */,
81498203 A7E5AB3A1799E4B200D2833D /* X86Disassembler.cpp in Sources */,
81508204 863C6D9C1521111A00585E4E /* YarrCanonicalizeUCS2.cpp in Sources */,
81518205 86704B8412DBA33700A9FE7B /* YarrInterpreter.cpp in Sources */,

Source/JavaScriptCore/PlatformWin.cmake

@@file(COPY
3030
3131file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore)
3232
33 file(GLOB _JavaScriptCore_Scripts "${JavaScriptCore_SCRIPTS_DIR}/*")
34 foreach (_script ${_JavaScriptCore_Scripts})
35  file(COPY ${_script} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts)
36 endforeach()
37 
3833set(JavaScriptCore_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/JavaScriptCore/postBuild.cmd")
3934file(WRITE "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
4035file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${DERIVED_SOURCES_DIR}/JavaScriptCore/inspector/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
41 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${JavaScriptCore_SCRIPTS_DIR}/*.*\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts\" >nul 2>nul\n")
 36foreach (_script ${JavaScriptCore_SCRIPTS})
 37 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /f \"${_script}\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts\" >nul 2>nul\n")
 38endforeach ()
4239foreach (_directory ${JavaScriptCore_FORWARDING_HEADERS_DIRECTORIES})
4340 file(APPEND "${JavaScriptCore_POST_BUILD_COMMAND}" "@xcopy /y /d /f \"${JAVASCRIPTCORE_DIR}/${_directory}/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore\" >nul 2>nul\n")
4441endforeach ()

Source/JavaScriptCore/Scripts/UpdateContents.py

 1#!/usr/bin/python
 2
 3# Copyright (C) 2015 Apple Inc. All rights reserved.
 4#
 5# Redistribution and use in source and binary forms, with or without
 6# modification, are permitted provided that the following conditions
 7# are met:
 8#
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14# 3. Neither the name of Apple, Inc. ("Apple") nor the names of
 15# its contributors may be used to endorse or promote products derived
 16# from this software without specific prior written permission.
 17#
 18# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
 19# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 22# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 23# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 24# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 25# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28
 29import sys
 30import os
 31
 32assert(len(sys.argv) == 3)
 33
 34comp = sys.argv[1]
 35filename = sys.argv[2]
 36
 37t = False
 38
 39if os.path.isfile(filename):
 40 f = open(filename, 'r')
 41 comparator = f.read()
 42 f.close()
 43 t = True
 44
 45if (not t or comp != comparator):
 46 f = open(filename, 'w')
 47 f.write(comp)
 48 f.close()

Source/JavaScriptCore/Scripts/builtins/__init__.py

 1# Required for Python to search this directory for module files
 2
 3from builtins import *

Source/JavaScriptCore/Scripts/builtins/builtins.py

 1# This file is used to simulate the builtins/ directory when generate-js-builtins.py
 2# is run from JavaScriptCore framework's private headers directory, which is flattened.
 3
 4from builtins_model import *
 5from builtins_templates import *
 6
 7from builtins_generator import *
 8from builtins_generate_combined_header import *
 9from builtins_generate_combined_implementation import *
 10from builtins_generate_separate_header import *
 11from builtins_generate_separate_implementation import *
 12from builtins_generate_separate_wrapper import *

Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_header.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27
 28import logging
 29import re
 30import string
 31from string import Template
 32
 33from builtins_generator import BuiltinsGenerator
 34from builtins_templates import BuiltinsGeneratorTemplates as Templates
 35
 36log = logging.getLogger('global')
 37
 38
 39class BuiltinsCombinedHeaderGenerator(BuiltinsGenerator):
 40 def __init__(self, model):
 41 BuiltinsGenerator.__init__(self, model)
 42
 43 def output_filename(self):
 44 return "%sBuiltins.h" % self.model().framework.setting('namespace')
 45
 46 def generate_output(self):
 47 args = {
 48 'namespace': self.model().framework.setting('namespace'),
 49 'headerGuard': self.output_filename().replace('.', '_'),
 50 'macroPrefix': self.model().framework.setting('macro_prefix'),
 51 }
 52
 53 sections = []
 54 sections.append(self.generate_license())
 55 sections.append(Template(Templates.DoNotEditWarning).substitute(args))
 56 sections.append(Template(Templates.HeaderIncludeGuardTop).substitute(args))
 57 sections.append(self.generate_forward_declarations())
 58 sections.append(Template(Templates.NamespaceTop).substitute(args))
 59 for object in self.model().objects:
 60 sections.append(self.generate_section_for_object(object))
 61 sections.append(self.generate_section_for_code_table_macro())
 62 sections.append(self.generate_section_for_code_name_macro())
 63 sections.append(Template(Templates.CombinedHeaderStaticMacros).substitute(args))
 64 sections.append(Template(Templates.NamespaceBottom).substitute(args))
 65 sections.append(Template(Templates.HeaderIncludeGuardBottom).substitute(args))
 66
 67 return "\n\n".join(sections)
 68
 69 def generate_forward_declarations(self):
 70 return """namespace JSC {
 71class FunctionExecutable;
 72class VM;
 73
 74enum class ConstructAbility : unsigned;
 75}"""
 76
 77 def generate_section_for_object(self, object):
 78 lines = []
 79 lines.append('/* %s */' % object.object_name)
 80 lines.extend(self.generate_externs_for_object(object))
 81 lines.append("")
 82 lines.extend(self.generate_macros_for_object(object))
 83 lines.append("")
 84 lines.extend(self.generate_defines_for_object(object))
 85 return '\n'.join(lines)
 86
 87 def generate_externs_for_object(self, object):
 88 lines = []
 89
 90 for function in object.functions:
 91 function_args = {
 92 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
 93 }
 94
 95 lines.append("""extern const char* s_%(codeName)s;
 96extern const int s_%(codeName)sLength;
 97extern const JSC::ConstructAbility s_%(codeName)sConstructAbility;""" % function_args)
 98
 99 return lines
 100
 101 def generate_macros_for_object(self, object):
 102 args = {
 103 'macroPrefix': self.model().framework.setting('macro_prefix'),
 104 'objectMacro': object.object_name.replace('.', '').upper(),
 105 }
 106
 107 lines = []
 108 lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_DATA(macro) \\" % args)
 109 for function in object.functions:
 110 function_args = {
 111 'funcName': function.function_name,
 112 'mangledName': BuiltinsGenerator.mangledNameForFunction(function),
 113 'paramCount': len(function.parameters),
 114 }
 115
 116 lines.append(" macro(%(funcName)s, %(mangledName)s, %(paramCount)d) \\" % function_args)
 117 return lines
 118
 119 def generate_defines_for_object(self, object):
 120 lines = []
 121 for function in object.functions:
 122 args = {
 123 'macroPrefix': self.model().framework.setting('macro_prefix'),
 124 'objectMacro': object.object_name.replace('.', '').upper(),
 125 'functionMacro': function.function_name.upper(),
 126 }
 127 lines.append("#define %(macroPrefix)s_BUILTIN_%(objectMacro)s_%(functionMacro)s 1" % args)
 128
 129 return lines
 130
 131 def generate_section_for_code_table_macro(self):
 132 args = {
 133 'macroPrefix': self.model().framework.setting('macro_prefix'),
 134 }
 135
 136 lines = []
 137 lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_CODE(macro) \\" % args)
 138 for function in self.model().all_functions():
 139 function_args = {
 140 'funcName': function.function_name,
 141 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
 142 }
 143
 144 lines.append(" macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args)
 145 return '\n'.join(lines)
 146
 147 def generate_section_for_code_name_macro(self):
 148 args = {
 149 'macroPrefix': self.model().framework.setting('macro_prefix'),
 150 }
 151
 152 lines = []
 153 lines.append("#define %(macroPrefix)s_FOREACH_BUILTIN_FUNCTION_NAME(macro) \\" % args)
 154 unique_names = list(set([function.function_name for function in self.model().all_functions()]))
 155 unique_names.sort()
 156 for function_name in unique_names:
 157 function_args = {
 158 'funcName': function_name,
 159 }
 160
 161 lines.append(" macro(%(funcName)s) \\" % function_args)
 162 return '\n'.join(lines)

Source/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27
 28import logging
 29import re
 30import string
 31from string import Template
 32
 33from builtins_generator import BuiltinsGenerator
 34from builtins_model import Framework, Frameworks
 35from builtins_templates import BuiltinsGeneratorTemplates as Templates
 36
 37log = logging.getLogger('global')
 38
 39
 40class BuiltinsCombinedImplementationGenerator(BuiltinsGenerator):
 41 def __init__(self, model):
 42 BuiltinsGenerator.__init__(self, model)
 43
 44 def output_filename(self):
 45 return "%sBuiltins.cpp" % self.model().framework.setting('namespace')
 46
 47 def generate_output(self):
 48 args = {
 49 'namespace': self.model().framework.setting('namespace'),
 50 'macroPrefix': self.model().framework.setting('macro_prefix'),
 51 }
 52
 53 sections = []
 54 sections.append(self.generate_license())
 55 sections.append(Template(Templates.DoNotEditWarning).substitute(args))
 56 sections.append(self.generate_header_includes())
 57 sections.append(Template(Templates.NamespaceTop).substitute(args))
 58 for function in self.model().all_functions():
 59 sections.append(self.generate_embedded_code_string_section_for_function(function))
 60 if self.model().framework is Frameworks.JavaScriptCore:
 61 sections.append(Template(Templates.CombinedJSCImplementationStaticMacros).substitute(args))
 62 elif self.model().framework is Frameworks.WebCore:
 63 sections.append(Template(Templates.CombinedWebCoreImplementationStaticMacros).substitute(args))
 64 sections.append(Template(Templates.NamespaceBottom).substitute(args))
 65
 66 return "\n\n".join(sections)
 67
 68 def generate_header_includes(self):
 69 header_includes = [
 70 (["JavaScriptCore"],
 71 ("JavaScriptCore", "builtins/BuiltinExecutables.h"),
 72 ),
 73 (["JavaScriptCore", "WebCore"],
 74 ("JavaScriptCore", "runtime/Executable.h"),
 75 ),
 76 (["JavaScriptCore", "WebCore"],
 77 ("JavaScriptCore", "runtime/JSCellInlines.h"),
 78 ),
 79 (["WebCore"],
 80 ("JavaScriptCore", "runtime/StructureInlines.h"),
 81 ),
 82 (["WebCore"],
 83 ("JavaScriptCore", "runtime/JSCJSValueInlines.h"),
 84 ),
 85 (["JavaScriptCore", "WebCore"],
 86 ("JavaScriptCore", "runtime/VM.h"),
 87 ),
 88 ]
 89
 90 return '\n'.join(self.generate_includes_from_entries(header_includes))

Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_header.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27
 28import logging
 29import re
 30import string
 31from string import Template
 32
 33from builtins_generator import BuiltinsGenerator
 34from builtins_templates import BuiltinsGeneratorTemplates as Templates
 35
 36log = logging.getLogger('global')
 37
 38
 39class BuiltinsSeparateHeaderGenerator(BuiltinsGenerator):
 40 def __init__(self, model, object):
 41 BuiltinsGenerator.__init__(self, model)
 42 self.object = object
 43
 44 def output_filename(self):
 45 return "%sBuiltins.h" % BuiltinsGenerator.mangledNameForObject(self.object)
 46
 47 def macro_prefix(self):
 48 return self.model().framework.setting('macro_prefix')
 49
 50 def generate_output(self):
 51 args = {
 52 'namespace': self.model().framework.setting('namespace'),
 53 'headerGuard': self.output_filename().replace('.', '_'),
 54 'macroPrefix': self.macro_prefix(),
 55 'objectName': self.object.object_name.upper(),
 56 }
 57
 58 sections = []
 59 sections.append(self.generate_license())
 60 sections.append(Template(Templates.DoNotEditWarning).substitute(args))
 61 sections.append(Template(Templates.HeaderIncludeGuardTop).substitute(args))
 62 sections.append(self.generate_header_includes())
 63 sections.append(self.generate_forward_declarations())
 64 sections.append(Template(Templates.NamespaceTop).substitute(args))
 65 sections.append(self.generate_section_for_object(self.object))
 66 sections.append(self.generate_section_for_code_table_macro())
 67 sections.append(self.generate_section_for_code_name_macro())
 68 sections.append(Template(Templates.SeparateHeaderStaticMacros).substitute(args))
 69 sections.append(Template(Templates.NamespaceBottom).substitute(args))
 70 sections.append(Template(Templates.HeaderIncludeGuardBottom).substitute(args))
 71
 72 return "\n\n".join(sections)
 73
 74 def generate_forward_declarations(self):
 75 return """namespace JSC {
 76class FunctionExecutable;
 77}"""
 78
 79 def generate_header_includes(self):
 80 header_includes = [
 81 (["WebCore"],
 82 ("JavaScriptCore", "builtins/BuiltinUtils.h"),
 83 ),
 84 ]
 85
 86 return '\n'.join(self.generate_includes_from_entries(header_includes))
 87
 88 def generate_section_for_object(self, object):
 89 lines = []
 90 lines.append('/* %s */' % object.object_name)
 91 lines.extend(self.generate_externs_for_object(object))
 92 lines.append("")
 93 lines.extend(self.generate_macros_for_object(object))
 94 lines.append("")
 95 lines.extend(self.generate_defines_for_object(object))
 96 return '\n'.join(lines)
 97
 98 def generate_externs_for_object(self, object):
 99 lines = []
 100
 101 for function in object.functions:
 102 function_args = {
 103 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
 104 }
 105
 106 lines.append("""extern const char* s_%(codeName)s;
 107extern const int s_%(codeName)sLength;
 108extern const JSC::ConstructAbility s_%(codeName)sConstructAbility;""" % function_args)
 109
 110 return lines
 111
 112 def generate_macros_for_object(self, object):
 113 args = {
 114 'macroPrefix': self.macro_prefix(),
 115 'objectMacro': object.object_name.replace('.', '_').upper(),
 116 }
 117
 118 lines = []
 119 lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_DATA(macro) \\" % args)
 120 for function in object.functions:
 121 function_args = {
 122 'funcName': function.function_name,
 123 'mangledName': BuiltinsGenerator.mangledNameForFunction(function),
 124 'paramCount': len(function.parameters),
 125 }
 126
 127 lines.append(" macro(%(funcName)s, %(mangledName)s, %(paramCount)d) \\" % function_args)
 128 return lines
 129
 130 def generate_defines_for_object(self, object):
 131 lines = []
 132 for function in object.functions:
 133 args = {
 134 'macroPrefix': self.macro_prefix(),
 135 'objectMacro': object.object_name.replace('.', '_').upper(),
 136 'functionMacro': function.function_name.upper(),
 137 }
 138 lines.append("#define %(macroPrefix)s_BUILTIN_%(objectMacro)s_%(functionMacro)s 1" % args)
 139
 140 return lines
 141
 142 def generate_section_for_code_table_macro(self):
 143 args = {
 144 'macroPrefix': self.model().framework.setting('macro_prefix'),
 145 'objectMacro': self.object.object_name.upper(),
 146 }
 147
 148 lines = []
 149 lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_CODE(macro) \\" % args)
 150 for function in self.object.functions:
 151 function_args = {
 152 'funcName': function.function_name,
 153 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
 154 }
 155
 156 lines.append(" macro(%(codeName)s, %(funcName)s, s_%(codeName)sLength) \\" % function_args)
 157 return '\n'.join(lines)
 158
 159 def generate_section_for_code_name_macro(self):
 160 args = {
 161 'macroPrefix': self.macro_prefix(),
 162 'objectMacro': self.object.object_name.upper(),
 163 }
 164
 165 lines = []
 166 lines.append("#define %(macroPrefix)s_FOREACH_%(objectMacro)s_BUILTIN_FUNCTION_NAME(macro) \\" % args)
 167 unique_names = list(set([function.function_name for function in self.object.functions]))
 168 unique_names.sort()
 169 for function_name in unique_names:
 170 function_args = {
 171 'funcName': function_name,
 172 }
 173
 174 lines.append(" macro(%(funcName)s) \\" % function_args)
 175 return '\n'.join(lines)

Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_implementation.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27
 28import logging
 29import re
 30import string
 31from string import Template
 32
 33from builtins_generator import BuiltinsGenerator, WK_lcfirst
 34from builtins_model import Framework, Frameworks
 35from builtins_templates import BuiltinsGeneratorTemplates as Templates
 36
 37log = logging.getLogger('global')
 38
 39
 40class BuiltinsSeparateImplementationGenerator(BuiltinsGenerator):
 41 def __init__(self, model, object):
 42 BuiltinsGenerator.__init__(self, model)
 43 self.object = object
 44
 45 def output_filename(self):
 46 return "%sBuiltins.cpp" % BuiltinsGenerator.mangledNameForObject(self.object)
 47
 48 def macro_prefix(self):
 49 return self.model().framework.setting('macro_prefix')
 50
 51 def generate_output(self):
 52 args = {
 53 'namespace': self.model().framework.setting('namespace'),
 54 'macroPrefix': self.macro_prefix(),
 55 'objectMacro': self.object.object_name.upper(),
 56 'objectNameLC': WK_lcfirst(self.object.object_name),
 57 }
 58
 59 sections = []
 60 sections.append(self.generate_license())
 61 sections.append(Template(Templates.DoNotEditWarning).substitute(args))
 62 sections.append(self.generate_header_includes())
 63 sections.append(Template(Templates.NamespaceTop).substitute(args))
 64 for function in self.object.functions:
 65 sections.append(self.generate_embedded_code_string_section_for_function(function))
 66 if self.model().framework is Frameworks.JavaScriptCore:
 67 sections.append(Template(Templates.SeparateJSCImplementationStaticMacros).substitute(args))
 68 elif self.model().framework is Frameworks.WebCore:
 69 sections.append(Template(Templates.SeparateWebCoreImplementationStaticMacros).substitute(args))
 70 sections.append(Template(Templates.NamespaceBottom).substitute(args))
 71
 72 return "\n\n".join(sections)
 73
 74 def generate_header_includes(self):
 75 header_includes = [
 76 (["JavaScriptCore"],
 77 ("JavaScriptCore", "builtins/BuiltinExecutables.h"),
 78 ),
 79 (["JavaScriptCore", "WebCore"],
 80 ("JavaScriptCore", "runtime/Executable.h"),
 81 ),
 82 (["JavaScriptCore", "WebCore"],
 83 ("JavaScriptCore", "runtime/JSCellInlines.h"),
 84 ),
 85 (["WebCore"],
 86 ("JavaScriptCore", "runtime/StructureInlines.h"),
 87 ),
 88 (["WebCore"],
 89 ("JavaScriptCore", "runtime/JSCJSValueInlines.h"),
 90 ),
 91 (["JavaScriptCore", "WebCore"],
 92 ("JavaScriptCore", "runtime/VM.h"),
 93 ),
 94 (["WebCore"],
 95 ("WebCore", "bindings/js/WebCoreJSClientData.h"),
 96 ),
 97 ]
 98
 99 return '\n'.join(self.generate_includes_from_entries(header_includes))

Source/JavaScriptCore/Scripts/builtins/builtins_generate_separate_wrapper.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27
 28import logging
 29import re
 30import string
 31from string import Template
 32
 33from builtins_generator import BuiltinsGenerator
 34from builtins_templates import BuiltinsGeneratorTemplates as Templates
 35
 36log = logging.getLogger('global')
 37
 38
 39class BuiltinsSeparateWrapperGenerator(BuiltinsGenerator):
 40 def __init__(self, model, object):
 41 BuiltinsGenerator.__init__(self, model)
 42 self.object = object
 43
 44 def output_filename(self):
 45 return "%sBuiltinsWrapper.h" % BuiltinsGenerator.mangledNameForObject(self.object)
 46
 47 def macro_prefix(self):
 48 return self.model().framework.setting('macro_prefix')
 49
 50 def generate_output(self):
 51 args = {
 52 'namespace': self.model().framework.setting('namespace'),
 53 'headerGuard': self.output_filename().replace('.', '_'),
 54 'macroPrefix': self.macro_prefix(),
 55 'objectName': self.object.object_name,
 56 'objectMacro': self.object.object_name.upper(),
 57 }
 58
 59 sections = []
 60 sections.append(self.generate_license())
 61 sections.append(Template(Templates.DoNotEditWarning).substitute(args))
 62 sections.append(Template(Templates.HeaderIncludeGuardTop).substitute(args))
 63 sections.append(self.generate_header_includes())
 64 sections.append(Template(Templates.NamespaceTop).substitute(args))
 65 sections.append(Template(Templates.SeparateWrapperHeaderBoilerplate).substitute(args))
 66 sections.append(Template(Templates.NamespaceBottom).substitute(args))
 67 sections.append(Template(Templates.HeaderIncludeGuardBottom).substitute(args))
 68
 69 return "\n\n".join(sections)
 70
 71 def generate_header_includes(self):
 72 header_includes = [
 73 (["WebCore"],
 74 ("WebCore", "%sBuiltins.h" % self.object.object_name),
 75 ),
 76
 77 (["WebCore"],
 78 ("JavaScriptCore", "bytecode/UnlinkedFunctionExecutable.h"),
 79 ),
 80
 81 (["WebCore"],
 82 ("JavaScriptCore", "builtins/BuiltinUtils.h"),
 83 ),
 84
 85 (["WebCore"],
 86 ("JavaScriptCore", "runtime/Identifier.h"),
 87 ),
 88
 89 (["WebCore"],
 90 ("JavaScriptCore", "runtime/JSFunction.h"),
 91 ),
 92 ]
 93
 94 return '\n'.join(self.generate_includes_from_entries(header_includes))

Source/JavaScriptCore/Scripts/builtins/builtins_generator.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27import logging
 28import os.path
 29import re
 30from string import Template
 31import json
 32
 33from builtins_model import BuiltinFunction, BuiltinObject
 34from builtins_templates import BuiltinsGeneratorTemplates as Templates
 35
 36log = logging.getLogger('global')
 37
 38# These match WK_lcfirst and WK_ucfirst defined in CodeGenerator.pm.
 39def WK_lcfirst(str):
 40 str = str[:1].lower() + str[1:]
 41 str = str.replace('hTML', 'html')
 42 str = str.replace('uRL', 'url')
 43 str = str.replace('jS', 'js')
 44 str = str.replace('xML', 'xml')
 45 str = str.replace('xSLT', 'xslt')
 46 str = str.replace('cSS', 'css')
 47 return str
 48
 49def WK_ucfirst(str):
 50 str = str[:1].upper() + str[1:]
 51 str = str.replace('Xml', 'XML')
 52 str = str.replace('Svg', 'SVG')
 53 return str
 54
 55class BuiltinsGenerator:
 56 def __init__(self, model):
 57 self._model = model
 58
 59 def model(self):
 60 return self._model
 61
 62 # These methods are overridden by subclasses.
 63
 64 def generate_output(self):
 65 pass
 66
 67 def output_filename(self):
 68 pass
 69
 70
 71 # Shared code generation methods.
 72 def generate_license(self):
 73 raw_license = Template(Templates.LicenseText).substitute(None)
 74 copyrights = self._model.copyrights()
 75 copyrights.sort()
 76
 77 license_block = []
 78 license_block.append("/*")
 79 for copyright in copyrights:
 80 license_block.append(" * Copyright (c) %s" % copyright)
 81 if len(copyrights) > 0:
 82 license_block.append(" * ")
 83
 84 for line in raw_license.split('\n'):
 85 license_block.append(" * " + line)
 86
 87 license_block.append(" */")
 88
 89 return '\n'.join(license_block)
 90
 91 def generate_includes_from_entries(self, entries):
 92 includes = set()
 93 for entry in entries:
 94 (allowed_framework_names, data) = entry
 95 (framework_name, header_path) = data
 96
 97 if self.model().framework.name not in allowed_framework_names:
 98 continue
 99 if self.model().framework.name != framework_name:
 100 includes.add("#include <%s>" % header_path)
 101 else:
 102 includes.add("#include \"%s\"" % os.path.basename(header_path))
 103
 104 sorted_includes = sorted(list(includes))
 105 # Always include config.h and the counterpart header before other headers.
 106 name, ext = os.path.splitext(self.output_filename())
 107 if ext != '.h':
 108 sorted_includes[:0] = [
 109 "#include \"config.h\"",
 110 "#include \"%s.h\"" % name,
 111 "",
 112 ]
 113
 114 return sorted_includes
 115
 116 def generate_embedded_code_string_section_for_function(self, function):
 117 text = function.function_source
 118 # Wrap it in parens to avoid adding to global scope.
 119 text = "(function " + text[text.index("("):] + ")"
 120 embeddedSourceLength = len(text) + 1 # For extra \n.
 121 # Lazy way to escape quotes, I think?
 122 textLines = json.dumps(text)[1:-1].split("\\n")
 123 # This looks scary because we need the JS source itself to have newlines.
 124 embeddedSource = '\n'.join([' "%s\\n" \\' % line for line in textLines])
 125
 126 constructAbility = "CannotConstruct"
 127 if function.is_constructor:
 128 constructAbility = "CanConstruct"
 129
 130 args = {
 131 'codeName': BuiltinsGenerator.mangledNameForFunction(function) + 'Code',
 132 'embeddedSource': embeddedSource,
 133 'embeddedSourceLength': embeddedSourceLength,
 134 'canConstruct': constructAbility
 135 }
 136
 137 lines = []
 138 lines.append("const JSC::ConstructAbility s_%(codeName)sConstructAbility = JSC::ConstructAbility::%(canConstruct)s;" % args);
 139 lines.append("const int s_%(codeName)sLength = %(embeddedSourceLength)d;" % args);
 140 lines.append("const char* s_%(codeName)s =\n%(embeddedSource)s\n;" % args);
 141 return '\n'.join(lines)
 142
 143 # Helper methods.
 144
 145 @staticmethod
 146 def mangledNameForObject(object):
 147 if not isinstance(object, BuiltinObject):
 148 raise Exception("Invalid argument passed to mangledNameForObject()")
 149
 150 def toCamel(match):
 151 str = match.group(0)
 152 return str[1].upper()
 153 return re.sub(r'\.[a-z]', toCamel, object.object_name, flags=re.IGNORECASE)
 154
 155
 156 @staticmethod
 157 def mangledNameForFunction(function):
 158 if not isinstance(function, BuiltinFunction):
 159 raise Exception("Invalid argument passed to mangledNameForFunction()")
 160
 161 function_name = WK_ucfirst(function.function_name)
 162
 163 def toCamel(match):
 164 str = match.group(0)
 165 return str[1].upper()
 166 function_name = re.sub(r'\.[a-z]', toCamel, function_name, flags=re.IGNORECASE)
 167 if function.is_constructor:
 168 function_name = function_name + "Constructor"
 169
 170 object_name = BuiltinsGenerator.mangledNameForObject(function.object)
 171 return WK_lcfirst(object_name + function_name)

Source/JavaScriptCore/Scripts/builtins/builtins_model.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2015 Apple Inc. All rights reserved.
 4#
 5# Redistribution and use in source and binary forms, with or without
 6# modification, are permitted provided that the following conditions
 7# are met:
 8# 1. Redistributions of source code must retain the above copyright
 9# notice, this list of conditions and the following disclaimer.
 10# 2. Redistributions in binary form must reproduce the above copyright
 11# notice, this list of conditions and the following disclaimer in the
 12# documentation and/or other materials provided with the distribution.
 13#
 14# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24# THE POSSIBILITY OF SUCH DAMAGE.
 25
 26import logging
 27import re
 28import os
 29
 30log = logging.getLogger('global')
 31
 32_FRAMEWORK_CONFIG_MAP = {
 33 "JavaScriptCore": {
 34 "macro_prefix": "JSC",
 35 "namespace": "JSC",
 36 },
 37 "WebCore": {
 38 "macro_prefix": "WEBCORE",
 39 "namespace": "WebCore",
 40 },
 41}
 42
 43functionHeadRegExp = re.compile(r"(?:function|constructor)\s+\w+\s*\(.*?\)", re.MULTILINE | re.S)
 44functionNameRegExp = re.compile(r"(?:function|constructor)\s+(\w+)\s*\(", re.MULTILINE | re.S)
 45functionIsConstructorRegExp = re.compile(r"^constructor", re.MULTILINE | re.S)
 46functionParameterFinder = re.compile(r"^(?:function|constructor)\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.S)
 47
 48multilineCommentRegExp = re.compile(r"\/\*.*?\*\/", re.MULTILINE | re.S)
 49singleLineCommentRegExp = re.compile(r"\/\/.*?\n", re.MULTILINE | re.S)
 50
 51
 52class ParseException(Exception):
 53 pass
 54
 55
 56class Framework:
 57 def __init__(self, name):
 58 self._settings = _FRAMEWORK_CONFIG_MAP[name]
 59 self.name = name
 60
 61 def setting(self, key, default=''):
 62 return self._settings.get(key, default)
 63
 64 @staticmethod
 65 def fromString(frameworkString):
 66 if frameworkString == "JavaScriptCore":
 67 return Frameworks.JavaScriptCore
 68
 69 if frameworkString == "WebCore":
 70 return Frameworks.WebCore
 71
 72 raise ParseException("Unknown framework: %s" % frameworkString)
 73
 74
 75class Frameworks:
 76 JavaScriptCore = Framework("JavaScriptCore")
 77 WebCore = Framework("WebCore")
 78
 79
 80class BuiltinObject:
 81 def __init__(self, object_name, functions):
 82 self.object_name = object_name
 83 self.functions = functions
 84 self.collection = None # Set by the owning BuiltinsCollection
 85
 86 for function in self.functions:
 87 function.object = self
 88
 89
 90class BuiltinFunction:
 91 def __init__(self, function_name, function_source, is_constructor, parameters):
 92 self.function_name = function_name
 93 self.function_source = function_source
 94 self.is_constructor = is_constructor
 95 self.parameters = parameters
 96 self.object = None # Set by the owning BuiltinObject
 97
 98 @staticmethod
 99 def fromString(function_string):
 100 function_source = multilineCommentRegExp.sub("", function_string)
 101 function_name = functionNameRegExp.findall(function_source)[0]
 102 is_constructor = functionIsConstructorRegExp.match(function_source) != None
 103 parameters = [s.strip() for s in functionParameterFinder.findall(function_source)[0].split(',')]
 104 if len(parameters[0]) == 0:
 105 parameters = []
 106
 107 return BuiltinFunction(function_name, function_source, is_constructor, parameters)
 108
 109 def __str__(self):
 110 interface = "%s(%s)" % (self.function_name, ', '.join(self.parameters))
 111 if self.is_constructor:
 112 interface = interface + " [Constructor]"
 113
 114 return interface
 115
 116
 117class BuiltinsCollection:
 118 def __init__(self, framework_name):
 119 self._copyright_lines = set()
 120 self.objects = []
 121 self.framework = Framework.fromString(framework_name)
 122 log.debug("Created new Builtins collection.")
 123
 124 def parse_builtins_file(self, filename, text):
 125 log.debug("Parsing builtins file: %s" % filename)
 126
 127 parsed_copyrights = set(self._parse_copyright_lines(text))
 128 self._copyright_lines = self._copyright_lines.union(parsed_copyrights)
 129
 130 log.debug("Found copyright lines:")
 131 for line in self._copyright_lines:
 132 log.debug(line)
 133 log.debug("")
 134
 135 object_name, ext = os.path.splitext(os.path.basename(filename))
 136 log.debug("Parsing object: %s" % object_name)
 137
 138 parsed_functions = self._parse_functions(text)
 139 for function in parsed_functions:
 140 function.object = object_name
 141
 142 log.debug("Parsed functions:")
 143 for func in parsed_functions:
 144 log.debug(func)
 145 log.debug("")
 146
 147 new_object = BuiltinObject(object_name, parsed_functions)
 148 new_object.collection = self
 149 self.objects.append(new_object)
 150
 151 def copyrights(self):
 152 owner_to_years = dict()
 153 copyrightYearRegExp = re.compile(r"(\d{4})[, ]{0,2}")
 154 ownerStartRegExp = re.compile(r"[^\d, ]")
 155
 156 # Returns deduplicated copyrights keyed on the owner.
 157 for line in self._copyright_lines:
 158 years = set(copyrightYearRegExp.findall(line))
 159 ownerIndex = ownerStartRegExp.search(line).start()
 160 owner = line[ownerIndex:]
 161 log.debug("Found years: %s and owner: %s" % (years, owner))
 162 if owner not in owner_to_years:
 163 owner_to_years[owner] = set()
 164
 165 owner_to_years[owner] = owner_to_years[owner].union(years)
 166
 167 result = []
 168
 169 for owner, years in owner_to_years.items():
 170 sorted_years = list(years)
 171 sorted_years.sort()
 172 result.append("%s %s" % (', '.join(sorted_years), owner))
 173
 174 return result
 175
 176 def all_functions(self):
 177 result = []
 178 for object in self.objects:
 179 result.extend(object.functions)
 180
 181 result.sort()
 182 return result
 183
 184 # Private methods.
 185
 186 def _parse_copyright_lines(self, text):
 187 licenseBlock = multilineCommentRegExp.findall(text)[0]
 188 licenseBlock = licenseBlock[:licenseBlock.index("Redistribution")]
 189
 190 copyrightLines = []
 191 for line in licenseBlock.split("\n"):
 192 line = line.replace("/*", "")
 193 line = line.replace("*/", "")
 194 line = line.replace("*", "")
 195 line = line.replace("Copyright", "")
 196 line = line.replace("copyright", "")
 197 line = line.replace("(C)", "")
 198 line = line.replace("(c)", "")
 199 line = line.strip()
 200
 201 if len(line) == 0:
 202 continue
 203
 204 copyrightLines.append(line)
 205
 206 return copyrightLines
 207
 208 def _parse_functions(self, text):
 209 text = multilineCommentRegExp.sub("/**/", singleLineCommentRegExp.sub("//\n", text))
 210
 211 matches = [func for func in functionHeadRegExp.finditer(text)]
 212 functionBounds = []
 213 start = 0
 214 end = 0
 215 for match in matches:
 216 start = match.start()
 217 if start < end:
 218 continue
 219 end = match.end()
 220 while text[end] != '{':
 221 end = end + 1
 222 depth = 1
 223 end = end + 1
 224 while depth > 0:
 225 if text[end] == '{':
 226 depth = depth + 1
 227 elif text[end] == '}':
 228 depth = depth - 1
 229 end = end + 1
 230 functionBounds.append((start, end))
 231
 232 functionStrings = [text[start:end].strip() for (start, end) in functionBounds]
 233 return map(BuiltinFunction.fromString, functionStrings)

Source/JavaScriptCore/Scripts/builtins/builtins_templates.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (C) 2015 Canon Inc. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27# Builtins generator templates, which can be filled with string.Template.
 28
 29
 30class BuiltinsGeneratorTemplates:
 31
 32 LicenseText = (
 33 """Redistribution and use in source and binary forms, with or without
 34modification, are permitted provided that the following conditions
 35are met:
 361. Redistributions of source code must retain the above copyright
 37 notice, this list of conditions and the following disclaimer.
 382. Redistributions in binary form must reproduce the above copyright
 39 notice, this list of conditions and the following disclaimer in the
 40 documentation and/or other materials provided with the distribution.
 41
 42THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 43AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 44THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 45PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 46BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 47CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 48SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 49INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 50CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 51ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 52THE POSSIBILITY OF SUCH DAMAGE.
 53""")
 54
 55 DoNotEditWarning = (
 56 """// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 57// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py""")
 58
 59 HeaderIncludeGuardTop = (
 60 """#ifndef ${headerGuard}
 61#define ${headerGuard}""")
 62
 63 HeaderIncludeGuardBottom = (
 64 """#endif // ${headerGuard}
 65""")
 66
 67 NamespaceTop = (
 68 """namespace ${namespace} {""")
 69
 70 NamespaceBottom = (
 71 """} // namespace ${namespace}""")
 72
 73 CombinedHeaderStaticMacros = (
 74 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 75 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 76
 77${macroPrefix}_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 78#undef DECLARE_BUILTIN_GENERATOR
 79
 80#define ${macroPrefix}_BUILTIN_EXISTS(object, func) defined ${macroPrefix}_BUILTIN_ ## object ## _ ## func""")
 81
 82 SeparateHeaderStaticMacros = (
 83 """#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 84 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 85
 86${macroPrefix}_FOREACH_${objectName}_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 87#undef DECLARE_BUILTIN_GENERATOR
 88
 89#define ${macroPrefix}_BUILTIN_${objectName}_EXISTS(object, func) defined ${macroPrefix}_BUILTIN_ ## object ## _ ## func""")
 90
 91 CombinedJSCImplementationStaticMacros = (
 92 """
 93#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 94JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 95{\\
 96 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); \
 97}
 98${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 99#undef DEFINE_BUILTIN_GENERATOR
 100""")
 101
 102 SeparateJSCImplementationStaticMacros = (
 103 """
 104#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 105JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 106{\\
 107 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); \
 108}
 109${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 110#undef DEFINE_BUILTIN_GENERATOR
 111""")
 112
 113 CombinedWebCoreImplementationStaticMacros = (
 114 """
 115#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 116JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 117{\\
 118 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\
 119 return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source()); \\
 120}
 121${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 122#undef DEFINE_BUILTIN_GENERATOR
 123""")
 124
 125 SeparateWebCoreImplementationStaticMacros = (
 126 """
 127#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 128JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 129{\\
 130 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\
 131 return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source()); \\
 132}
 133${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 134#undef DEFINE_BUILTIN_GENERATOR
 135""")
 136
 137 SeparateWrapperHeaderBoilerplate = (
 138 """class ${objectName}BuiltinsWrapper : private JSC::WeakHandleOwner {
 139public:
 140 explicit ${objectName}BuiltinsWrapper(JSC::VM* vm)
 141 : m_vm(*vm)
 142 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
 143#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
 144 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 145#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 146 {
 147 }
 148
 149#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \\
 150 JSC::UnlinkedFunctionExecutable* name##Executable(); \\
 151 const JSC::SourceCode& name##Source() const { return m_##name##Source; }
 152 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
 153#undef EXPOSE_BUILTIN_EXECUTABLES
 154
 155 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
 156
 157 void exportNames();
 158
 159private:
 160 JSC::VM& m_vm;
 161
 162 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
 163
 164#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \\
 165 JSC::SourceCode m_##name##Source;\\
 166 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
 167 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
 168#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 169
 170};
 171
 172#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \\
 173inline JSC::UnlinkedFunctionExecutable* ${objectName}BuiltinsWrapper::name##Executable() \\
 174{\\
 175 if (!m_##name##Executable)\\
 176 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\\
 177 return m_##name##Executable.get();\\
 178}
 179${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
 180#undef DEFINE_BUILTIN_EXECUTABLES
 181
 182inline void ${objectName}BuiltinsWrapper::exportNames()
 183{
 184#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
 185 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
 186#undef EXPORT_FUNCTION_NAME
 187}
 188
 189class ${objectName}BuiltinFunctions {
 190public:
 191 explicit ${objectName}BuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
 192
 193 void init(JSC::JSGlobalObject&);
 194 void visit(JSC::SlotVisitor&);
 195
 196public:
 197 JSC::VM& m_vm;
 198
 199#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \\
 200 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
 201 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
 202#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 203};
 204
 205inline void ${objectName}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
 206{
 207#define EXPORT_FUNCTION(codeName, functionName, length)\\
 208 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
 209 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(EXPORT_FUNCTION)
 210#undef EXPORT_FUNCTION
 211}
 212
 213inline void ${objectName}BuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 214{
 215#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
 216 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
 217#undef VISIT_FUNCTION
 218}
 219""")

Source/JavaScriptCore/Scripts/generate-js-builtins

1 #!/usr/bin/python
2 # Copyright (C) 2014 Apple Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # 1. Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 import argparse
26 import filecmp
27 import fnmatch
28 import os
29 import re
30 import shutil
31 import sys
32 import datetime
33 import json
34 
35 parser = argparse.ArgumentParser()
36 parser.add_argument('input_file', nargs='*', help='Input JS files which builtins generated from')
37 parser.add_argument('--input-directory', help='All JS files will be used as input from this directory.')
38 parser.add_argument('--output', help='path to output cpp or h file')
39 parser.add_argument('--prefix', default='JSC', help='prefix used for public macros')
40 parser.add_argument('--namespace', default='JSC', help='C++ namespace')
41 args = parser.parse_args()
42 
43 copyrightText = """ *
44  * Redistribution and use in source and binary forms, with or without
45  * modification, are permitted provided that the following conditions
46  * are met:
47  * 1. Redistributions of source code must retain the above copyright
48  * notice, this list of conditions and the following disclaimer.
49  * 2. Redistributions in binary form must reproduce the above copyright
50  * notice, this list of conditions and the following disclaimer in the
51  * documentation and/or other materials provided with the distribution.
52  *
53  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
54  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
57  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
58  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
59  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
60  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
61  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
62  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
63  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64  */\n
65 """
66 
67 generatorString = "/* Generated by %s do not hand edit. */\n" % os.path.basename(__file__)
68 
69 functionHeadRegExp = re.compile(r"(?:function|constructor)\s+\w+\s*\(.*?\)", re.MULTILINE | re.S)
70 functionNameRegExp = re.compile(r"(?:function|constructor)\s+(\w+)\s*\(", re.MULTILINE | re.S)
71 functionIsConstructorRegExp = re.compile(r"^constructor", re.MULTILINE | re.S)
72 functionParameterFinder = re.compile(r"^(?:function|constructor)\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.S)
73 
74 multilineCommentRegExp = re.compile(r"\/\*.*?\*\/", re.MULTILINE | re.S)
75 singleLineCommentRegExp = re.compile(r"\/\/.*?\n", re.MULTILINE | re.S)
76 
77 def getCopyright(source):
78  copyrightBlock = multilineCommentRegExp.findall(source)[0]
79  copyrightBlock = copyrightBlock[:copyrightBlock.index("Redistribution")]
80  copyRightLines = []
81 
82  for line in copyrightBlock.split("\n"):
83  line = line.replace("/*", "")
84  line = line.replace("*/", "")
85  line = line.replace("*", "")
86  line = line.replace("Copyright", "")
87  line = line.replace("copyright", "")
88  line = line.replace("(C)", "")
89  line = line.replace("(c)", "")
90  line = line.strip()
91  if len(line) == 0:
92  continue
93 
94  copyRightLines.append(line)
95 
96  return list(set(copyRightLines))
97 
98 class Function(object):
99  def __init__(self, name, source, isConstructor, parameters):
100  self.name = name
101  self.source = source
102  self.isConstructor = isConstructor
103  self.parameters = parameters
104 
105  def mangleName(self, object):
106  qName = object + "." + self.name
107  mangledName = ""
108  i = 0
109  while i < len(qName):
110  if qName[i] == '.':
111  mangledName = mangledName + qName[i + 1].upper()
112  i = i + 1
113  else:
114  mangledName = mangledName + qName[i]
115  i = i + 1
116  if self.isConstructor:
117  mangledName = mangledName + "Constructor"
118  return mangledName
119 
120 def getFunctions(source):
121 
122  source = multilineCommentRegExp.sub("/**/", singleLineCommentRegExp.sub("//\n", source))
123 
124  matches = [ f for f in functionHeadRegExp.finditer(source)]
125  functionBounds = []
126  start = 0
127  end = 0
128  for match in matches:
129  start = match.start()
130  if start < end:
131  continue
132  end = match.end()
133  while source[end] != '{':
134  end = end + 1
135  depth = 1
136  end = end + 1
137  while depth > 0:
138  if source[end] == '{':
139  depth = depth + 1
140  elif source[end] == '}':
141  depth = depth - 1
142  end = end + 1
143  functionBounds.append((start, end))
144 
145  functions = [source[start:end].strip() for (start, end) in functionBounds]
146  result = []
147  for function in functions:
148  function = multilineCommentRegExp.sub("", function)
149  functionName = functionNameRegExp.findall(function)[0]
150  functionIsConstructor = functionIsConstructorRegExp.match(function) != None
151  functionParameters = functionParameterFinder.findall(function)[0].split(',')
152  if len(functionParameters[0]) == 0:
153  functionParameters = []
154 
155  result.append(Function(functionName, function, functionIsConstructor, functionParameters))
156  return result
157 
158 def writeIncludeDirectives(writer, headerNames):
159  for headerName in headerNames:
160  writer.write("#include " + headerName + "\n")
161 
162 def generateCode(source):
163  inputFile = open(source, "r")
164  baseName = os.path.basename(source).replace(".js", "")
165 
166  source = ""
167  for line in inputFile:
168  source = source + line
169 
170  if sys.platform == "cygwin":
171  source = source.replace("\r\n", "\n")
172  return (baseName, getFunctions(source), getCopyright(source))
173 
174 builtins = []
175 copyrights = []
176 (output_base, _) = os.path.splitext(args.output)
177 
178 if args.input_directory:
179  for file in os.listdir(args.input_directory):
180  args.input_file.append(os.path.join(args.input_directory, file))
181 
182 for file in args.input_file:
183  if fnmatch.fnmatch(file, '*.js'):
184  (baseName, functions, objectCopyrights) = generateCode(file)
185  copyrights.extend(objectCopyrights)
186  builtins.append((baseName, functions))
187 namespace = args.namespace
188 macroPrefix = args.prefix
189 scopeName = os.path.splitext(os.path.basename(args.output))[0]
190 includeGuard = scopeName + "_H"
191 headerName = scopeName + ".h"
192 
193 headerIncludes = ["\"BuiltinUtils.h\""] if namespace == "JSC" else ["<builtins/BuiltinUtils.h>"]
194 contentIncludes = ["\"BuiltinExecutables.h\"", "\"Executable.h\"", "\"JSCellInlines.h\"", "\"VM.h\""] if namespace == "JSC" else ["<runtime/Executable.h>", "<runtime/StructureInlines.h>", "<runtime/JSCJSValueInlines.h>", "<runtime/JSCellInlines.h>", "<runtime/VM.h>", "\"WebCoreJSClientData.h\""]
195 
196 copyrights = list(set(copyrights))
197 
198 copyrightBody = ""
199 for copyright in copyrights:
200  copyrightBody = copyrightBody +" * Copyright (C) " + copyright + "\n"
201 
202 builtinsHeader = open(output_base + ".h.tmp", "w")
203 builtinsImplementation = open(output_base + ".cpp.tmp", "w")
204 copyrightText = "/*\n" + copyrightBody + copyrightText
205 builtinsHeader.write("""%s
206 %s
207 
208 #ifndef %s
209 #define %s
210 
211 """ % (generatorString, copyrightText, includeGuard, includeGuard))
212 
213 writeIncludeDirectives(builtinsHeader, headerIncludes)
214 
215 builtinsHeader.write("""
216 namespace JSC {
217  class FunctionExecutable;
218 }
219 
220 namespace %s {
221 
222 """ % namespace)
223 
224 codeReferences = []
225 
226 for (objectName, functions) in builtins:
227  print("Generating bindings for the %s builtin." % objectName)
228  builtinsHeader.write("/* %s functions */\n" % objectName)
229  for function in functions:
230  name = function.name
231  mangledName = function.mangleName(objectName)
232  mangledName = mangledName[0].lower() + mangledName[1:] + "Code"
233  codeReferences.append((mangledName, function))
234  builtinsHeader.write("extern const char* s_%s;\n" % mangledName)
235  builtinsHeader.write("extern const int s_%sLength;\n" % mangledName)
236  builtinsHeader.write("extern const JSC::ConstructAbility s_%sConstructAbility;\n" % mangledName)
237  builtinsHeader.write("\n")
238  builtinsHeader.write("#define %s_FOREACH_%s_BUILTIN(macro) \\\n" % (macroPrefix, objectName.replace(".", "_").upper()))
239  for function in functions:
240  mangledName = function.mangleName(objectName)
241  builtinsHeader.write(" macro(%s, %s, %d) \\\n" % (function.name, mangledName, len(function.parameters)))
242  builtinsHeader.write("\n")
243  for function in functions:
244  builtinsHeader.write("#define %s_BUILTIN_%s 1\n" % (macroPrefix, function.mangleName(objectName).upper()))
245  builtinsHeader.write("\n\n")
246 names = []
247 builtinsHeader.write("#define %s_FOREACH_BUILTIN(macro)\\\n" % macroPrefix)
248 for (codeReference, function) in codeReferences:
249  builtinsHeader.write(" macro(%s, %s, s_%sLength) \\\n" % (codeReference, function.name, codeReference))
250  names.append(function.name)
251 
252 builtinsHeader.write("\n\n")
253 builtinsHeader.write("#define %s_FOREACH_BUILTIN_FUNCTION_NAME(macro) \\\n" % macroPrefix)
254 for name in sorted(set(names)):
255  builtinsHeader.write(" macro(%s) \\\n" % name)
256 builtinsHeader.write("""
257 
258 #define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
259  JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
260 
261 %s_FOREACH_BUILTIN(DECLARE_BUILTIN_GENERATOR)
262 #undef DECLARE_BUILTIN_GENERATOR
263 
264 #define %s_BUILTIN_EXISTS(name) defined %s_BUILTIN_ ## name
265 
266 }
267 
268 #endif // %s
269 
270 """ % (macroPrefix, macroPrefix, macroPrefix, includeGuard))
271 
272 builtinsImplementation.write("""%s
273 %s
274 
275 #include "config.h"
276 
277 #include "%s"
278 
279 """ % (generatorString, copyrightText, headerName))
280 
281 writeIncludeDirectives(builtinsImplementation, contentIncludes)
282 
283 builtinsImplementation.write("""
284 namespace %s {
285 
286 """ % (namespace))
287 
288 
289 
290 for (codeReference, function) in codeReferences:
291  source = function.source
292  source = "(function " + source[source.index("("):] + ")"
293  lines = json.dumps(source)[1:-1].split("\\n")
294  sourceLength = len(source)
295  source = ""
296  for line in lines:
297  source = source + (" \"%s\\n\" \\\n" % line)
298  builtinsImplementation.write("const char* s_%s =\n%s;\n\n" % (codeReference, source))
299  builtinsImplementation.write("const int s_%sLength = %d;\n\n" % (codeReference, sourceLength + 1)) # + 1 for \n
300  constructAbility = "JSC::ConstructAbility::CannotConstruct"
301  if function.isConstructor:
302  constructAbility = "JSC::ConstructAbility::CanConstruct"
303  builtinsImplementation.write("const JSC::ConstructAbility s_%sConstructAbility = %s;\n\n" % (codeReference, constructAbility)) # + 1 for \n
304 
305 builtinsImplementation.write("""
306 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
307 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
308 """);
309 
310 if (namespace == "JSC"):
311  builtinsImplementation.write("""{\\
312  return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); \\
313 """)
314 else:
315  builtinName = scopeName[0].lower() + scopeName[1:]
316  builtinsImplementation.write("""{\\
317  JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\
318  return clientData->builtinFunctions().%s().codeName##Executable()->link(vm, clientData->builtinFunctions().%s().codeName##Source()); \\
319 """% (builtinName, builtinName))
320 
321 builtinsImplementation.write("""}
322 %s_FOREACH_BUILTIN(DEFINE_BUILTIN_GENERATOR)
323 #undef DEFINE_BUILTIN_GENERATOR
324 }
325 
326 """% (macroPrefix))
327 
328 builtinsHeader.close()
329 builtinsImplementation.close()
330 
331 if (not os.path.exists(output_base + ".h")) or (not filecmp.cmp(output_base + ".h.tmp", output_base + ".h", shallow=False)):
332  if (os.path.exists(output_base + ".h")):
333  os.remove(output_base + ".h")
334  os.rename(output_base + ".h.tmp", output_base + ".h")
335 else:
336  os.remove(output_base + ".h.tmp")
337 
338 if (not os.path.exists(output_base + ".cpp")) or (not filecmp.cmp(output_base + ".cpp.tmp", output_base + ".cpp", shallow=False)):
339  if (os.path.exists(output_base + ".cpp")):
340  os.remove(output_base + ".cpp")
341  os.rename(output_base + ".cpp.tmp", output_base + ".cpp")
342 else:
343  os.remove(output_base + ".cpp.tmp")

Source/JavaScriptCore/Scripts/generate-js-builtins.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2014 University of Washington. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27# This script generates C++ bindings for JavaScript builtins.
 28# Generators for individual files are located in the builtins/ directory.
 29
 30import fnmatch
 31import logging
 32import optparse
 33import os
 34
 35logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
 36log = logging.getLogger('global')
 37
 38from lazywriter import LazyFileWriter
 39
 40import builtins
 41from builtins import *
 42
 43
 44def generate_bindings_for_builtins_files(builtins_files=[],
 45 output_path=None,
 46 concatenate_output=False,
 47 combined_output=False,
 48 framework_name="",
 49 force_output=False):
 50
 51 generators = []
 52
 53 model = BuiltinsCollection(framework_name=framework_name)
 54
 55 for filepath in builtins_files:
 56 with open(filepath, "r") as file:
 57 file_text = file.read()
 58 file_name = os.path.basename(filepath)
 59
 60 # If this is a test file, then rewrite the filename to remove the
 61 # test running options encoded into the filename.
 62 if file_name.startswith(framework_name):
 63 (_, object_name, _) = file_name.split('-')
 64 file_name = object_name + '.js'
 65 model.parse_builtins_file(file_name, file_text)
 66
 67 if combined_output:
 68 log.debug("Using generator style: combined files for all builtins.")
 69 generators.append(BuiltinsCombinedHeaderGenerator(model))
 70 generators.append(BuiltinsCombinedImplementationGenerator(model))
 71 else:
 72 log.debug("Using generator style: single files for each builtin.")
 73 for object in model.objects:
 74 generators.append(BuiltinsSeparateHeaderGenerator(model, object))
 75 generators.append(BuiltinsSeparateImplementationGenerator(model, object))
 76
 77 if model.framework is Frameworks.WebCore:
 78 generators.append(BuiltinsSeparateWrapperGenerator(model, object))
 79
 80 log.debug("")
 81 log.debug("Generating bindings for builtins.")
 82
 83 test_result_file_contents = []
 84
 85 for generator in generators:
 86 output_filepath = os.path.join(output_path, generator.output_filename())
 87 log.debug("Generating output file: %s" % generator.output_filename())
 88 output = generator.generate_output()
 89
 90 log.debug("---")
 91 log.debug("\n" + output)
 92 log.debug("---")
 93 if concatenate_output:
 94 test_result_file_contents.append('### Begin File: %s' % generator.output_filename())
 95 test_result_file_contents.append(output)
 96 test_result_file_contents.append('### End File: %s' % generator.output_filename())
 97 test_result_file_contents.append('')
 98 else:
 99 log.debug("Writing file: %s" % output_filepath)
 100 output_file = LazyFileWriter(output_filepath, force_output)
 101 output_file.write(output)
 102 output_file.close()
 103
 104 if concatenate_output:
 105 filename = os.path.join(os.path.basename(builtins_files[0]) + '-result')
 106 output_filepath = os.path.join(output_path, filename)
 107 log.debug("Writing file: %s" % output_filepath)
 108 output_file = LazyFileWriter(output_filepath, force_output)
 109 output_file.write('\n'.join(test_result_file_contents))
 110 output_file.close()
 111
 112if __name__ == '__main__':
 113 allowed_framework_names = ['JavaScriptCore', 'WebCore']
 114 cli_parser = optparse.OptionParser(usage="usage: %prog [options] Builtin1.js [, Builtin2.js, ...]")
 115 cli_parser.add_option("-i", "--input-directory", help="If specified, generates builtins from all JavaScript files in the specified directory in addition to specific files passed as arguments.")
 116 cli_parser.add_option("-o", "--output-directory", help="Directory where generated files should be written.")
 117 cli_parser.add_option("--framework", type="choice", choices=allowed_framework_names, help="Destination framework for generated files.")
 118 cli_parser.add_option("--force", action="store_true", help="Force output of generated scripts, even if nothing changed.")
 119 cli_parser.add_option("--combined", action="store_true", help="Produce one .h/.cpp file instead of producing one per builtin object.")
 120 cli_parser.add_option("-v", "--debug", action="store_true", help="Log extra output for debugging the generator itself.")
 121 cli_parser.add_option("-t", "--test", action="store_true", help="Enable test mode.")
 122
 123 arg_options, arg_values = cli_parser.parse_args()
 124 if len(arg_values) is 0 and not arg_options.input_directory:
 125 raise ParseException("At least one input file or directory expected.")
 126
 127 if not arg_options.output_directory:
 128 raise ParseException("Missing output directory.")
 129
 130 if arg_options.debug:
 131 log.setLevel(logging.DEBUG)
 132
 133 input_filepaths = arg_values[:]
 134 if arg_options.input_directory:
 135 for filepath in os.listdir(arg_options.input_directory):
 136 input_filepaths.append(os.path.join(arg_options.input_directory, filepath))
 137
 138 input_filepaths = filter(lambda name: fnmatch.fnmatch(name, '*.js'), input_filepaths)
 139
 140 options = {
 141 'output_path': arg_options.output_directory,
 142 'framework_name': arg_options.framework,
 143 'combined_output': arg_options.combined,
 144 'force_output': arg_options.force,
 145 'concatenate_output': arg_options.test,
 146 }
 147
 148 log.debug("Generating code for builtins.")
 149 log.debug("Parsed options:")
 150 for option, value in options.items():
 151 log.debug(" %s: %s" % (option, value))
 152 log.debug("")
 153 log.debug("Input files:")
 154 for filepath in input_filepaths:
 155 log.debug(" %s" % filepath)
 156 log.debug("")
 157
 158 try:
 159 generate_bindings_for_builtins_files(builtins_files=input_filepaths, **options)
 160 except ParseException as e:
 161 if arg_options.test:
 162 log.error(e.message)
 163 else:
 164 raise # Force the build to fail.

Source/JavaScriptCore/Scripts/lazywriter.py

 1#!/usr/bin/env python
 2#
 3# Copyright (c) 2015 Apple Inc. All rights reserved.
 4# Copyright (c) 2009 Google Inc. All rights reserved.
 5#
 6# Redistribution and use in source and binary forms, with or without
 7# modification, are permitted provided that the following conditions
 8# are met:
 9# 1. Redistributions of source code must retain the above copyright
 10# notice, this list of conditions and the following disclaimer.
 11# 2. Redistributions in binary form must reproduce the above copyright
 12# notice, this list of conditions and the following disclaimer in the
 13# documentation and/or other materials provided with the distribution.
 14#
 15# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25# THE POSSIBILITY OF SUCH DAMAGE.
 26
 27# A writer that only updates file if it actually changed.
 28
 29
 30class LazyFileWriter:
 31 def __init__(self, filepath, force_output):
 32 self._filepath = filepath
 33 self._output = ""
 34 self.force_output = force_output
 35
 36 def write(self, text):
 37 self._output += text
 38
 39 def close(self):
 40 text_changed = True
 41 self._output = self._output.rstrip() + "\n"
 42
 43 try:
 44 if self.force_output:
 45 raise
 46
 47 read_file = open(self._filepath, "r")
 48 old_text = read_file.read()
 49 read_file.close()
 50 text_changed = old_text != self._output
 51 except:
 52 # Ignore, just overwrite by default
 53 pass
 54
 55 if text_changed or self.force_output:
 56 out_file = open(self._filepath, "w")
 57 out_file.write(self._output)
 58 out_file.close()

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Combined.js

 1/*
 2 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26function rejectPromise(promise, reason)
 27{
 28 "use strict";
 29
 30 var reactions = promise.@promiseRejectReactions;
 31 promise.@promiseResult = reason;
 32 promise.@promiseFulfillReactions = undefined;
 33 promise.@promiseRejectReactions = undefined;
 34 promise.@promiseState = @promiseRejected;
 35
 36 @InspectorInstrumentation.promiseRejected(promise, reason, reactions);
 37
 38 @triggerPromiseReactions(reactions, reason);
 39}
 40
 41function fulfillPromise(promise, value)
 42{
 43 "use strict";
 44
 45 var reactions = promise.@promiseFulfillReactions;
 46 promise.@promiseResult = value;
 47 promise.@promiseFulfillReactions = undefined;
 48 promise.@promiseRejectReactions = undefined;
 49 promise.@promiseState = @promiseFulfilled;
 50
 51 @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);
 52
 53 @triggerPromiseReactions(reactions, value);
 54}

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.Promise-Separate.js

 1/*
 2 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26function rejectPromise(promise, reason)
 27{
 28 "use strict";
 29
 30 var reactions = promise.@promiseRejectReactions;
 31 promise.@promiseResult = reason;
 32 promise.@promiseFulfillReactions = undefined;
 33 promise.@promiseRejectReactions = undefined;
 34 promise.@promiseState = @promiseRejected;
 35
 36 @InspectorInstrumentation.promiseRejected(promise, reason, reactions);
 37
 38 @triggerPromiseReactions(reactions, reason);
 39}
 40
 41function fulfillPromise(promise, value)
 42{
 43 "use strict";
 44
 45 var reactions = promise.@promiseFulfillReactions;
 46 promise.@promiseResult = value;
 47 promise.@promiseFulfillReactions = undefined;
 48 promise.@promiseRejectReactions = undefined;
 49 promise.@promiseState = @promiseFulfilled;
 50
 51 @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);
 52
 53 @triggerPromiseReactions(reactions, value);
 54}

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Combined.js

 1/*
 2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
 3 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27
 28function every(callback /*, thisArg */)
 29{
 30 "use strict";
 31
 32 if (this === null)
 33 throw new @TypeError("Array.prototype.every requires that |this| not be null");
 34
 35 if (this === undefined)
 36 throw new @TypeError("Array.prototype.every requires that |this| not be undefined");
 37
 38 var array = @Object(this);
 39 var length = @toLength(array.length);
 40
 41 if (typeof callback !== "function")
 42 throw new @TypeError("Array.prototype.every callback must be a function");
 43
 44 var thisArg = arguments.length > 1 ? arguments[1] : undefined;
 45
 46 for (var i = 0; i < length; i++) {
 47 if (!(i in array))
 48 continue;
 49 if (!callback.@call(thisArg, array[i], i, array))
 50 return false;
 51 }
 52
 53 return true;
 54}
 55
 56function forEach(callback /*, thisArg */)
 57{
 58 "use strict";
 59
 60 if (this === null)
 61 throw new @TypeError("Array.prototype.forEach requires that |this| not be null");
 62
 63 if (this === undefined)
 64 throw new @TypeError("Array.prototype.forEach requires that |this| not be undefined");
 65
 66 var array = @Object(this);
 67 var length = @toLength(array.length);
 68
 69 if (typeof callback !== "function")
 70 throw new @TypeError("Array.prototype.forEach callback must be a function");
 71
 72 var thisArg = arguments.length > 1 ? arguments[1] : undefined;
 73
 74 for (var i = 0; i < length; i++) {
 75 if (i in array)
 76 callback.@call(thisArg, array[i], i, array);
 77 }
 78}

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-Builtin.prototype-Separate.js

 1/*
 2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
 3 * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 25 */
 26
 27
 28function every(callback /*, thisArg */)
 29{
 30 "use strict";
 31
 32 if (this === null)
 33 throw new @TypeError("Array.prototype.every requires that |this| not be null");
 34
 35 if (this === undefined)
 36 throw new @TypeError("Array.prototype.every requires that |this| not be undefined");
 37
 38 var array = @Object(this);
 39 var length = @toLength(array.length);
 40
 41 if (typeof callback !== "function")
 42 throw new @TypeError("Array.prototype.every callback must be a function");
 43
 44 var thisArg = arguments.length > 1 ? arguments[1] : undefined;
 45
 46 for (var i = 0; i < length; i++) {
 47 if (!(i in array))
 48 continue;
 49 if (!callback.@call(thisArg, array[i], i, array))
 50 return false;
 51 }
 52
 53 return true;
 54}
 55
 56function forEach(callback /*, thisArg */)
 57{
 58 "use strict";
 59
 60 if (this === null)
 61 throw new @TypeError("Array.prototype.forEach requires that |this| not be null");
 62
 63 if (this === undefined)
 64 throw new @TypeError("Array.prototype.forEach requires that |this| not be undefined");
 65
 66 var array = @Object(this);
 67 var length = @toLength(array.length);
 68
 69 if (typeof callback !== "function")
 70 throw new @TypeError("Array.prototype.forEach callback must be a function");
 71
 72 var thisArg = arguments.length > 1 ? arguments[1] : undefined;
 73
 74 for (var i = 0; i < length; i++) {
 75 if (i in array)
 76 callback.@call(thisArg, array[i], i, array);
 77 }
 78}

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Combined.js

 1/*
 2 * Copyright (C) 2015 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26function of(/* items... */)
 27{
 28 "use strict";
 29
 30 var length = arguments.length;
 31 // TODO: Need isConstructor(this) instead of typeof "function" check.
 32 var array = typeof this === 'function' ? new this(length) : new @Array(length);
 33 for (var k = 0; k < length; ++k)
 34 @putByValDirect(array, k, arguments[k]);
 35 array.length = length;
 36 return array;
 37}
 38
 39function from(items /*, mapFn, thisArg */)
 40{
 41 "use strict";
 42
 43 var thisObj = this;
 44
 45 var mapFn = arguments.length > 1 ? arguments[1] : undefined;
 46
 47 var thisArg;
 48
 49 if (mapFn !== undefined) {
 50 if (typeof mapFn !== "function")
 51 throw new @TypeError("Array.from requires that the second argument, when provided, be a function");
 52
 53 if (arguments.length > 2)
 54 thisArg = arguments[2];
 55 }
 56
 57 if (items == null)
 58 throw new @TypeError("Array.from requires an array-like object - not null or undefined");
 59
 60 var iteratorMethod = items[@symbolIterator];
 61 if (iteratorMethod != null) {
 62 if (typeof iteratorMethod !== "function")
 63 throw new @TypeError("Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function");
 64
 65 // TODO: Need isConstructor(thisObj) instead of typeof "function" check.
 66 var result = (typeof thisObj === "function") ? @Object(new thisObj()) : [];
 67
 68 var k = 0;
 69 var iterator = iteratorMethod.@call(items);
 70
 71 // Since for-of loop once more looks up the @@iterator property of a given iterable,
 72 // it could be observable if the user defines a getter for @@iterator.
 73 // To avoid this situation, we define a wrapper object that @@iterator just returns a given iterator.
 74 var wrapper = {
 75 [@symbolIterator]() {
 76 return iterator;
 77 }
 78 };
 79
 80 for (var value of wrapper) {
 81 if (mapFn)
 82 @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));
 83 else
 84 @putByValDirect(result, k, value);
 85 k += 1;
 86 }
 87
 88 result.length = k;
 89 return result;
 90 }
 91
 92 var arrayLike = @Object(items);
 93 var arrayLikeLength = @toLength(arrayLike.length);
 94
 95 // TODO: Need isConstructor(thisObj) instead of typeof "function" check.
 96 var result = (typeof thisObj === "function") ? @Object(new thisObj(arrayLikeLength)) : new @Array(arrayLikeLength);
 97
 98 var k = 0;
 99 while (k < arrayLikeLength) {
 100 var value = arrayLike[k];
 101 if (mapFn)
 102 @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));
 103 else
 104 @putByValDirect(result, k, value);
 105 k += 1;
 106 }
 107
 108 result.length = arrayLikeLength;
 109 return result;
 110}

Source/JavaScriptCore/Scripts/tests/builtins/JavaScriptCore-BuiltinConstructor-Separate.js

 1/*
 2 * Copyright (C) 2015 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26function of(/* items... */)
 27{
 28 "use strict";
 29
 30 var length = arguments.length;
 31 // TODO: Need isConstructor(this) instead of typeof "function" check.
 32 var array = typeof this === 'function' ? new this(length) : new @Array(length);
 33 for (var k = 0; k < length; ++k)
 34 @putByValDirect(array, k, arguments[k]);
 35 array.length = length;
 36 return array;
 37}
 38
 39function from(items /*, mapFn, thisArg */)
 40{
 41 "use strict";
 42
 43 var thisObj = this;
 44
 45 var mapFn = arguments.length > 1 ? arguments[1] : undefined;
 46
 47 var thisArg;
 48
 49 if (mapFn !== undefined) {
 50 if (typeof mapFn !== "function")
 51 throw new @TypeError("Array.from requires that the second argument, when provided, be a function");
 52
 53 if (arguments.length > 2)
 54 thisArg = arguments[2];
 55 }
 56
 57 if (items == null)
 58 throw new @TypeError("Array.from requires an array-like object - not null or undefined");
 59
 60 var iteratorMethod = items[@symbolIterator];
 61 if (iteratorMethod != null) {
 62 if (typeof iteratorMethod !== "function")
 63 throw new @TypeError("Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function");
 64
 65 // TODO: Need isConstructor(thisObj) instead of typeof "function" check.
 66 var result = (typeof thisObj === "function") ? @Object(new thisObj()) : [];
 67
 68 var k = 0;
 69 var iterator = iteratorMethod.@call(items);
 70
 71 // Since for-of loop once more looks up the @@iterator property of a given iterable,
 72 // it could be observable if the user defines a getter for @@iterator.
 73 // To avoid this situation, we define a wrapper object that @@iterator just returns a given iterator.
 74 var wrapper = {
 75 [@symbolIterator]() {
 76 return iterator;
 77 }
 78 };
 79
 80 for (var value of wrapper) {
 81 if (mapFn)
 82 @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));
 83 else
 84 @putByValDirect(result, k, value);
 85 k += 1;
 86 }
 87
 88 result.length = k;
 89 return result;
 90 }
 91
 92 var arrayLike = @Object(items);
 93 var arrayLikeLength = @toLength(arrayLike.length);
 94
 95 // TODO: Need isConstructor(thisObj) instead of typeof "function" check.
 96 var result = (typeof thisObj === "function") ? @Object(new thisObj(arrayLikeLength)) : new @Array(arrayLikeLength);
 97
 98 var k = 0;
 99 while (k < arrayLikeLength) {
 100 var value = arrayLike[k];
 101 if (mapFn)
 102 @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));
 103 else
 104 @putByValDirect(result, k, value);
 105 k += 1;
 106 }
 107
 108 result.length = arrayLikeLength;
 109 return result;
 110}

Source/JavaScriptCore/Scripts/tests/builtins/WebCore-GuardedBuiltin-Separate.js

 1/*
 2 * Copyright (C) 2015 Canon Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26// @optional=STREAMS_API
 27
 28function isReadableStreamLocked(stream)
 29{
 30 "use strict";
 31
 32 return !!stream.@reader;
 33}
 34
 35
 36function cancelReadableStream(stream, reason)
 37{
 38 "use strict";
 39
 40 if (stream.@state === @readableStreamClosed)
 41 return Promise.resolve();
 42 if (stream.@state === @readableStreamErrored)
 43 return Promise.reject(stream.@storedError);
 44 stream.@queue = [];
 45 @finishClosingReadableStream(stream);
 46 return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
 47}
 48
 49
 50function promiseInvokeOrNoop(object, key, args)
 51{
 52 "use strict";
 53
 54 try {
 55 var method = object[key];
 56 if (typeof method === "undefined")
 57 return Promise.resolve();
 58 var result = method.@apply(object, args);
 59 return Promise.resolve(result);
 60 }
 61 catch(error) {
 62 return Promise.reject(error);
 63 }
 64}

Source/JavaScriptCore/Scripts/tests/builtins/WebCore-GuardedInternalBuiltin-Separate.js

 1/*
 2 * Copyright (C) 2015 Canon Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26// @optional=STREAMS_API
 27// @internal
 28
 29function isReadableStreamLocked(stream)
 30{
 31 "use strict";
 32
 33 return !!stream.@reader;
 34}
 35
 36
 37function cancelReadableStream(stream, reason)
 38{
 39 "use strict";
 40
 41 if (stream.@state === @readableStreamClosed)
 42 return Promise.resolve();
 43 if (stream.@state === @readableStreamErrored)
 44 return Promise.reject(stream.@storedError);
 45 stream.@queue = [];
 46 @finishClosingReadableStream(stream);
 47 return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
 48}
 49
 50
 51function promiseInvokeOrNoop(object, key, args)
 52{
 53 "use strict";
 54
 55 try {
 56 var method = object[key];
 57 if (typeof method === "undefined")
 58 return Promise.resolve();
 59 var result = method.@apply(object, args);
 60 return Promise.resolve(result);
 61 }
 62 catch(error) {
 63 return Promise.reject(error);
 64 }
 65}

Source/JavaScriptCore/Scripts/tests/builtins/WebCore-UnguardedBuiltin-Separate.js

 1/*
 2 * Copyright (C) 2015 Canon Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26function isReadableStreamLocked(stream)
 27{
 28 "use strict";
 29
 30 return !!stream.@reader;
 31}
 32
 33
 34function cancelReadableStream(stream, reason)
 35{
 36 "use strict";
 37
 38 if (stream.@state === @readableStreamClosed)
 39 return Promise.resolve();
 40 if (stream.@state === @readableStreamErrored)
 41 return Promise.reject(stream.@storedError);
 42 stream.@queue = [];
 43 @finishClosingReadableStream(stream);
 44 return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
 45}
 46
 47
 48function promiseInvokeOrNoop(object, key, args)
 49{
 50 "use strict";
 51
 52 try {
 53 var method = object[key];
 54 if (typeof method === "undefined")
 55 return Promise.resolve();
 56 var result = method.@apply(object, args);
 57 return Promise.resolve(result);
 58 }
 59 catch(error) {
 60 return Promise.reject(error);
 61 }
 62}

Source/JavaScriptCore/Scripts/tests/builtins/WebCore-xmlCasingTest-Separate.js

 1/*
 2 * Copyright (C) 2015 Canon Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26// @optional=STREAMS_API
 27// @internal
 28
 29function xmlCasingTest(stream)
 30{
 31 "use strict";
 32
 33 return !!stream.@reader;
 34}
 35
 36
 37function cssCasingTest(stream, reason)
 38{
 39 "use strict";
 40
 41 if (stream.@state === @readableStreamClosed)
 42 return Promise.resolve();
 43 if (stream.@state === @readableStreamErrored)
 44 return Promise.reject(stream.@storedError);
 45 stream.@queue = [];
 46 @finishClosingReadableStream(stream);
 47 return @promiseInvokeOrNoop(stream.@underlyingSource, "cancel", [reason]).then(function() { });
 48}
 49
 50
 51function urlCasingTest(object, key, args)
 52{
 53 "use strict";
 54
 55 try {
 56 var method = object[key];
 57 if (typeof method === "undefined")
 58 return Promise.resolve();
 59 var result = method.@apply(object, args);
 60 return Promise.resolve(result);
 61 }
 62 catch(error) {
 63 return Promise.reject(error);
 64 }
 65}

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result

 1### Begin File: JSCBuiltins.h
 2/*
 3 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef JSCBuiltins_h
 32#define JSCBuiltins_h
 33
 34namespace JSC {
 35class FunctionExecutable;
 36class VM;
 37
 38enum class ConstructAbility : unsigned;
 39}
 40
 41namespace JSC {
 42
 43/* Builtin.Promise */
 44extern const char* s_builtinPromiseRejectPromiseCode;
 45extern const int s_builtinPromiseRejectPromiseCodeLength;
 46extern const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility;
 47extern const char* s_builtinPromiseFulfillPromiseCode;
 48extern const int s_builtinPromiseFulfillPromiseCodeLength;
 49extern const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility;
 50
 51#define JSC_FOREACH_BUILTINPROMISE_BUILTIN_DATA(macro) \
 52 macro(rejectPromise, builtinPromiseRejectPromise, 2) \
 53 macro(fulfillPromise, builtinPromiseFulfillPromise, 2) \
 54
 55#define JSC_BUILTIN_BUILTINPROMISE_REJECTPROMISE 1
 56#define JSC_BUILTIN_BUILTINPROMISE_FULFILLPROMISE 1
 57
 58#define JSC_FOREACH_BUILTIN_CODE(macro) \
 59 macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \
 60 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \
 61
 62#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
 63 macro(fulfillPromise) \
 64 macro(rejectPromise) \
 65
 66#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 67 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 68
 69JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 70#undef DECLARE_BUILTIN_GENERATOR
 71
 72#define JSC_BUILTIN_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 73
 74} // namespace JSC
 75
 76#endif // JSCBuiltins_h
 77
 78### End File: JSCBuiltins.h
 79
 80### Begin File: JSCBuiltins.cpp
 81/*
 82 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 83 *
 84 * Redistribution and use in source and binary forms, with or without
 85 * modification, are permitted provided that the following conditions
 86 * are met:
 87 * 1. Redistributions of source code must retain the above copyright
 88 * notice, this list of conditions and the following disclaimer.
 89 * 2. Redistributions in binary form must reproduce the above copyright
 90 * notice, this list of conditions and the following disclaimer in the
 91 * documentation and/or other materials provided with the distribution.
 92 *
 93 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 94 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 95 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 96 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 97 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 98 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 99 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 100 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 101 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 103 * THE POSSIBILITY OF SUCH DAMAGE.
 104 *
 105 */
 106
 107// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 108// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 109
 110#include "config.h"
 111#include "JSCBuiltins.h"
 112
 113#include "BuiltinExecutables.h"
 114#include "Executable.h"
 115#include "JSCellInlines.h"
 116#include "VM.h"
 117
 118namespace JSC {
 119
 120const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 121const int s_builtinPromiseRejectPromiseCodeLength = 413;
 122const char* s_builtinPromiseRejectPromiseCode =
 123 "(function (promise, reason)\n" \
 124 "{\n" \
 125 " \"use strict\";\n" \
 126 "\n" \
 127 " var reactions = promise.@promiseRejectReactions;\n" \
 128 " promise.@promiseResult = reason;\n" \
 129 " promise.@promiseFulfillReactions = undefined;\n" \
 130 " promise.@promiseRejectReactions = undefined;\n" \
 131 " promise.@promiseState = @promiseRejected;\n" \
 132 "\n" \
 133 " @InspectorInstrumentation.promiseRejected(promise, reason, reactions);\n" \
 134 "\n" \
 135 " @triggerPromiseReactions(reactions, reason);\n" \
 136 "})\n" \
 137;
 138
 139const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 140const int s_builtinPromiseFulfillPromiseCodeLength = 412;
 141const char* s_builtinPromiseFulfillPromiseCode =
 142 "(function (promise, value)\n" \
 143 "{\n" \
 144 " \"use strict\";\n" \
 145 "\n" \
 146 " var reactions = promise.@promiseFulfillReactions;\n" \
 147 " promise.@promiseResult = value;\n" \
 148 " promise.@promiseFulfillReactions = undefined;\n" \
 149 " promise.@promiseRejectReactions = undefined;\n" \
 150 " promise.@promiseState = @promiseFulfilled;\n" \
 151 "\n" \
 152 " @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);\n" \
 153 "\n" \
 154 " @triggerPromiseReactions(reactions, value);\n" \
 155 "})\n" \
 156;
 157
 158
 159#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 160JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 161{\
 162 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 163JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 164#undef DEFINE_BUILTIN_GENERATOR
 165
 166
 167} // namespace JSC
 168### End File: JSCBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result

 1### Begin File: BuiltinPromiseBuiltins.h
 2/*
 3 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef BuiltinPromiseBuiltins_h
 32#define BuiltinPromiseBuiltins_h
 33
 34
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace JSC {
 41
 42/* Builtin.Promise */
 43extern const char* s_builtinPromiseRejectPromiseCode;
 44extern const int s_builtinPromiseRejectPromiseCodeLength;
 45extern const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility;
 46extern const char* s_builtinPromiseFulfillPromiseCode;
 47extern const int s_builtinPromiseFulfillPromiseCodeLength;
 48extern const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility;
 49
 50#define JSC_FOREACH_BUILTIN_PROMISE_BUILTIN_DATA(macro) \
 51 macro(rejectPromise, builtinPromiseRejectPromise, 2) \
 52 macro(fulfillPromise, builtinPromiseFulfillPromise, 2) \
 53
 54#define JSC_BUILTIN_BUILTIN_PROMISE_REJECTPROMISE 1
 55#define JSC_BUILTIN_BUILTIN_PROMISE_FULFILLPROMISE 1
 56
 57#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(macro) \
 58 macro(builtinPromiseRejectPromiseCode, rejectPromise, s_builtinPromiseRejectPromiseCodeLength) \
 59 macro(builtinPromiseFulfillPromiseCode, fulfillPromise, s_builtinPromiseFulfillPromiseCodeLength) \
 60
 61#define JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_FUNCTION_NAME(macro) \
 62 macro(fulfillPromise) \
 63 macro(rejectPromise) \
 64
 65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 67
 68JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 69#undef DECLARE_BUILTIN_GENERATOR
 70
 71#define JSC_BUILTIN_BUILTIN.PROMISE_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 72
 73} // namespace JSC
 74
 75#endif // BuiltinPromiseBuiltins_h
 76
 77### End File: BuiltinPromiseBuiltins.h
 78
 79### Begin File: BuiltinPromiseBuiltins.cpp
 80/*
 81 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 82 *
 83 * Redistribution and use in source and binary forms, with or without
 84 * modification, are permitted provided that the following conditions
 85 * are met:
 86 * 1. Redistributions of source code must retain the above copyright
 87 * notice, this list of conditions and the following disclaimer.
 88 * 2. Redistributions in binary form must reproduce the above copyright
 89 * notice, this list of conditions and the following disclaimer in the
 90 * documentation and/or other materials provided with the distribution.
 91 *
 92 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 93 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 94 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 96 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 97 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 98 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 99 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 100 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 101 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 102 * THE POSSIBILITY OF SUCH DAMAGE.
 103 *
 104 */
 105
 106// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 107// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 108
 109#include "config.h"
 110#include "BuiltinPromiseBuiltins.h"
 111
 112#include "BuiltinExecutables.h"
 113#include "Executable.h"
 114#include "JSCellInlines.h"
 115#include "VM.h"
 116
 117namespace JSC {
 118
 119const JSC::ConstructAbility s_builtinPromiseRejectPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 120const int s_builtinPromiseRejectPromiseCodeLength = 413;
 121const char* s_builtinPromiseRejectPromiseCode =
 122 "(function (promise, reason)\n" \
 123 "{\n" \
 124 " \"use strict\";\n" \
 125 "\n" \
 126 " var reactions = promise.@promiseRejectReactions;\n" \
 127 " promise.@promiseResult = reason;\n" \
 128 " promise.@promiseFulfillReactions = undefined;\n" \
 129 " promise.@promiseRejectReactions = undefined;\n" \
 130 " promise.@promiseState = @promiseRejected;\n" \
 131 "\n" \
 132 " @InspectorInstrumentation.promiseRejected(promise, reason, reactions);\n" \
 133 "\n" \
 134 " @triggerPromiseReactions(reactions, reason);\n" \
 135 "})\n" \
 136;
 137
 138const JSC::ConstructAbility s_builtinPromiseFulfillPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 139const int s_builtinPromiseFulfillPromiseCodeLength = 412;
 140const char* s_builtinPromiseFulfillPromiseCode =
 141 "(function (promise, value)\n" \
 142 "{\n" \
 143 " \"use strict\";\n" \
 144 "\n" \
 145 " var reactions = promise.@promiseFulfillReactions;\n" \
 146 " promise.@promiseResult = value;\n" \
 147 " promise.@promiseFulfillReactions = undefined;\n" \
 148 " promise.@promiseRejectReactions = undefined;\n" \
 149 " promise.@promiseState = @promiseFulfilled;\n" \
 150 "\n" \
 151 " @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);\n" \
 152 "\n" \
 153 " @triggerPromiseReactions(reactions, value);\n" \
 154 "})\n" \
 155;
 156
 157
 158#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 159JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 160{\
 161 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 162JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 163#undef DEFINE_BUILTIN_GENERATOR
 164
 165
 166} // namespace JSC
 167### End File: BuiltinPromiseBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result

 1### Begin File: JSCBuiltins.h
 2/*
 3 * Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 5 *
 6 * Redistribution and use in source and binary forms, with or without
 7 * modification, are permitted provided that the following conditions
 8 * are met:
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 *
 15 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25 * THE POSSIBILITY OF SUCH DAMAGE.
 26 *
 27 */
 28
 29// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 30// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 31
 32#ifndef JSCBuiltins_h
 33#define JSCBuiltins_h
 34
 35namespace JSC {
 36class FunctionExecutable;
 37class VM;
 38
 39enum class ConstructAbility : unsigned;
 40}
 41
 42namespace JSC {
 43
 44/* Builtin.prototype */
 45extern const char* s_builtinPrototypeEveryCode;
 46extern const int s_builtinPrototypeEveryCodeLength;
 47extern const JSC::ConstructAbility s_builtinPrototypeEveryCodeConstructAbility;
 48extern const char* s_builtinPrototypeForEachCode;
 49extern const int s_builtinPrototypeForEachCodeLength;
 50extern const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility;
 51
 52#define JSC_FOREACH_BUILTINPROTOTYPE_BUILTIN_DATA(macro) \
 53 macro(every, builtinPrototypeEvery, 1) \
 54 macro(forEach, builtinPrototypeForEach, 1) \
 55
 56#define JSC_BUILTIN_BUILTINPROTOTYPE_EVERY 1
 57#define JSC_BUILTIN_BUILTINPROTOTYPE_FOREACH 1
 58
 59#define JSC_FOREACH_BUILTIN_CODE(macro) \
 60 macro(builtinPrototypeEveryCode, every, s_builtinPrototypeEveryCodeLength) \
 61 macro(builtinPrototypeForEachCode, forEach, s_builtinPrototypeForEachCodeLength) \
 62
 63#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
 64 macro(every) \
 65 macro(forEach) \
 66
 67#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 68 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 69
 70JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 71#undef DECLARE_BUILTIN_GENERATOR
 72
 73#define JSC_BUILTIN_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 74
 75} // namespace JSC
 76
 77#endif // JSCBuiltins_h
 78
 79### End File: JSCBuiltins.h
 80
 81### Begin File: JSCBuiltins.cpp
 82/*
 83 * Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 84 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 85 *
 86 * Redistribution and use in source and binary forms, with or without
 87 * modification, are permitted provided that the following conditions
 88 * are met:
 89 * 1. Redistributions of source code must retain the above copyright
 90 * notice, this list of conditions and the following disclaimer.
 91 * 2. Redistributions in binary form must reproduce the above copyright
 92 * notice, this list of conditions and the following disclaimer in the
 93 * documentation and/or other materials provided with the distribution.
 94 *
 95 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 96 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 97 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 98 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 99 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 100 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 101 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 102 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 103 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 104 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 105 * THE POSSIBILITY OF SUCH DAMAGE.
 106 *
 107 */
 108
 109// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 110// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 111
 112#include "config.h"
 113#include "JSCBuiltins.h"
 114
 115#include "BuiltinExecutables.h"
 116#include "Executable.h"
 117#include "JSCellInlines.h"
 118#include "VM.h"
 119
 120namespace JSC {
 121
 122const JSC::ConstructAbility s_builtinPrototypeEveryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 123const int s_builtinPrototypeEveryCodeLength = 762;
 124const char* s_builtinPrototypeEveryCode =
 125 "(function (callback )\n" \
 126 "{\n" \
 127 " \"use strict\";\n" \
 128 "\n" \
 129 " if (this === null)\n" \
 130 " throw new @TypeError(\"Array.prototype.every requires that |this| not be null\");\n" \
 131 " \n" \
 132 " if (this === undefined)\n" \
 133 " throw new @TypeError(\"Array.prototype.every requires that |this| not be undefined\");\n" \
 134 " \n" \
 135 " var array = @Object(this);\n" \
 136 " var length = @toLength(array.length);\n" \
 137 "\n" \
 138 " if (typeof callback !== \"function\")\n" \
 139 " throw new @TypeError(\"Array.prototype.every callback must be a function\");\n" \
 140 " \n" \
 141 " var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
 142 " \n" \
 143 " for (var i = 0; i < length; i++) {\n" \
 144 " if (!(i in array))\n" \
 145 " continue;\n" \
 146 " if (!callback.@call(thisArg, array[i], i, array))\n" \
 147 " return false;\n" \
 148 " }\n" \
 149 " \n" \
 150 " return true;\n" \
 151 "})\n" \
 152;
 153
 154const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 155const int s_builtinPrototypeForEachCodeLength = 694;
 156const char* s_builtinPrototypeForEachCode =
 157 "(function (callback )\n" \
 158 "{\n" \
 159 " \"use strict\";\n" \
 160 "\n" \
 161 " if (this === null)\n" \
 162 " throw new @TypeError(\"Array.prototype.forEach requires that |this| not be null\");\n" \
 163 " \n" \
 164 " if (this === undefined)\n" \
 165 " throw new @TypeError(\"Array.prototype.forEach requires that |this| not be undefined\");\n" \
 166 " \n" \
 167 " var array = @Object(this);\n" \
 168 " var length = @toLength(array.length);\n" \
 169 "\n" \
 170 " if (typeof callback !== \"function\")\n" \
 171 " throw new @TypeError(\"Array.prototype.forEach callback must be a function\");\n" \
 172 " \n" \
 173 " var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
 174 " \n" \
 175 " for (var i = 0; i < length; i++) {\n" \
 176 " if (i in array)\n" \
 177 " callback.@call(thisArg, array[i], i, array);\n" \
 178 " }\n" \
 179 "})\n" \
 180;
 181
 182
 183#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 184JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 185{\
 186 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 187JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 188#undef DEFINE_BUILTIN_GENERATOR
 189
 190
 191} // namespace JSC
 192### End File: JSCBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result

 1### Begin File: BuiltinPrototypeBuiltins.h
 2/*
 3 * Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 4 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 5 *
 6 * Redistribution and use in source and binary forms, with or without
 7 * modification, are permitted provided that the following conditions
 8 * are met:
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 *
 15 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 19 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 25 * THE POSSIBILITY OF SUCH DAMAGE.
 26 *
 27 */
 28
 29// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 30// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 31
 32#ifndef BuiltinPrototypeBuiltins_h
 33#define BuiltinPrototypeBuiltins_h
 34
 35
 36
 37namespace JSC {
 38class FunctionExecutable;
 39}
 40
 41namespace JSC {
 42
 43/* Builtin.prototype */
 44extern const char* s_builtinPrototypeEveryCode;
 45extern const int s_builtinPrototypeEveryCodeLength;
 46extern const JSC::ConstructAbility s_builtinPrototypeEveryCodeConstructAbility;
 47extern const char* s_builtinPrototypeForEachCode;
 48extern const int s_builtinPrototypeForEachCodeLength;
 49extern const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility;
 50
 51#define JSC_FOREACH_BUILTIN_PROTOTYPE_BUILTIN_DATA(macro) \
 52 macro(every, builtinPrototypeEvery, 1) \
 53 macro(forEach, builtinPrototypeForEach, 1) \
 54
 55#define JSC_BUILTIN_BUILTIN_PROTOTYPE_EVERY 1
 56#define JSC_BUILTIN_BUILTIN_PROTOTYPE_FOREACH 1
 57
 58#define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(macro) \
 59 macro(builtinPrototypeEveryCode, every, s_builtinPrototypeEveryCodeLength) \
 60 macro(builtinPrototypeForEachCode, forEach, s_builtinPrototypeForEachCodeLength) \
 61
 62#define JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_FUNCTION_NAME(macro) \
 63 macro(every) \
 64 macro(forEach) \
 65
 66#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 67 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 68
 69JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 70#undef DECLARE_BUILTIN_GENERATOR
 71
 72#define JSC_BUILTIN_BUILTIN.PROTOTYPE_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 73
 74} // namespace JSC
 75
 76#endif // BuiltinPrototypeBuiltins_h
 77
 78### End File: BuiltinPrototypeBuiltins.h
 79
 80### Begin File: BuiltinPrototypeBuiltins.cpp
 81/*
 82 * Copyright (c) 2014, 2015 Apple Inc. All rights reserved.
 83 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 84 *
 85 * Redistribution and use in source and binary forms, with or without
 86 * modification, are permitted provided that the following conditions
 87 * are met:
 88 * 1. Redistributions of source code must retain the above copyright
 89 * notice, this list of conditions and the following disclaimer.
 90 * 2. Redistributions in binary form must reproduce the above copyright
 91 * notice, this list of conditions and the following disclaimer in the
 92 * documentation and/or other materials provided with the distribution.
 93 *
 94 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 95 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 96 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 97 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 98 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 99 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 100 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 101 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 102 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 103 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 104 * THE POSSIBILITY OF SUCH DAMAGE.
 105 *
 106 */
 107
 108// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 109// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 110
 111#include "config.h"
 112#include "BuiltinPrototypeBuiltins.h"
 113
 114#include "BuiltinExecutables.h"
 115#include "Executable.h"
 116#include "JSCellInlines.h"
 117#include "VM.h"
 118
 119namespace JSC {
 120
 121const JSC::ConstructAbility s_builtinPrototypeEveryCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 122const int s_builtinPrototypeEveryCodeLength = 762;
 123const char* s_builtinPrototypeEveryCode =
 124 "(function (callback )\n" \
 125 "{\n" \
 126 " \"use strict\";\n" \
 127 "\n" \
 128 " if (this === null)\n" \
 129 " throw new @TypeError(\"Array.prototype.every requires that |this| not be null\");\n" \
 130 " \n" \
 131 " if (this === undefined)\n" \
 132 " throw new @TypeError(\"Array.prototype.every requires that |this| not be undefined\");\n" \
 133 " \n" \
 134 " var array = @Object(this);\n" \
 135 " var length = @toLength(array.length);\n" \
 136 "\n" \
 137 " if (typeof callback !== \"function\")\n" \
 138 " throw new @TypeError(\"Array.prototype.every callback must be a function\");\n" \
 139 " \n" \
 140 " var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
 141 " \n" \
 142 " for (var i = 0; i < length; i++) {\n" \
 143 " if (!(i in array))\n" \
 144 " continue;\n" \
 145 " if (!callback.@call(thisArg, array[i], i, array))\n" \
 146 " return false;\n" \
 147 " }\n" \
 148 " \n" \
 149 " return true;\n" \
 150 "})\n" \
 151;
 152
 153const JSC::ConstructAbility s_builtinPrototypeForEachCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 154const int s_builtinPrototypeForEachCodeLength = 694;
 155const char* s_builtinPrototypeForEachCode =
 156 "(function (callback )\n" \
 157 "{\n" \
 158 " \"use strict\";\n" \
 159 "\n" \
 160 " if (this === null)\n" \
 161 " throw new @TypeError(\"Array.prototype.forEach requires that |this| not be null\");\n" \
 162 " \n" \
 163 " if (this === undefined)\n" \
 164 " throw new @TypeError(\"Array.prototype.forEach requires that |this| not be undefined\");\n" \
 165 " \n" \
 166 " var array = @Object(this);\n" \
 167 " var length = @toLength(array.length);\n" \
 168 "\n" \
 169 " if (typeof callback !== \"function\")\n" \
 170 " throw new @TypeError(\"Array.prototype.forEach callback must be a function\");\n" \
 171 " \n" \
 172 " var thisArg = arguments.length > 1 ? arguments[1] : undefined;\n" \
 173 " \n" \
 174 " for (var i = 0; i < length; i++) {\n" \
 175 " if (i in array)\n" \
 176 " callback.@call(thisArg, array[i], i, array);\n" \
 177 " }\n" \
 178 "})\n" \
 179;
 180
 181
 182#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 183JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 184{\
 185 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 186JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 187#undef DEFINE_BUILTIN_GENERATOR
 188
 189
 190} // namespace JSC
 191### End File: BuiltinPrototypeBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result

 1### Begin File: JSCBuiltins.h
 2/*
 3 * Copyright (c) 2015 Apple Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef JSCBuiltins_h
 32#define JSCBuiltins_h
 33
 34namespace JSC {
 35class FunctionExecutable;
 36class VM;
 37
 38enum class ConstructAbility : unsigned;
 39}
 40
 41namespace JSC {
 42
 43/* BuiltinConstructor */
 44extern const char* s_builtinConstructorOfCode;
 45extern const int s_builtinConstructorOfCodeLength;
 46extern const JSC::ConstructAbility s_builtinConstructorOfCodeConstructAbility;
 47extern const char* s_builtinConstructorFromCode;
 48extern const int s_builtinConstructorFromCodeLength;
 49extern const JSC::ConstructAbility s_builtinConstructorFromCodeConstructAbility;
 50
 51#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_DATA(macro) \
 52 macro(of, builtinConstructorOf, 0) \
 53 macro(from, builtinConstructorFrom, 1) \
 54
 55#define JSC_BUILTIN_BUILTINCONSTRUCTOR_OF 1
 56#define JSC_BUILTIN_BUILTINCONSTRUCTOR_FROM 1
 57
 58#define JSC_FOREACH_BUILTIN_CODE(macro) \
 59 macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \
 60 macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \
 61
 62#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
 63 macro(from) \
 64 macro(of) \
 65
 66#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 67 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 68
 69JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 70#undef DECLARE_BUILTIN_GENERATOR
 71
 72#define JSC_BUILTIN_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 73
 74} // namespace JSC
 75
 76#endif // JSCBuiltins_h
 77
 78### End File: JSCBuiltins.h
 79
 80### Begin File: JSCBuiltins.cpp
 81/*
 82 * Copyright (c) 2015 Apple Inc. All rights reserved.
 83 *
 84 * Redistribution and use in source and binary forms, with or without
 85 * modification, are permitted provided that the following conditions
 86 * are met:
 87 * 1. Redistributions of source code must retain the above copyright
 88 * notice, this list of conditions and the following disclaimer.
 89 * 2. Redistributions in binary form must reproduce the above copyright
 90 * notice, this list of conditions and the following disclaimer in the
 91 * documentation and/or other materials provided with the distribution.
 92 *
 93 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 94 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 95 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 96 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 97 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 98 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 99 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 100 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 101 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 103 * THE POSSIBILITY OF SUCH DAMAGE.
 104 *
 105 */
 106
 107// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 108// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 109
 110#include "config.h"
 111#include "JSCBuiltins.h"
 112
 113#include "BuiltinExecutables.h"
 114#include "Executable.h"
 115#include "JSCellInlines.h"
 116#include "VM.h"
 117
 118namespace JSC {
 119
 120const JSC::ConstructAbility s_builtinConstructorOfCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 121const int s_builtinConstructorOfCodeLength = 294;
 122const char* s_builtinConstructorOfCode =
 123 "(function ()\n" \
 124 "{\n" \
 125 " \"use strict\";\n" \
 126 "\n" \
 127 " var length = arguments.length;\n" \
 128 " //\n" \
 129 " var array = typeof this === 'function' ? new this(length) : new @Array(length);\n" \
 130 " for (var k = 0; k < length; ++k)\n" \
 131 " @putByValDirect(array, k, arguments[k]);\n" \
 132 " array.length = length;\n" \
 133 " return array;\n" \
 134 "})\n" \
 135;
 136
 137const JSC::ConstructAbility s_builtinConstructorFromCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 138const int s_builtinConstructorFromCodeLength = 2046;
 139const char* s_builtinConstructorFromCode =
 140 "(function (items )\n" \
 141 "{\n" \
 142 " \"use strict\";\n" \
 143 "\n" \
 144 " var thisObj = this;\n" \
 145 "\n" \
 146 " var mapFn = arguments.length > 1 ? arguments[1] : undefined;\n" \
 147 "\n" \
 148 " var thisArg;\n" \
 149 "\n" \
 150 " if (mapFn !== undefined) {\n" \
 151 " if (typeof mapFn !== \"function\")\n" \
 152 " throw new @TypeError(\"Array.from requires that the second argument, when provided, be a function\");\n" \
 153 "\n" \
 154 " if (arguments.length > 2)\n" \
 155 " thisArg = arguments[2];\n" \
 156 " }\n" \
 157 "\n" \
 158 " if (items == null)\n" \
 159 " throw new @TypeError(\"Array.from requires an array-like object - not null or undefined\");\n" \
 160 "\n" \
 161 " var iteratorMethod = items[@symbolIterator];\n" \
 162 " if (iteratorMethod != null) {\n" \
 163 " if (typeof iteratorMethod !== \"function\")\n" \
 164 " throw new @TypeError(\"Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function\");\n" \
 165 "\n" \
 166 " //\n" \
 167 " var result = (typeof thisObj === \"function\") ? @Object(new thisObj()) : [];\n" \
 168 "\n" \
 169 " var k = 0;\n" \
 170 " var iterator = iteratorMethod.@call(items);\n" \
 171 "\n" \
 172 " //\n" \
 173 " //\n" \
 174 " //\n" \
 175 " var wrapper = {\n" \
 176 " [@symbolIterator]() {\n" \
 177 " return iterator;\n" \
 178 " }\n" \
 179 " };\n" \
 180 "\n" \
 181 " for (var value of wrapper) {\n" \
 182 " if (mapFn)\n" \
 183 " @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
 184 " else\n" \
 185 " @putByValDirect(result, k, value);\n" \
 186 " k += 1;\n" \
 187 " }\n" \
 188 "\n" \
 189 " result.length = k;\n" \
 190 " return result;\n" \
 191 " }\n" \
 192 "\n" \
 193 " var arrayLike = @Object(items);\n" \
 194 " var arrayLikeLength = @toLength(arrayLike.length);\n" \
 195 "\n" \
 196 " //\n" \
 197 " var result = (typeof thisObj === \"function\") ? @Object(new thisObj(arrayLikeLength)) : new @Array(arrayLikeLength);\n" \
 198 "\n" \
 199 " var k = 0;\n" \
 200 " while (k < arrayLikeLength) {\n" \
 201 " var value = arrayLike[k];\n" \
 202 " if (mapFn)\n" \
 203 " @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
 204 " else\n" \
 205 " @putByValDirect(result, k, value);\n" \
 206 " k += 1;\n" \
 207 " }\n" \
 208 "\n" \
 209 " result.length = arrayLikeLength;\n" \
 210 " return result;\n" \
 211 "})\n" \
 212;
 213
 214
 215#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 216JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 217{\
 218 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 219JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 220#undef DEFINE_BUILTIN_GENERATOR
 221
 222
 223} // namespace JSC
 224### End File: JSCBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result

 1### Begin File: BuiltinConstructorBuiltins.h
 2/*
 3 * Copyright (c) 2015 Apple Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef BuiltinConstructorBuiltins_h
 32#define BuiltinConstructorBuiltins_h
 33
 34
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace JSC {
 41
 42/* BuiltinConstructor */
 43extern const char* s_builtinConstructorOfCode;
 44extern const int s_builtinConstructorOfCodeLength;
 45extern const JSC::ConstructAbility s_builtinConstructorOfCodeConstructAbility;
 46extern const char* s_builtinConstructorFromCode;
 47extern const int s_builtinConstructorFromCodeLength;
 48extern const JSC::ConstructAbility s_builtinConstructorFromCodeConstructAbility;
 49
 50#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_DATA(macro) \
 51 macro(of, builtinConstructorOf, 0) \
 52 macro(from, builtinConstructorFrom, 1) \
 53
 54#define JSC_BUILTIN_BUILTINCONSTRUCTOR_OF 1
 55#define JSC_BUILTIN_BUILTINCONSTRUCTOR_FROM 1
 56
 57#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(macro) \
 58 macro(builtinConstructorOfCode, of, s_builtinConstructorOfCodeLength) \
 59 macro(builtinConstructorFromCode, from, s_builtinConstructorFromCodeLength) \
 60
 61#define JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_FUNCTION_NAME(macro) \
 62 macro(from) \
 63 macro(of) \
 64
 65#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 66 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 67
 68JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 69#undef DECLARE_BUILTIN_GENERATOR
 70
 71#define JSC_BUILTIN_BUILTINCONSTRUCTOR_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 72
 73} // namespace JSC
 74
 75#endif // BuiltinConstructorBuiltins_h
 76
 77### End File: BuiltinConstructorBuiltins.h
 78
 79### Begin File: BuiltinConstructorBuiltins.cpp
 80/*
 81 * Copyright (c) 2015 Apple Inc. All rights reserved.
 82 *
 83 * Redistribution and use in source and binary forms, with or without
 84 * modification, are permitted provided that the following conditions
 85 * are met:
 86 * 1. Redistributions of source code must retain the above copyright
 87 * notice, this list of conditions and the following disclaimer.
 88 * 2. Redistributions in binary form must reproduce the above copyright
 89 * notice, this list of conditions and the following disclaimer in the
 90 * documentation and/or other materials provided with the distribution.
 91 *
 92 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 93 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 94 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 96 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 97 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 98 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 99 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 100 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 101 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 102 * THE POSSIBILITY OF SUCH DAMAGE.
 103 *
 104 */
 105
 106// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 107// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 108
 109#include "config.h"
 110#include "BuiltinConstructorBuiltins.h"
 111
 112#include "BuiltinExecutables.h"
 113#include "Executable.h"
 114#include "JSCellInlines.h"
 115#include "VM.h"
 116
 117namespace JSC {
 118
 119const JSC::ConstructAbility s_builtinConstructorOfCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 120const int s_builtinConstructorOfCodeLength = 294;
 121const char* s_builtinConstructorOfCode =
 122 "(function ()\n" \
 123 "{\n" \
 124 " \"use strict\";\n" \
 125 "\n" \
 126 " var length = arguments.length;\n" \
 127 " //\n" \
 128 " var array = typeof this === 'function' ? new this(length) : new @Array(length);\n" \
 129 " for (var k = 0; k < length; ++k)\n" \
 130 " @putByValDirect(array, k, arguments[k]);\n" \
 131 " array.length = length;\n" \
 132 " return array;\n" \
 133 "})\n" \
 134;
 135
 136const JSC::ConstructAbility s_builtinConstructorFromCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 137const int s_builtinConstructorFromCodeLength = 2046;
 138const char* s_builtinConstructorFromCode =
 139 "(function (items )\n" \
 140 "{\n" \
 141 " \"use strict\";\n" \
 142 "\n" \
 143 " var thisObj = this;\n" \
 144 "\n" \
 145 " var mapFn = arguments.length > 1 ? arguments[1] : undefined;\n" \
 146 "\n" \
 147 " var thisArg;\n" \
 148 "\n" \
 149 " if (mapFn !== undefined) {\n" \
 150 " if (typeof mapFn !== \"function\")\n" \
 151 " throw new @TypeError(\"Array.from requires that the second argument, when provided, be a function\");\n" \
 152 "\n" \
 153 " if (arguments.length > 2)\n" \
 154 " thisArg = arguments[2];\n" \
 155 " }\n" \
 156 "\n" \
 157 " if (items == null)\n" \
 158 " throw new @TypeError(\"Array.from requires an array-like object - not null or undefined\");\n" \
 159 "\n" \
 160 " var iteratorMethod = items[@symbolIterator];\n" \
 161 " if (iteratorMethod != null) {\n" \
 162 " if (typeof iteratorMethod !== \"function\")\n" \
 163 " throw new @TypeError(\"Array.from requires that the property of the first argument, items[Symbol.iterator], when exists, be a function\");\n" \
 164 "\n" \
 165 " //\n" \
 166 " var result = (typeof thisObj === \"function\") ? @Object(new thisObj()) : [];\n" \
 167 "\n" \
 168 " var k = 0;\n" \
 169 " var iterator = iteratorMethod.@call(items);\n" \
 170 "\n" \
 171 " //\n" \
 172 " //\n" \
 173 " //\n" \
 174 " var wrapper = {\n" \
 175 " [@symbolIterator]() {\n" \
 176 " return iterator;\n" \
 177 " }\n" \
 178 " };\n" \
 179 "\n" \
 180 " for (var value of wrapper) {\n" \
 181 " if (mapFn)\n" \
 182 " @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
 183 " else\n" \
 184 " @putByValDirect(result, k, value);\n" \
 185 " k += 1;\n" \
 186 " }\n" \
 187 "\n" \
 188 " result.length = k;\n" \
 189 " return result;\n" \
 190 " }\n" \
 191 "\n" \
 192 " var arrayLike = @Object(items);\n" \
 193 " var arrayLikeLength = @toLength(arrayLike.length);\n" \
 194 "\n" \
 195 " //\n" \
 196 " var result = (typeof thisObj === \"function\") ? @Object(new thisObj(arrayLikeLength)) : new @Array(arrayLikeLength);\n" \
 197 "\n" \
 198 " var k = 0;\n" \
 199 " while (k < arrayLikeLength) {\n" \
 200 " var value = arrayLike[k];\n" \
 201 " if (mapFn)\n" \
 202 " @putByValDirect(result, k, thisArg === undefined ? mapFn(value, k) : mapFn.@call(thisArg, value, k));\n" \
 203 " else\n" \
 204 " @putByValDirect(result, k, value);\n" \
 205 " k += 1;\n" \
 206 " }\n" \
 207 "\n" \
 208 " result.length = arrayLikeLength;\n" \
 209 " return result;\n" \
 210 "})\n" \
 211;
 212
 213
 214#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 215JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 216{\
 217 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 218JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 219#undef DEFINE_BUILTIN_GENERATOR
 220
 221
 222} // namespace JSC
 223### End File: BuiltinConstructorBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Operations.Promise-Combined.js-result

 1### Begin File: JSCBuiltins.h
 2/*
 3 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef JSCBuiltins_h
 32#define JSCBuiltins_h
 33
 34namespace JSC {
 35class FunctionExecutable;
 36class VM;
 37
 38enum class ConstructAbility : unsigned;
 39}
 40
 41namespace JSC {
 42
 43/* Operations.Promise */
 44extern const char* s_operationsPromiseIsPromiseCode;
 45extern const int s_operationsPromiseIsPromiseCodeLength;
 46extern const JSC::ConstructAbility s_operationsPromiseIsPromiseCodeConstructAbility;
 47extern const char* s_operationsPromiseNewPromiseReactionCode;
 48extern const int s_operationsPromiseNewPromiseReactionCodeLength;
 49extern const JSC::ConstructAbility s_operationsPromiseNewPromiseReactionCodeConstructAbility;
 50extern const char* s_operationsPromiseNewPromiseCapabilityCode;
 51extern const int s_operationsPromiseNewPromiseCapabilityCodeLength;
 52extern const JSC::ConstructAbility s_operationsPromiseNewPromiseCapabilityCodeConstructAbility;
 53extern const char* s_operationsPromiseTriggerPromiseReactionsCode;
 54extern const int s_operationsPromiseTriggerPromiseReactionsCodeLength;
 55extern const JSC::ConstructAbility s_operationsPromiseTriggerPromiseReactionsCodeConstructAbility;
 56extern const char* s_operationsPromiseRejectPromiseCode;
 57extern const int s_operationsPromiseRejectPromiseCodeLength;
 58extern const JSC::ConstructAbility s_operationsPromiseRejectPromiseCodeConstructAbility;
 59extern const char* s_operationsPromiseFulfillPromiseCode;
 60extern const int s_operationsPromiseFulfillPromiseCodeLength;
 61extern const JSC::ConstructAbility s_operationsPromiseFulfillPromiseCodeConstructAbility;
 62extern const char* s_operationsPromiseCreateResolvingFunctionsCode;
 63extern const int s_operationsPromiseCreateResolvingFunctionsCodeLength;
 64extern const JSC::ConstructAbility s_operationsPromiseCreateResolvingFunctionsCodeConstructAbility;
 65extern const char* s_operationsPromisePromiseReactionJobCode;
 66extern const int s_operationsPromisePromiseReactionJobCodeLength;
 67extern const JSC::ConstructAbility s_operationsPromisePromiseReactionJobCodeConstructAbility;
 68extern const char* s_operationsPromisePromiseResolveThenableJobCode;
 69extern const int s_operationsPromisePromiseResolveThenableJobCodeLength;
 70extern const JSC::ConstructAbility s_operationsPromisePromiseResolveThenableJobCodeConstructAbility;
 71extern const char* s_operationsPromiseInitializePromiseCode;
 72extern const int s_operationsPromiseInitializePromiseCodeLength;
 73extern const JSC::ConstructAbility s_operationsPromiseInitializePromiseCodeConstructAbility;
 74
 75#define JSC_FOREACH_OPERATIONSPROMISE_BUILTIN_DATA(macro) \
 76 macro(isPromise, operationsPromiseIsPromise, 1) \
 77 macro(newPromiseReaction, operationsPromiseNewPromiseReaction, 2) \
 78 macro(newPromiseCapability, operationsPromiseNewPromiseCapability, 1) \
 79 macro(triggerPromiseReactions, operationsPromiseTriggerPromiseReactions, 2) \
 80 macro(rejectPromise, operationsPromiseRejectPromise, 2) \
 81 macro(fulfillPromise, operationsPromiseFulfillPromise, 2) \
 82 macro(createResolvingFunctions, operationsPromiseCreateResolvingFunctions, 1) \
 83 macro(promiseReactionJob, operationsPromisePromiseReactionJob, 2) \
 84 macro(promiseResolveThenableJob, operationsPromisePromiseResolveThenableJob, 3) \
 85 macro(initializePromise, operationsPromiseInitializePromise, 1) \
 86
 87#define JSC_BUILTIN_OPERATIONSPROMISE_ISPROMISE 1
 88#define JSC_BUILTIN_OPERATIONSPROMISE_NEWPROMISEREACTION 1
 89#define JSC_BUILTIN_OPERATIONSPROMISE_NEWPROMISECAPABILITY 1
 90#define JSC_BUILTIN_OPERATIONSPROMISE_TRIGGERPROMISEREACTIONS 1
 91#define JSC_BUILTIN_OPERATIONSPROMISE_REJECTPROMISE 1
 92#define JSC_BUILTIN_OPERATIONSPROMISE_FULFILLPROMISE 1
 93#define JSC_BUILTIN_OPERATIONSPROMISE_CREATERESOLVINGFUNCTIONS 1
 94#define JSC_BUILTIN_OPERATIONSPROMISE_PROMISEREACTIONJOB 1
 95#define JSC_BUILTIN_OPERATIONSPROMISE_PROMISERESOLVETHENABLEJOB 1
 96#define JSC_BUILTIN_OPERATIONSPROMISE_INITIALIZEPROMISE 1
 97
 98#define JSC_FOREACH_BUILTIN_CODE(macro) \
 99 macro(operationsPromiseIsPromiseCode, isPromise, s_operationsPromiseIsPromiseCodeLength) \
 100 macro(operationsPromiseNewPromiseReactionCode, newPromiseReaction, s_operationsPromiseNewPromiseReactionCodeLength) \
 101 macro(operationsPromiseNewPromiseCapabilityCode, newPromiseCapability, s_operationsPromiseNewPromiseCapabilityCodeLength) \
 102 macro(operationsPromiseTriggerPromiseReactionsCode, triggerPromiseReactions, s_operationsPromiseTriggerPromiseReactionsCodeLength) \
 103 macro(operationsPromiseRejectPromiseCode, rejectPromise, s_operationsPromiseRejectPromiseCodeLength) \
 104 macro(operationsPromiseFulfillPromiseCode, fulfillPromise, s_operationsPromiseFulfillPromiseCodeLength) \
 105 macro(operationsPromiseCreateResolvingFunctionsCode, createResolvingFunctions, s_operationsPromiseCreateResolvingFunctionsCodeLength) \
 106 macro(operationsPromisePromiseReactionJobCode, promiseReactionJob, s_operationsPromisePromiseReactionJobCodeLength) \
 107 macro(operationsPromisePromiseResolveThenableJobCode, promiseResolveThenableJob, s_operationsPromisePromiseResolveThenableJobCodeLength) \
 108 macro(operationsPromiseInitializePromiseCode, initializePromise, s_operationsPromiseInitializePromiseCodeLength) \
 109
 110#define JSC_FOREACH_BUILTIN_FUNCTION_NAME(macro) \
 111 macro(createResolvingFunctions) \
 112 macro(fulfillPromise) \
 113 macro(initializePromise) \
 114 macro(isPromise) \
 115 macro(newPromiseCapability) \
 116 macro(newPromiseReaction) \
 117 macro(promiseReactionJob) \
 118 macro(promiseResolveThenableJob) \
 119 macro(rejectPromise) \
 120 macro(triggerPromiseReactions) \
 121
 122#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 123 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 124
 125JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 126#undef DECLARE_BUILTIN_GENERATOR
 127
 128#define JSC_BUILTIN_EXISTS(object, func) defined JSC_BUILTIN_ ## object ## _ ## func
 129
 130} // namespace JSC
 131
 132#endif // JSCBuiltins_h
 133
 134### End File: JSCBuiltins.h
 135
 136### Begin File: JSCBuiltins.cpp
 137/*
 138 * Copyright (c) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
 139 *
 140 * Redistribution and use in source and binary forms, with or without
 141 * modification, are permitted provided that the following conditions
 142 * are met:
 143 * 1. Redistributions of source code must retain the above copyright
 144 * notice, this list of conditions and the following disclaimer.
 145 * 2. Redistributions in binary form must reproduce the above copyright
 146 * notice, this list of conditions and the following disclaimer in the
 147 * documentation and/or other materials provided with the distribution.
 148 *
 149 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 150 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 151 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 152 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 153 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 154 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 155 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 156 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 157 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 158 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 159 * THE POSSIBILITY OF SUCH DAMAGE.
 160 *
 161 */
 162
 163// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 164// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 165
 166#include "config.h"
 167#include "JSCBuiltins.h"
 168
 169#include "BuiltinExecutables.h"
 170#include "Executable.h"
 171#include "JSCellInlines.h"
 172#include "VM.h"
 173
 174namespace JSC {
 175
 176const JSC::ConstructAbility s_operationsPromiseIsPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 177const int s_operationsPromiseIsPromiseCodeLength = 158;
 178const char* s_operationsPromiseIsPromiseCode =
 179 "(function (promise)\n" \
 180 "{\n" \
 181 " \"use strict\";\n" \
 182 "\n" \
 183 " return @isObject(promise) && !!promise.@promiseState;\n" \
 184 "})\n" \
 185;
 186
 187const JSC::ConstructAbility s_operationsPromiseNewPromiseReactionCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 188const int s_operationsPromiseNewPromiseReactionCodeLength = 220;
 189const char* s_operationsPromiseNewPromiseReactionCode =
 190 "(function (capability, handler)\n" \
 191 "{\n" \
 192 " \"use strict\";\n" \
 193 "\n" \
 194 " return {\n" \
 195 " @capabilities: capability,\n" \
 196 " @handler: handler\n" \
 197 " };\n" \
 198 "})\n" \
 199;
 200
 201const JSC::ConstructAbility s_operationsPromiseNewPromiseCapabilityCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 202const int s_operationsPromiseNewPromiseCapabilityCodeLength = 1427;
 203const char* s_operationsPromiseNewPromiseCapabilityCode =
 204 "(function (constructor)\n" \
 205 "{\n" \
 206 " \"use strict\";\n" \
 207 "\n" \
 208 " //\n" \
 209 " if (typeof constructor !== \"function\")\n" \
 210 " throw new @TypeError(\"promise capability requires a constructor function\");\n" \
 211 "\n" \
 212 " var promiseCapability = {\n" \
 213 " @promise: undefined,\n" \
 214 " @resolve: undefined,\n" \
 215 " @reject: undefined\n" \
 216 " };\n" \
 217 "\n" \
 218 " function executor(resolve, reject)\n" \
 219 " {\n" \
 220 " if (promiseCapability.@resolve !== undefined)\n" \
 221 " throw new @TypeError(\"resolve function is already set\");\n" \
 222 " if (promiseCapability.@reject !== undefined)\n" \
 223 " throw new @TypeError(\"reject function is already set\");\n" \
 224 "\n" \
 225 " promiseCapability.@resolve = resolve;\n" \
 226 " promiseCapability.@reject = reject;\n" \
 227 " }\n" \
 228 "\n" \
 229 " var promise = new constructor(executor);\n" \
 230 "\n" \
 231 " if (typeof promiseCapability.@resolve !== \"function\")\n" \
 232 " throw new @TypeError(\"executor did not take a resolve function\");\n" \
 233 "\n" \
 234 " if (typeof promiseCapability.@reject !== \"function\")\n" \
 235 " throw new @TypeError(\"executor did not take a reject function\");\n" \
 236 "\n" \
 237 " promiseCapability.@promise = promise;\n" \
 238 "\n" \
 239 " return promiseCapability;\n" \
 240 "})\n" \
 241;
 242
 243const JSC::ConstructAbility s_operationsPromiseTriggerPromiseReactionsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 244const int s_operationsPromiseTriggerPromiseReactionsCodeLength = 269;
 245const char* s_operationsPromiseTriggerPromiseReactionsCode =
 246 "(function (reactions, argument)\n" \
 247 "{\n" \
 248 " \"use strict\";\n" \
 249 "\n" \
 250 " for (var index = 0, length = reactions.length; index < length; ++index)\n" \
 251 " @enqueueJob(@promiseReactionJob, [reactions[index], argument]);\n" \
 252 "})\n" \
 253;
 254
 255const JSC::ConstructAbility s_operationsPromiseRejectPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 256const int s_operationsPromiseRejectPromiseCodeLength = 541;
 257const char* s_operationsPromiseRejectPromiseCode =
 258 "(function (promise, reason)\n" \
 259 "{\n" \
 260 " \"use strict\";\n" \
 261 "\n" \
 262 " var reactions = promise.@promiseRejectReactions;\n" \
 263 " promise.@promiseResult = reason;\n" \
 264 " promise.@promiseFulfillReactions = undefined;\n" \
 265 " promise.@promiseRejectReactions = undefined;\n" \
 266 " promise.@promiseState = @promiseRejected;\n" \
 267 "\n" \
 268 " @InspectorInstrumentation.promiseRejected(promise, reason, reactions);\n" \
 269 "\n" \
 270 " @triggerPromiseReactions(reactions, reason);\n" \
 271 "})\n" \
 272;
 273
 274const JSC::ConstructAbility s_operationsPromiseFulfillPromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 275const int s_operationsPromiseFulfillPromiseCodeLength = 540;
 276const char* s_operationsPromiseFulfillPromiseCode =
 277 "(function (promise, value)\n" \
 278 "{\n" \
 279 " \"use strict\";\n" \
 280 "\n" \
 281 " var reactions = promise.@promiseFulfillReactions;\n" \
 282 " promise.@promiseResult = value;\n" \
 283 " promise.@promiseFulfillReactions = undefined;\n" \
 284 " promise.@promiseRejectReactions = undefined;\n" \
 285 " promise.@promiseState = @promiseFulfilled;\n" \
 286 "\n" \
 287 " @InspectorInstrumentation.promiseFulfilled(promise, value, reactions);\n" \
 288 "\n" \
 289 " @triggerPromiseReactions(reactions, value);\n" \
 290 "})\n" \
 291;
 292
 293const JSC::ConstructAbility s_operationsPromiseCreateResolvingFunctionsCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 294const int s_operationsPromiseCreateResolvingFunctionsCodeLength = 1468;
 295const char* s_operationsPromiseCreateResolvingFunctionsCode =
 296 "(function (promise)\n" \
 297 "{\n" \
 298 " \"use strict\";\n" \
 299 "\n" \
 300 " var alreadyResolved = false;\n" \
 301 "\n" \
 302 " var resolve = function (resolution) {\n" \
 303 " if (alreadyResolved)\n" \
 304 " return undefined;\n" \
 305 " alreadyResolved = true;\n" \
 306 "\n" \
 307 " if (resolution === promise)\n" \
 308 " return @rejectPromise(promise, new @TypeError(\"Resolve a promise with itself\"));\n" \
 309 "\n" \
 310 " if (!@isObject(resolution))\n" \
 311 " return @fulfillPromise(promise, resolution);\n" \
 312 "\n" \
 313 " var then;\n" \
 314 " try {\n" \
 315 " then = resolution.then;\n" \
 316 " } catch (error) {\n" \
 317 " return @rejectPromise(promise, error);\n" \
 318 " }\n" \
 319 "\n" \
 320 " if (typeof then !== 'function')\n" \
 321 " return @fulfillPromise(promise, resolution);\n" \
 322 "\n" \
 323 " @enqueueJob(@promiseResolveThenableJob, [promise, resolution, then]);\n" \
 324 "\n" \
 325 " return undefined;\n" \
 326 " };\n" \
 327 "\n" \
 328 " var reject = function (reason) {\n" \
 329 " if (alreadyResolved)\n" \
 330 " return undefined;\n" \
 331 " alreadyResolved = true;\n" \
 332 "\n" \
 333 " return @rejectPromise(promise, reason);\n" \
 334 " };\n" \
 335 "\n" \
 336 " return {\n" \
 337 " @resolve: resolve,\n" \
 338 " @reject: reject\n" \
 339 " };\n" \
 340 "})\n" \
 341;
 342
 343const JSC::ConstructAbility s_operationsPromisePromiseReactionJobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 344const int s_operationsPromisePromiseReactionJobCodeLength = 493;
 345const char* s_operationsPromisePromiseReactionJobCode =
 346 "(function (reaction, argument)\n" \
 347 "{\n" \
 348 " \"use strict\";\n" \
 349 "\n" \
 350 " var promiseCapability = reaction.@capabilities;\n" \
 351 "\n" \
 352 " var result;\n" \
 353 " try {\n" \
 354 " result = reaction.@handler.@call(undefined, argument);\n" \
 355 " } catch (error) {\n" \
 356 " return promiseCapability.@reject.@call(undefined, error);\n" \
 357 " }\n" \
 358 "\n" \
 359 " return promiseCapability.@resolve.@call(undefined, result);\n" \
 360 "})\n" \
 361;
 362
 363const JSC::ConstructAbility s_operationsPromisePromiseResolveThenableJobCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 364const int s_operationsPromisePromiseResolveThenableJobCodeLength = 453;
 365const char* s_operationsPromisePromiseResolveThenableJobCode =
 366 "(function (promiseToResolve, thenable, then)\n" \
 367 "{\n" \
 368 " \"use strict\";\n" \
 369 "\n" \
 370 " var resolvingFunctions = @createResolvingFunctions(promiseToResolve);\n" \
 371 "\n" \
 372 " try {\n" \
 373 " return then.@call(thenable, resolvingFunctions.@resolve, resolvingFunctions.@reject);\n" \
 374 " } catch (error) {\n" \
 375 " return resolvingFunctions.@reject.@call(undefined, error);\n" \
 376 " }\n" \
 377 "})\n" \
 378;
 379
 380const JSC::ConstructAbility s_operationsPromiseInitializePromiseCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 381const int s_operationsPromiseInitializePromiseCodeLength = 731;
 382const char* s_operationsPromiseInitializePromiseCode =
 383 "(function (executor)\n" \
 384 "{\n" \
 385 " \"use strict\";\n" \
 386 "\n" \
 387 " if (typeof executor !== 'function')\n" \
 388 " throw new @TypeError(\"Promise constructor takes a function argument\");\n" \
 389 "\n" \
 390 " this.@promiseState = @promisePending;\n" \
 391 " this.@promiseFulfillReactions = [];\n" \
 392 " this.@promiseRejectReactions = [];\n" \
 393 "\n" \
 394 " var resolvingFunctions = @createResolvingFunctions(this);\n" \
 395 " try {\n" \
 396 " executor(resolvingFunctions.@resolve, resolvingFunctions.@reject);\n" \
 397 " } catch (error) {\n" \
 398 " return resolvingFunctions.@reject.@call(undefined, error);\n" \
 399 " }\n" \
 400 "\n" \
 401 " return this;\n" \
 402 "})\n" \
 403;
 404
 405
 406#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 407JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 408{\
 409 return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source()); }
 410JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 411#undef DEFINE_BUILTIN_GENERATOR
 412
 413
 414} // namespace JSC
 415### End File: JSCBuiltins.cpp

Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result

 1### Begin File: GuardedBuiltinBuiltins.h
 2/*
 3 * Copyright (c) 2015 Canon Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef GuardedBuiltinBuiltins_h
 32#define GuardedBuiltinBuiltins_h
 33
 34#include <builtins/BuiltinUtils.h>
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace WebCore {
 41
 42/* GuardedBuiltin */
 43extern const char* s_guardedBuiltinIsReadableStreamLockedCode;
 44extern const int s_guardedBuiltinIsReadableStreamLockedCodeLength;
 45extern const JSC::ConstructAbility s_guardedBuiltinIsReadableStreamLockedCodeConstructAbility;
 46extern const char* s_guardedBuiltinCancelReadableStreamCode;
 47extern const int s_guardedBuiltinCancelReadableStreamCodeLength;
 48extern const JSC::ConstructAbility s_guardedBuiltinCancelReadableStreamCodeConstructAbility;
 49extern const char* s_guardedBuiltinPromiseInvokeOrNoopCode;
 50extern const int s_guardedBuiltinPromiseInvokeOrNoopCodeLength;
 51extern const JSC::ConstructAbility s_guardedBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 52
 53#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_DATA(macro) \
 54 macro(isReadableStreamLocked, guardedBuiltinIsReadableStreamLocked, 1) \
 55 macro(cancelReadableStream, guardedBuiltinCancelReadableStream, 2) \
 56 macro(promiseInvokeOrNoop, guardedBuiltinPromiseInvokeOrNoop, 3) \
 57
 58#define WEBCORE_BUILTIN_GUARDEDBUILTIN_ISREADABLESTREAMLOCKED 1
 59#define WEBCORE_BUILTIN_GUARDEDBUILTIN_CANCELREADABLESTREAM 1
 60#define WEBCORE_BUILTIN_GUARDEDBUILTIN_PROMISEINVOKEORNOOP 1
 61
 62#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(macro) \
 63 macro(guardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedBuiltinIsReadableStreamLockedCodeLength) \
 64 macro(guardedBuiltinCancelReadableStreamCode, cancelReadableStream, s_guardedBuiltinCancelReadableStreamCodeLength) \
 65 macro(guardedBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_guardedBuiltinPromiseInvokeOrNoopCodeLength) \
 66
 67#define WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
 68 macro(cancelReadableStream) \
 69 macro(isReadableStreamLocked) \
 70 macro(promiseInvokeOrNoop) \
 71
 72#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 73 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 74
 75WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 76#undef DECLARE_BUILTIN_GENERATOR
 77
 78#define WEBCORE_BUILTIN_GUARDEDBUILTIN_EXISTS(object, func) defined WEBCORE_BUILTIN_ ## object ## _ ## func
 79
 80} // namespace WebCore
 81
 82#endif // GuardedBuiltinBuiltins_h
 83
 84### End File: GuardedBuiltinBuiltins.h
 85
 86### Begin File: GuardedBuiltinBuiltins.cpp
 87/*
 88 * Copyright (c) 2015 Canon Inc. All rights reserved.
 89 *
 90 * Redistribution and use in source and binary forms, with or without
 91 * modification, are permitted provided that the following conditions
 92 * are met:
 93 * 1. Redistributions of source code must retain the above copyright
 94 * notice, this list of conditions and the following disclaimer.
 95 * 2. Redistributions in binary form must reproduce the above copyright
 96 * notice, this list of conditions and the following disclaimer in the
 97 * documentation and/or other materials provided with the distribution.
 98 *
 99 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 100 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 101 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 102 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 103 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 104 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 105 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 106 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 107 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 108 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 109 * THE POSSIBILITY OF SUCH DAMAGE.
 110 *
 111 */
 112
 113// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 114// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 115
 116#include "config.h"
 117#include "GuardedBuiltinBuiltins.h"
 118
 119#include "WebCoreJSClientData.h"
 120#include <runtime/Executable.h>
 121#include <runtime/JSCJSValueInlines.h>
 122#include <runtime/JSCellInlines.h>
 123#include <runtime/StructureInlines.h>
 124#include <runtime/VM.h>
 125
 126namespace WebCore {
 127
 128const JSC::ConstructAbility s_guardedBuiltinIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 129const int s_guardedBuiltinIsReadableStreamLockedCodeLength = 71;
 130const char* s_guardedBuiltinIsReadableStreamLockedCode =
 131 "(function (stream)\n" \
 132 "{\n" \
 133 " \"use strict\";\n" \
 134 "\n" \
 135 " return !!stream.@reader;\n" \
 136 "})\n" \
 137;
 138
 139const JSC::ConstructAbility s_guardedBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 140const int s_guardedBuiltinCancelReadableStreamCodeLength = 402;
 141const char* s_guardedBuiltinCancelReadableStreamCode =
 142 "(function (stream, reason)\n" \
 143 "{\n" \
 144 " \"use strict\";\n" \
 145 "\n" \
 146 " if (stream.@state === @readableStreamClosed)\n" \
 147 " return Promise.resolve();\n" \
 148 " if (stream.@state === @readableStreamErrored)\n" \
 149 " return Promise.reject(stream.@storedError);\n" \
 150 " stream.@queue = [];\n" \
 151 " @finishClosingReadableStream(stream);\n" \
 152 " return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
 153 "})\n" \
 154;
 155
 156const JSC::ConstructAbility s_guardedBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 157const int s_guardedBuiltinPromiseInvokeOrNoopCodeLength = 338;
 158const char* s_guardedBuiltinPromiseInvokeOrNoopCode =
 159 "(function (object, key, args)\n" \
 160 "{\n" \
 161 " \"use strict\";\n" \
 162 "\n" \
 163 " try {\n" \
 164 " var method = object[key];\n" \
 165 " if (typeof method === \"undefined\")\n" \
 166 " return Promise.resolve();\n" \
 167 " var result = method.@apply(object, args);\n" \
 168 " return Promise.resolve(result);\n" \
 169 " }\n" \
 170 " catch(error) {\n" \
 171 " return Promise.reject(error);\n" \
 172 " }\n" \
 173 "})\n" \
 174;
 175
 176
 177#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 178JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 179{\
 180 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
 181 return clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Source()); \
 182}
 183WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 184#undef DEFINE_BUILTIN_GENERATOR
 185
 186
 187} // namespace WebCore
 188### End File: GuardedBuiltinBuiltins.cpp
 189
 190### Begin File: GuardedBuiltinBuiltinsWrapper.h
 191/*
 192 * Copyright (c) 2015 Canon Inc. All rights reserved.
 193 *
 194 * Redistribution and use in source and binary forms, with or without
 195 * modification, are permitted provided that the following conditions
 196 * are met:
 197 * 1. Redistributions of source code must retain the above copyright
 198 * notice, this list of conditions and the following disclaimer.
 199 * 2. Redistributions in binary form must reproduce the above copyright
 200 * notice, this list of conditions and the following disclaimer in the
 201 * documentation and/or other materials provided with the distribution.
 202 *
 203 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 204 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 205 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 206 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 207 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 208 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 209 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 210 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 211 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 212 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 213 * THE POSSIBILITY OF SUCH DAMAGE.
 214 *
 215 */
 216
 217// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 218// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 219
 220#ifndef GuardedBuiltinBuiltinsWrapper_h
 221#define GuardedBuiltinBuiltinsWrapper_h
 222
 223#include "GuardedBuiltinBuiltins.h"
 224#include <builtins/BuiltinUtils.h>
 225#include <bytecode/UnlinkedFunctionExecutable.h>
 226#include <runtime/Identifier.h>
 227#include <runtime/JSFunction.h>
 228
 229namespace WebCore {
 230
 231class GuardedBuiltinBuiltinsWrapper : private JSC::WeakHandleOwner {
 232public:
 233 explicit GuardedBuiltinBuiltinsWrapper(JSC::VM* vm)
 234 : m_vm(*vm)
 235 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
 236#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
 237 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 238#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 239 {
 240 }
 241
 242#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
 243 JSC::UnlinkedFunctionExecutable* name##Executable(); \
 244 const JSC::SourceCode& name##Source() const { return m_##name##Source; }
 245 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
 246#undef EXPOSE_BUILTIN_EXECUTABLES
 247
 248 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
 249
 250 void exportNames();
 251
 252private:
 253 JSC::VM& m_vm;
 254
 255 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
 256
 257#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
 258 JSC::SourceCode m_##name##Source;\
 259 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
 260 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
 261#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 262
 263};
 264
 265#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
 266inline JSC::UnlinkedFunctionExecutable* GuardedBuiltinBuiltinsWrapper::name##Executable() \
 267{\
 268 if (!m_##name##Executable)\
 269 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
 270 return m_##name##Executable.get();\
 271}
 272WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
 273#undef DEFINE_BUILTIN_EXECUTABLES
 274
 275inline void GuardedBuiltinBuiltinsWrapper::exportNames()
 276{
 277#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
 278 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
 279#undef EXPORT_FUNCTION_NAME
 280}
 281
 282class GuardedBuiltinBuiltinFunctions {
 283public:
 284 explicit GuardedBuiltinBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
 285
 286 void init(JSC::JSGlobalObject&);
 287 void visit(JSC::SlotVisitor&);
 288
 289public:
 290 JSC::VM& m_vm;
 291
 292#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
 293 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
 294 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
 295#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 296};
 297
 298inline void GuardedBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
 299{
 300#define EXPORT_FUNCTION(codeName, functionName, length)\
 301 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
 302 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
 303#undef EXPORT_FUNCTION
 304}
 305
 306inline void GuardedBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 307{
 308#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
 309 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
 310#undef VISIT_FUNCTION
 311}
 312
 313
 314} // namespace WebCore
 315
 316#endif // GuardedBuiltinBuiltinsWrapper_h
 317
 318### End File: GuardedBuiltinBuiltinsWrapper.h

Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result

 1### Begin File: GuardedInternalBuiltinBuiltins.h
 2/*
 3 * Copyright (c) 2015 Canon Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef GuardedInternalBuiltinBuiltins_h
 32#define GuardedInternalBuiltinBuiltins_h
 33
 34#include <builtins/BuiltinUtils.h>
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace WebCore {
 41
 42/* GuardedInternalBuiltin */
 43extern const char* s_guardedInternalBuiltinIsReadableStreamLockedCode;
 44extern const int s_guardedInternalBuiltinIsReadableStreamLockedCodeLength;
 45extern const JSC::ConstructAbility s_guardedInternalBuiltinIsReadableStreamLockedCodeConstructAbility;
 46extern const char* s_guardedInternalBuiltinCancelReadableStreamCode;
 47extern const int s_guardedInternalBuiltinCancelReadableStreamCodeLength;
 48extern const JSC::ConstructAbility s_guardedInternalBuiltinCancelReadableStreamCodeConstructAbility;
 49extern const char* s_guardedInternalBuiltinPromiseInvokeOrNoopCode;
 50extern const int s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength;
 51extern const JSC::ConstructAbility s_guardedInternalBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 52
 53#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_DATA(macro) \
 54 macro(isReadableStreamLocked, guardedInternalBuiltinIsReadableStreamLocked, 1) \
 55 macro(cancelReadableStream, guardedInternalBuiltinCancelReadableStream, 2) \
 56 macro(promiseInvokeOrNoop, guardedInternalBuiltinPromiseInvokeOrNoop, 3) \
 57
 58#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_ISREADABLESTREAMLOCKED 1
 59#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_CANCELREADABLESTREAM 1
 60#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_PROMISEINVOKEORNOOP 1
 61
 62#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(macro) \
 63 macro(guardedInternalBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_guardedInternalBuiltinIsReadableStreamLockedCodeLength) \
 64 macro(guardedInternalBuiltinCancelReadableStreamCode, cancelReadableStream, s_guardedInternalBuiltinCancelReadableStreamCodeLength) \
 65 macro(guardedInternalBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength) \
 66
 67#define WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
 68 macro(cancelReadableStream) \
 69 macro(isReadableStreamLocked) \
 70 macro(promiseInvokeOrNoop) \
 71
 72#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 73 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 74
 75WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 76#undef DECLARE_BUILTIN_GENERATOR
 77
 78#define WEBCORE_BUILTIN_GUARDEDINTERNALBUILTIN_EXISTS(object, func) defined WEBCORE_BUILTIN_ ## object ## _ ## func
 79
 80} // namespace WebCore
 81
 82#endif // GuardedInternalBuiltinBuiltins_h
 83
 84### End File: GuardedInternalBuiltinBuiltins.h
 85
 86### Begin File: GuardedInternalBuiltinBuiltins.cpp
 87/*
 88 * Copyright (c) 2015 Canon Inc. All rights reserved.
 89 *
 90 * Redistribution and use in source and binary forms, with or without
 91 * modification, are permitted provided that the following conditions
 92 * are met:
 93 * 1. Redistributions of source code must retain the above copyright
 94 * notice, this list of conditions and the following disclaimer.
 95 * 2. Redistributions in binary form must reproduce the above copyright
 96 * notice, this list of conditions and the following disclaimer in the
 97 * documentation and/or other materials provided with the distribution.
 98 *
 99 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 100 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 101 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 102 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 103 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 104 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 105 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 106 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 107 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 108 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 109 * THE POSSIBILITY OF SUCH DAMAGE.
 110 *
 111 */
 112
 113// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 114// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 115
 116#include "config.h"
 117#include "GuardedInternalBuiltinBuiltins.h"
 118
 119#include "WebCoreJSClientData.h"
 120#include <runtime/Executable.h>
 121#include <runtime/JSCJSValueInlines.h>
 122#include <runtime/JSCellInlines.h>
 123#include <runtime/StructureInlines.h>
 124#include <runtime/VM.h>
 125
 126namespace WebCore {
 127
 128const JSC::ConstructAbility s_guardedInternalBuiltinIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 129const int s_guardedInternalBuiltinIsReadableStreamLockedCodeLength = 71;
 130const char* s_guardedInternalBuiltinIsReadableStreamLockedCode =
 131 "(function (stream)\n" \
 132 "{\n" \
 133 " \"use strict\";\n" \
 134 "\n" \
 135 " return !!stream.@reader;\n" \
 136 "})\n" \
 137;
 138
 139const JSC::ConstructAbility s_guardedInternalBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 140const int s_guardedInternalBuiltinCancelReadableStreamCodeLength = 402;
 141const char* s_guardedInternalBuiltinCancelReadableStreamCode =
 142 "(function (stream, reason)\n" \
 143 "{\n" \
 144 " \"use strict\";\n" \
 145 "\n" \
 146 " if (stream.@state === @readableStreamClosed)\n" \
 147 " return Promise.resolve();\n" \
 148 " if (stream.@state === @readableStreamErrored)\n" \
 149 " return Promise.reject(stream.@storedError);\n" \
 150 " stream.@queue = [];\n" \
 151 " @finishClosingReadableStream(stream);\n" \
 152 " return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
 153 "})\n" \
 154;
 155
 156const JSC::ConstructAbility s_guardedInternalBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 157const int s_guardedInternalBuiltinPromiseInvokeOrNoopCodeLength = 338;
 158const char* s_guardedInternalBuiltinPromiseInvokeOrNoopCode =
 159 "(function (object, key, args)\n" \
 160 "{\n" \
 161 " \"use strict\";\n" \
 162 "\n" \
 163 " try {\n" \
 164 " var method = object[key];\n" \
 165 " if (typeof method === \"undefined\")\n" \
 166 " return Promise.resolve();\n" \
 167 " var result = method.@apply(object, args);\n" \
 168 " return Promise.resolve(result);\n" \
 169 " }\n" \
 170 " catch(error) {\n" \
 171 " return Promise.reject(error);\n" \
 172 " }\n" \
 173 "})\n" \
 174;
 175
 176
 177#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 178JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 179{\
 180 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
 181 return clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Source()); \
 182}
 183WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 184#undef DEFINE_BUILTIN_GENERATOR
 185
 186
 187} // namespace WebCore
 188### End File: GuardedInternalBuiltinBuiltins.cpp
 189
 190### Begin File: GuardedInternalBuiltinBuiltinsWrapper.h
 191/*
 192 * Copyright (c) 2015 Canon Inc. All rights reserved.
 193 *
 194 * Redistribution and use in source and binary forms, with or without
 195 * modification, are permitted provided that the following conditions
 196 * are met:
 197 * 1. Redistributions of source code must retain the above copyright
 198 * notice, this list of conditions and the following disclaimer.
 199 * 2. Redistributions in binary form must reproduce the above copyright
 200 * notice, this list of conditions and the following disclaimer in the
 201 * documentation and/or other materials provided with the distribution.
 202 *
 203 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 204 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 205 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 206 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 207 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 208 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 209 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 210 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 211 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 212 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 213 * THE POSSIBILITY OF SUCH DAMAGE.
 214 *
 215 */
 216
 217// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 218// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 219
 220#ifndef GuardedInternalBuiltinBuiltinsWrapper_h
 221#define GuardedInternalBuiltinBuiltinsWrapper_h
 222
 223#include "GuardedInternalBuiltinBuiltins.h"
 224#include <builtins/BuiltinUtils.h>
 225#include <bytecode/UnlinkedFunctionExecutable.h>
 226#include <runtime/Identifier.h>
 227#include <runtime/JSFunction.h>
 228
 229namespace WebCore {
 230
 231class GuardedInternalBuiltinBuiltinsWrapper : private JSC::WeakHandleOwner {
 232public:
 233 explicit GuardedInternalBuiltinBuiltinsWrapper(JSC::VM* vm)
 234 : m_vm(*vm)
 235 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
 236#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
 237 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 238#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 239 {
 240 }
 241
 242#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
 243 JSC::UnlinkedFunctionExecutable* name##Executable(); \
 244 const JSC::SourceCode& name##Source() const { return m_##name##Source; }
 245 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
 246#undef EXPOSE_BUILTIN_EXECUTABLES
 247
 248 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
 249
 250 void exportNames();
 251
 252private:
 253 JSC::VM& m_vm;
 254
 255 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
 256
 257#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
 258 JSC::SourceCode m_##name##Source;\
 259 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
 260 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
 261#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 262
 263};
 264
 265#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
 266inline JSC::UnlinkedFunctionExecutable* GuardedInternalBuiltinBuiltinsWrapper::name##Executable() \
 267{\
 268 if (!m_##name##Executable)\
 269 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
 270 return m_##name##Executable.get();\
 271}
 272WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
 273#undef DEFINE_BUILTIN_EXECUTABLES
 274
 275inline void GuardedInternalBuiltinBuiltinsWrapper::exportNames()
 276{
 277#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
 278 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
 279#undef EXPORT_FUNCTION_NAME
 280}
 281
 282class GuardedInternalBuiltinBuiltinFunctions {
 283public:
 284 explicit GuardedInternalBuiltinBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
 285
 286 void init(JSC::JSGlobalObject&);
 287 void visit(JSC::SlotVisitor&);
 288
 289public:
 290 JSC::VM& m_vm;
 291
 292#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
 293 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
 294 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
 295#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 296};
 297
 298inline void GuardedInternalBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
 299{
 300#define EXPORT_FUNCTION(codeName, functionName, length)\
 301 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
 302 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
 303#undef EXPORT_FUNCTION
 304}
 305
 306inline void GuardedInternalBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 307{
 308#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
 309 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
 310#undef VISIT_FUNCTION
 311}
 312
 313
 314} // namespace WebCore
 315
 316#endif // GuardedInternalBuiltinBuiltinsWrapper_h
 317
 318### End File: GuardedInternalBuiltinBuiltinsWrapper.h

Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result

 1### Begin File: UnguardedBuiltinBuiltins.h
 2/*
 3 * Copyright (c) 2015 Canon Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef UnguardedBuiltinBuiltins_h
 32#define UnguardedBuiltinBuiltins_h
 33
 34#include <builtins/BuiltinUtils.h>
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace WebCore {
 41
 42/* UnguardedBuiltin */
 43extern const char* s_unguardedBuiltinIsReadableStreamLockedCode;
 44extern const int s_unguardedBuiltinIsReadableStreamLockedCodeLength;
 45extern const JSC::ConstructAbility s_unguardedBuiltinIsReadableStreamLockedCodeConstructAbility;
 46extern const char* s_unguardedBuiltinCancelReadableStreamCode;
 47extern const int s_unguardedBuiltinCancelReadableStreamCodeLength;
 48extern const JSC::ConstructAbility s_unguardedBuiltinCancelReadableStreamCodeConstructAbility;
 49extern const char* s_unguardedBuiltinPromiseInvokeOrNoopCode;
 50extern const int s_unguardedBuiltinPromiseInvokeOrNoopCodeLength;
 51extern const JSC::ConstructAbility s_unguardedBuiltinPromiseInvokeOrNoopCodeConstructAbility;
 52
 53#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_DATA(macro) \
 54 macro(isReadableStreamLocked, unguardedBuiltinIsReadableStreamLocked, 1) \
 55 macro(cancelReadableStream, unguardedBuiltinCancelReadableStream, 2) \
 56 macro(promiseInvokeOrNoop, unguardedBuiltinPromiseInvokeOrNoop, 3) \
 57
 58#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_ISREADABLESTREAMLOCKED 1
 59#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_CANCELREADABLESTREAM 1
 60#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_PROMISEINVOKEORNOOP 1
 61
 62#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(macro) \
 63 macro(unguardedBuiltinIsReadableStreamLockedCode, isReadableStreamLocked, s_unguardedBuiltinIsReadableStreamLockedCodeLength) \
 64 macro(unguardedBuiltinCancelReadableStreamCode, cancelReadableStream, s_unguardedBuiltinCancelReadableStreamCodeLength) \
 65 macro(unguardedBuiltinPromiseInvokeOrNoopCode, promiseInvokeOrNoop, s_unguardedBuiltinPromiseInvokeOrNoopCodeLength) \
 66
 67#define WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(macro) \
 68 macro(cancelReadableStream) \
 69 macro(isReadableStreamLocked) \
 70 macro(promiseInvokeOrNoop) \
 71
 72#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 73 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 74
 75WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 76#undef DECLARE_BUILTIN_GENERATOR
 77
 78#define WEBCORE_BUILTIN_UNGUARDEDBUILTIN_EXISTS(object, func) defined WEBCORE_BUILTIN_ ## object ## _ ## func
 79
 80} // namespace WebCore
 81
 82#endif // UnguardedBuiltinBuiltins_h
 83
 84### End File: UnguardedBuiltinBuiltins.h
 85
 86### Begin File: UnguardedBuiltinBuiltins.cpp
 87/*
 88 * Copyright (c) 2015 Canon Inc. All rights reserved.
 89 *
 90 * Redistribution and use in source and binary forms, with or without
 91 * modification, are permitted provided that the following conditions
 92 * are met:
 93 * 1. Redistributions of source code must retain the above copyright
 94 * notice, this list of conditions and the following disclaimer.
 95 * 2. Redistributions in binary form must reproduce the above copyright
 96 * notice, this list of conditions and the following disclaimer in the
 97 * documentation and/or other materials provided with the distribution.
 98 *
 99 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 100 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 101 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 102 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 103 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 104 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 105 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 106 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 107 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 108 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 109 * THE POSSIBILITY OF SUCH DAMAGE.
 110 *
 111 */
 112
 113// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 114// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 115
 116#include "config.h"
 117#include "UnguardedBuiltinBuiltins.h"
 118
 119#include "WebCoreJSClientData.h"
 120#include <runtime/Executable.h>
 121#include <runtime/JSCJSValueInlines.h>
 122#include <runtime/JSCellInlines.h>
 123#include <runtime/StructureInlines.h>
 124#include <runtime/VM.h>
 125
 126namespace WebCore {
 127
 128const JSC::ConstructAbility s_unguardedBuiltinIsReadableStreamLockedCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 129const int s_unguardedBuiltinIsReadableStreamLockedCodeLength = 71;
 130const char* s_unguardedBuiltinIsReadableStreamLockedCode =
 131 "(function (stream)\n" \
 132 "{\n" \
 133 " \"use strict\";\n" \
 134 "\n" \
 135 " return !!stream.@reader;\n" \
 136 "})\n" \
 137;
 138
 139const JSC::ConstructAbility s_unguardedBuiltinCancelReadableStreamCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 140const int s_unguardedBuiltinCancelReadableStreamCodeLength = 402;
 141const char* s_unguardedBuiltinCancelReadableStreamCode =
 142 "(function (stream, reason)\n" \
 143 "{\n" \
 144 " \"use strict\";\n" \
 145 "\n" \
 146 " if (stream.@state === @readableStreamClosed)\n" \
 147 " return Promise.resolve();\n" \
 148 " if (stream.@state === @readableStreamErrored)\n" \
 149 " return Promise.reject(stream.@storedError);\n" \
 150 " stream.@queue = [];\n" \
 151 " @finishClosingReadableStream(stream);\n" \
 152 " return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
 153 "})\n" \
 154;
 155
 156const JSC::ConstructAbility s_unguardedBuiltinPromiseInvokeOrNoopCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 157const int s_unguardedBuiltinPromiseInvokeOrNoopCodeLength = 338;
 158const char* s_unguardedBuiltinPromiseInvokeOrNoopCode =
 159 "(function (object, key, args)\n" \
 160 "{\n" \
 161 " \"use strict\";\n" \
 162 "\n" \
 163 " try {\n" \
 164 " var method = object[key];\n" \
 165 " if (typeof method === \"undefined\")\n" \
 166 " return Promise.resolve();\n" \
 167 " var result = method.@apply(object, args);\n" \
 168 " return Promise.resolve(result);\n" \
 169 " }\n" \
 170 " catch(error) {\n" \
 171 " return Promise.reject(error);\n" \
 172 " }\n" \
 173 "})\n" \
 174;
 175
 176
 177#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 178JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 179{\
 180 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
 181 return clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Source()); \
 182}
 183WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 184#undef DEFINE_BUILTIN_GENERATOR
 185
 186
 187} // namespace WebCore
 188### End File: UnguardedBuiltinBuiltins.cpp
 189
 190### Begin File: UnguardedBuiltinBuiltinsWrapper.h
 191/*
 192 * Copyright (c) 2015 Canon Inc. All rights reserved.
 193 *
 194 * Redistribution and use in source and binary forms, with or without
 195 * modification, are permitted provided that the following conditions
 196 * are met:
 197 * 1. Redistributions of source code must retain the above copyright
 198 * notice, this list of conditions and the following disclaimer.
 199 * 2. Redistributions in binary form must reproduce the above copyright
 200 * notice, this list of conditions and the following disclaimer in the
 201 * documentation and/or other materials provided with the distribution.
 202 *
 203 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 204 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 205 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 206 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 207 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 208 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 209 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 210 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 211 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 212 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 213 * THE POSSIBILITY OF SUCH DAMAGE.
 214 *
 215 */
 216
 217// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 218// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 219
 220#ifndef UnguardedBuiltinBuiltinsWrapper_h
 221#define UnguardedBuiltinBuiltinsWrapper_h
 222
 223#include "UnguardedBuiltinBuiltins.h"
 224#include <builtins/BuiltinUtils.h>
 225#include <bytecode/UnlinkedFunctionExecutable.h>
 226#include <runtime/Identifier.h>
 227#include <runtime/JSFunction.h>
 228
 229namespace WebCore {
 230
 231class UnguardedBuiltinBuiltinsWrapper : private JSC::WeakHandleOwner {
 232public:
 233 explicit UnguardedBuiltinBuiltinsWrapper(JSC::VM* vm)
 234 : m_vm(*vm)
 235 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
 236#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
 237 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 238#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 239 {
 240 }
 241
 242#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
 243 JSC::UnlinkedFunctionExecutable* name##Executable(); \
 244 const JSC::SourceCode& name##Source() const { return m_##name##Source; }
 245 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
 246#undef EXPOSE_BUILTIN_EXECUTABLES
 247
 248 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
 249
 250 void exportNames();
 251
 252private:
 253 JSC::VM& m_vm;
 254
 255 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
 256
 257#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
 258 JSC::SourceCode m_##name##Source;\
 259 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
 260 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
 261#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 262
 263};
 264
 265#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
 266inline JSC::UnlinkedFunctionExecutable* UnguardedBuiltinBuiltinsWrapper::name##Executable() \
 267{\
 268 if (!m_##name##Executable)\
 269 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
 270 return m_##name##Executable.get();\
 271}
 272WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
 273#undef DEFINE_BUILTIN_EXECUTABLES
 274
 275inline void UnguardedBuiltinBuiltinsWrapper::exportNames()
 276{
 277#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
 278 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
 279#undef EXPORT_FUNCTION_NAME
 280}
 281
 282class UnguardedBuiltinBuiltinFunctions {
 283public:
 284 explicit UnguardedBuiltinBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
 285
 286 void init(JSC::JSGlobalObject&);
 287 void visit(JSC::SlotVisitor&);
 288
 289public:
 290 JSC::VM& m_vm;
 291
 292#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
 293 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
 294 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
 295#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 296};
 297
 298inline void UnguardedBuiltinBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
 299{
 300#define EXPORT_FUNCTION(codeName, functionName, length)\
 301 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
 302 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(EXPORT_FUNCTION)
 303#undef EXPORT_FUNCTION
 304}
 305
 306inline void UnguardedBuiltinBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 307{
 308#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
 309 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
 310#undef VISIT_FUNCTION
 311}
 312
 313
 314} // namespace WebCore
 315
 316#endif // UnguardedBuiltinBuiltinsWrapper_h
 317
 318### End File: UnguardedBuiltinBuiltinsWrapper.h

Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result

 1### Begin File: xmlCasingTestBuiltins.h
 2/*
 3 * Copyright (c) 2015 Canon Inc. All rights reserved.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted provided that the following conditions
 7 * are met:
 8 * 1. Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * 2. Redistributions in binary form must reproduce the above copyright
 11 * notice, this list of conditions and the following disclaimer in the
 12 * documentation and/or other materials provided with the distribution.
 13 *
 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 24 * THE POSSIBILITY OF SUCH DAMAGE.
 25 *
 26 */
 27
 28// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 29// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 30
 31#ifndef xmlCasingTestBuiltins_h
 32#define xmlCasingTestBuiltins_h
 33
 34#include <builtins/BuiltinUtils.h>
 35
 36namespace JSC {
 37class FunctionExecutable;
 38}
 39
 40namespace WebCore {
 41
 42/* xmlCasingTest */
 43extern const char* s_xmlCasingTestXMLCasingTestCode;
 44extern const int s_xmlCasingTestXMLCasingTestCodeLength;
 45extern const JSC::ConstructAbility s_xmlCasingTestXMLCasingTestCodeConstructAbility;
 46extern const char* s_xmlCasingTestCssCasingTestCode;
 47extern const int s_xmlCasingTestCssCasingTestCodeLength;
 48extern const JSC::ConstructAbility s_xmlCasingTestCssCasingTestCodeConstructAbility;
 49extern const char* s_xmlCasingTestUrlCasingTestCode;
 50extern const int s_xmlCasingTestUrlCasingTestCodeLength;
 51extern const JSC::ConstructAbility s_xmlCasingTestUrlCasingTestCodeConstructAbility;
 52
 53#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_DATA(macro) \
 54 macro(xmlCasingTest, xmlCasingTestXMLCasingTest, 1) \
 55 macro(cssCasingTest, xmlCasingTestCssCasingTest, 2) \
 56 macro(urlCasingTest, xmlCasingTestUrlCasingTest, 3) \
 57
 58#define WEBCORE_BUILTIN_XMLCASINGTEST_XMLCASINGTEST 1
 59#define WEBCORE_BUILTIN_XMLCASINGTEST_CSSCASINGTEST 1
 60#define WEBCORE_BUILTIN_XMLCASINGTEST_URLCASINGTEST 1
 61
 62#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(macro) \
 63 macro(xmlCasingTestXMLCasingTestCode, xmlCasingTest, s_xmlCasingTestXMLCasingTestCodeLength) \
 64 macro(xmlCasingTestCssCasingTestCode, cssCasingTest, s_xmlCasingTestCssCasingTestCodeLength) \
 65 macro(xmlCasingTestUrlCasingTestCode, urlCasingTest, s_xmlCasingTestUrlCasingTestCodeLength) \
 66
 67#define WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(macro) \
 68 macro(cssCasingTest) \
 69 macro(urlCasingTest) \
 70 macro(xmlCasingTest) \
 71
 72#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 73 JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
 74
 75WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
 76#undef DECLARE_BUILTIN_GENERATOR
 77
 78#define WEBCORE_BUILTIN_XMLCASINGTEST_EXISTS(object, func) defined WEBCORE_BUILTIN_ ## object ## _ ## func
 79
 80} // namespace WebCore
 81
 82#endif // xmlCasingTestBuiltins_h
 83
 84### End File: xmlCasingTestBuiltins.h
 85
 86### Begin File: xmlCasingTestBuiltins.cpp
 87/*
 88 * Copyright (c) 2015 Canon Inc. All rights reserved.
 89 *
 90 * Redistribution and use in source and binary forms, with or without
 91 * modification, are permitted provided that the following conditions
 92 * are met:
 93 * 1. Redistributions of source code must retain the above copyright
 94 * notice, this list of conditions and the following disclaimer.
 95 * 2. Redistributions in binary form must reproduce the above copyright
 96 * notice, this list of conditions and the following disclaimer in the
 97 * documentation and/or other materials provided with the distribution.
 98 *
 99 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 100 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 101 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 102 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 103 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 104 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 105 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 106 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 107 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 108 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 109 * THE POSSIBILITY OF SUCH DAMAGE.
 110 *
 111 */
 112
 113// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 114// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 115
 116#include "config.h"
 117#include "xmlCasingTestBuiltins.h"
 118
 119#include "WebCoreJSClientData.h"
 120#include <runtime/Executable.h>
 121#include <runtime/JSCJSValueInlines.h>
 122#include <runtime/JSCellInlines.h>
 123#include <runtime/StructureInlines.h>
 124#include <runtime/VM.h>
 125
 126namespace WebCore {
 127
 128const JSC::ConstructAbility s_xmlCasingTestXMLCasingTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 129const int s_xmlCasingTestXMLCasingTestCodeLength = 71;
 130const char* s_xmlCasingTestXMLCasingTestCode =
 131 "(function (stream)\n" \
 132 "{\n" \
 133 " \"use strict\";\n" \
 134 "\n" \
 135 " return !!stream.@reader;\n" \
 136 "})\n" \
 137;
 138
 139const JSC::ConstructAbility s_xmlCasingTestCssCasingTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 140const int s_xmlCasingTestCssCasingTestCodeLength = 402;
 141const char* s_xmlCasingTestCssCasingTestCode =
 142 "(function (stream, reason)\n" \
 143 "{\n" \
 144 " \"use strict\";\n" \
 145 "\n" \
 146 " if (stream.@state === @readableStreamClosed)\n" \
 147 " return Promise.resolve();\n" \
 148 " if (stream.@state === @readableStreamErrored)\n" \
 149 " return Promise.reject(stream.@storedError);\n" \
 150 " stream.@queue = [];\n" \
 151 " @finishClosingReadableStream(stream);\n" \
 152 " return @promiseInvokeOrNoop(stream.@underlyingSource, \"cancel\", [reason]).then(function() { });\n" \
 153 "})\n" \
 154;
 155
 156const JSC::ConstructAbility s_xmlCasingTestUrlCasingTestCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
 157const int s_xmlCasingTestUrlCasingTestCodeLength = 338;
 158const char* s_xmlCasingTestUrlCasingTestCode =
 159 "(function (object, key, args)\n" \
 160 "{\n" \
 161 " \"use strict\";\n" \
 162 "\n" \
 163 " try {\n" \
 164 " var method = object[key];\n" \
 165 " if (typeof method === \"undefined\")\n" \
 166 " return Promise.resolve();\n" \
 167 " var result = method.@apply(object, args);\n" \
 168 " return Promise.resolve(result);\n" \
 169 " }\n" \
 170 " catch(error) {\n" \
 171 " return Promise.reject(error);\n" \
 172 " }\n" \
 173 "})\n" \
 174;
 175
 176
 177#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 178JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 179{\
 180 JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
 181 return clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Source()); \
 182}
 183WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 184#undef DEFINE_BUILTIN_GENERATOR
 185
 186
 187} // namespace WebCore
 188### End File: xmlCasingTestBuiltins.cpp
 189
 190### Begin File: xmlCasingTestBuiltinsWrapper.h
 191/*
 192 * Copyright (c) 2015 Canon Inc. All rights reserved.
 193 *
 194 * Redistribution and use in source and binary forms, with or without
 195 * modification, are permitted provided that the following conditions
 196 * are met:
 197 * 1. Redistributions of source code must retain the above copyright
 198 * notice, this list of conditions and the following disclaimer.
 199 * 2. Redistributions in binary form must reproduce the above copyright
 200 * notice, this list of conditions and the following disclaimer in the
 201 * documentation and/or other materials provided with the distribution.
 202 *
 203 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 204 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 205 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 206 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 207 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 208 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 209 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 210 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 211 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 212 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 213 * THE POSSIBILITY OF SUCH DAMAGE.
 214 *
 215 */
 216
 217// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
 218// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
 219
 220#ifndef xmlCasingTestBuiltinsWrapper_h
 221#define xmlCasingTestBuiltinsWrapper_h
 222
 223#include "xmlCasingTestBuiltins.h"
 224#include <builtins/BuiltinUtils.h>
 225#include <bytecode/UnlinkedFunctionExecutable.h>
 226#include <runtime/Identifier.h>
 227#include <runtime/JSFunction.h>
 228
 229namespace WebCore {
 230
 231class xmlCasingTestBuiltinsWrapper : private JSC::WeakHandleOwner {
 232public:
 233 explicit xmlCasingTestBuiltinsWrapper(JSC::VM* vm)
 234 : m_vm(*vm)
 235 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
 236#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
 237 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 238#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
 239 {
 240 }
 241
 242#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \
 243 JSC::UnlinkedFunctionExecutable* name##Executable(); \
 244 const JSC::SourceCode& name##Source() const { return m_##name##Source; }
 245 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
 246#undef EXPOSE_BUILTIN_EXECUTABLES
 247
 248 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
 249
 250 void exportNames();
 251
 252private:
 253 JSC::VM& m_vm;
 254
 255 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
 256
 257#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \
 258 JSC::SourceCode m_##name##Source;\
 259 JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
 260 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
 261#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 262
 263};
 264
 265#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \
 266inline JSC::UnlinkedFunctionExecutable* xmlCasingTestBuiltinsWrapper::name##Executable() \
 267{\
 268 if (!m_##name##Executable)\
 269 m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
 270 return m_##name##Executable.get();\
 271}
 272WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
 273#undef DEFINE_BUILTIN_EXECUTABLES
 274
 275inline void xmlCasingTestBuiltinsWrapper::exportNames()
 276{
 277#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
 278 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
 279#undef EXPORT_FUNCTION_NAME
 280}
 281
 282class xmlCasingTestBuiltinFunctions {
 283public:
 284 explicit xmlCasingTestBuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
 285
 286 void init(JSC::JSGlobalObject&);
 287 void visit(JSC::SlotVisitor&);
 288
 289public:
 290 JSC::VM& m_vm;
 291
 292#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \
 293 JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
 294 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
 295#undef DECLARE_BUILTIN_SOURCE_MEMBERS
 296};
 297
 298inline void xmlCasingTestBuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
 299{
 300#define EXPORT_FUNCTION(codeName, functionName, length)\
 301 m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
 302 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(EXPORT_FUNCTION)
 303#undef EXPORT_FUNCTION
 304}
 305
 306inline void xmlCasingTestBuiltinFunctions::visit(JSC::SlotVisitor& visitor)
 307{
 308#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
 309 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
 310#undef VISIT_FUNCTION
 311}
 312
 313
 314} // namespace WebCore
 315
 316#endif // xmlCasingTestBuiltinsWrapper_h
 317
 318### End File: xmlCasingTestBuiltinsWrapper.h

Source/JavaScriptCore/UpdateContents.py

1 #!/usr/bin/python
2 
3 # Copyright (C) 2015 Apple Inc. All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 #
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
14 # 3. Neither the name of Apple puter, Inc. ("Apple") nor the names of
15 # its contributors may be used to endorse or promote products derived
16 # from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
19 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 import sys
30 import os
31 
32 assert(len(sys.argv) == 3)
33 
34 comp = sys.argv[1]
35 filename = sys.argv[2]
36 
37 t = False
38 
39 if os.path.isfile(filename):
40  f = open(filename, 'r')
41  comparator = f.read()
42  f.close()
43  t = True
44 
45 if (not t or comp != comparator):
46  f = open(filename, 'w')
47  f.write(comp)
48  f.close()

Source/JavaScriptCore/builtins/BuiltinExecutables.cpp

@@static UnlinkedFunctionExecutable* createExecutableInternal(VM&, const SourceCod
4040BuiltinExecutables::BuiltinExecutables(VM& vm)
4141 : m_vm(vm)
4242#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(makeSource(StringImpl::createFromLiteral(s_##name, length)))
43  JSC_FOREACH_BUILTIN(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
 43 JSC_FOREACH_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
4444#undef EXPOSE_BUILTIN_STRINGS
4545{
4646}

@@UnlinkedFunctionExecutable* BuiltinExecutables::name##Executable() \
132132 m_##name##Executable = Weak<UnlinkedFunctionExecutable>(createBuiltinExecutable(m_##name##Source, m_vm.propertyNames->builtinNames().functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\
133133 return m_##name##Executable.get();\
134134}
135 JSC_FOREACH_BUILTIN(DEFINE_BUILTIN_EXECUTABLES)
 135JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
136136#undef EXPOSE_BUILTIN_SOURCES
137137
138138}

Source/JavaScriptCore/builtins/BuiltinExecutables.h

@@public:
4747UnlinkedFunctionExecutable* name##Executable(); \
4848const SourceCode& name##Source() { return m_##name##Source; }
4949
50  JSC_FOREACH_BUILTIN(EXPOSE_BUILTIN_EXECUTABLES)
 50 JSC_FOREACH_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
5151#undef EXPOSE_BUILTIN_SOURCES
5252
5353 UnlinkedFunctionExecutable* createDefaultConstructor(ConstructorKind, const Identifier& name);

@@private:
6262#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length)\
6363 SourceCode m_##name##Source; \
6464 Weak<UnlinkedFunctionExecutable> m_##name##Executable;
65  JSC_FOREACH_BUILTIN(DECLARE_BUILTIN_SOURCE_MEMBERS)
 65 JSC_FOREACH_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
6666#undef DECLARE_BUILTIN_SOURCE_MEMBERS
6767};
6868

Source/JavaScriptCore/create_hash_table

@@sub output() {
319319 if ($values[$i]{"type"} eq "Function") {
320320 my $tableHead = $name;
321321 $tableHead =~ s/Table$//;
322  print " #if JSC_BUILTIN_EXISTS(" . uc($tableHead . $key) .")\n";
 322 print " #if JSC_BUILTIN_EXISTS(" . uc($tableHead) . ", " . uc($key) .")\n";
323323 print " { \"$key\", (($attrs[$i]) & ~Function) | Builtin, $intrinsic, { (intptr_t)static_cast<BuiltinGenerator>(" . $tableHead . ucfirst($key) . "CodeGenerator), (intptr_t)$secondValue } },\n";
324324 print " #else\n"
325325 }

Source/WebCore/CMakeLists.txt

@@set(WebCore_IDL_FILES
821821 ${WebCore_SVG_IDL_FILES}
822822)
823823
824 if (WIN32)
825  if (INTERNAL_BUILD)
826  set(JavaScriptCore_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore/Scripts")
827  else ()
828  set(JavaScriptCore_SCRIPTS_DIR "${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts")
829  endif ()
 824if (WIN32 AND INTERNAL_BUILD)
 825 set(JavaScriptCore_SCRIPTS_DIR "${CMAKE_BINARY_DIR}/../include/private/JavaScriptCore/Scripts")
830826else ()
831  set(JavaScriptCore_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/Scripts")
 827 set(JavaScriptCore_SCRIPTS_DIR "${DERIVED_SOURCES_DIR}/ForwardingHeaders/JavaScriptCore/Scripts")
832828endif ()
833829
834830set(WebCore_SOURCES

@@set(WORKERGLOBALSCOPE_CONSTRUCTORS_FILE ${DERIVED_SOURCES_WEBCORE_DIR}/WorkerGlo
33613357set(DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE ${DERIVED_SOURCES_WEBCORE_DIR}/DedicatedWorkerGlobalScopeConstructors.idl)
33623358set(IDL_ATTRIBUTES_FILE ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
33633359
3364 set(WEBCORE_JS_BUILTINS
3365  ${WEBCORE_DIR}/Modules/mediastream/MediaDevices.js
3366  ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
3367  ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js
3368  ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
3369  ${WEBCORE_DIR}/Modules/streams/ReadableStreamController.js
3370  ${WEBCORE_DIR}/Modules/streams/ReadableStreamInternals.js
3371  ${WEBCORE_DIR}/Modules/streams/ReadableStreamReader.js
3372  ${WEBCORE_DIR}/Modules/streams/StreamInternals.js
3373  ${WEBCORE_DIR}/Modules/streams/WritableStream.js
3374 )
3375 
33763360WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
33773361
33783362# Generate InspectorOverlayPage.h

@@GENERATE_BINDINGS(WebCoreTestSupport_SOURCES
35973581 ${ADDITIONAL_BINDINGS_DEPENDENCIES})
35983582
35993583# WebCore JS Builtins
3600 foreach (_builtinjs ${WEBCORE_JS_BUILTINS})
3601  get_filename_component(_name ${_builtinjs} NAME_WE)
 3584
 3585set(WebCore_BUILTINS_SOURCES
 3586 ${WEBCORE_DIR}/Modules/mediastream/MediaDevices.js
 3587 ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
 3588 ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js
 3589 ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
 3590 ${WEBCORE_DIR}/Modules/streams/ReadableStreamController.js
 3591 ${WEBCORE_DIR}/Modules/streams/ReadableStreamInternals.js
 3592 ${WEBCORE_DIR}/Modules/streams/ReadableStreamReader.js
 3593 ${WEBCORE_DIR}/Modules/streams/StreamInternals.js
 3594 ${WEBCORE_DIR}/Modules/streams/WritableStream.js
 3595)
 3596
 3597set(BUILTINS_GENERATOR_SCRIPTS
 3598 ${JavaScriptCore_SCRIPTS_DIR}/builtins.py
 3599 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generator.py
 3600 ${JavaScriptCore_SCRIPTS_DIR}/builtins_model.py
 3601 ${JavaScriptCore_SCRIPTS_DIR}/builtins_templates.py
 3602 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_header.py
 3603 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_combined_implementation.py
 3604 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_header.py
 3605 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_implementation.py
 3606 ${JavaScriptCore_SCRIPTS_DIR}/builtins_generate_separate_wrapper.py
 3607 ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
 3608 ${JavaScriptCore_SCRIPTS_DIR}/lazywriter.py
 3609)
 3610
 3611foreach (_builtinSource ${WebCore_BUILTINS_SOURCES})
 3612 get_filename_component(_objectName ${_builtinSource} NAME_WE)
36023613 add_custom_command(
3603  OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}BuiltinsWrapper.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.h ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.cpp
3604  MAIN_DEPENDENCY ${WEBCORE_DIR}/generate-js-builtins
3605  DEPENDS ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins
3606  DEPENDS ${_builtinjs}
3607  COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate-js-builtins --input ${_builtinjs} --output_dir ${DERIVED_SOURCES_WEBCORE_DIR} --generate_js_builtins_path ${JavaScriptCore_SCRIPTS_DIR}
 3614 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/${_objectName}Builtins.cpp
 3615 ${DERIVED_SOURCES_WEBCORE_DIR}/${_objectName}Builtins.h
 3616 ${DERIVED_SOURCES_WEBCORE_DIR}/${_objectName}BuiltinsWrapper.h
 3617 MAIN_DEPENDENCY ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py
 3618 DEPENDS ${_builtinSource} ${BUILTINS_GENERATOR_SCRIPTS}
 3619 COMMAND ${PYTHON_EXECUTABLE} ${JavaScriptCore_SCRIPTS_DIR}/generate-js-builtins.py --framework WebCore --output-directory ${DERIVED_SOURCES_WEBCORE_DIR} ${_builtinSource}
36083620 VERBATIM)
36093621 list(APPEND WebCore_SOURCES
3610  ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}Builtins.h
3611  ${DERIVED_SOURCES_WEBCORE_DIR}/${_name}BuiltinsWrapper.h
 3622 ${DERIVED_SOURCES_WEBCORE_DIR}/${_objectName}Builtins.h
 3623 ${DERIVED_SOURCES_WEBCORE_DIR}/${_objectName}BuiltinsWrapper.h
36123624 )
3613  ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/bindings/js/WebCoreJSBuiltins.cpp ${_name}Builtins.cpp)
 3625 ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/bindings/js/WebCoreJSBuiltins.cpp ${_objectName}Builtins.cpp)
36143626endforeach ()
36153627
 3628
36163629ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLTreeBuilder.cpp MathMLNames.cpp)
36173630
36183631

Source/WebCore/DerivedSources.make

@@all : \
797797 $(WORKERGLOBALSCOPE_CONSTRUCTORS_FILE) \
798798 $(JS_DOM_HEADERS) \
799799 $(WEB_DOM_HEADERS) \
800  $(WEBCORE_JS_BUILTINS) \
801800 \
802801 CSSGrammar.cpp \
803802 CSSPropertyNames.cpp \

@@WebReplayInputs.h : $(INPUT_GENERATOR_SPECIFICATIONS) $(INPUT_GENERATOR_SCRIPTS)
12561255
12571256# WebCore JS Builtins
12581257
1259 WEBCORE_JS_BUILTINS = \
 1258WebCore_BUILTINS_SOURCES = \
12601259 $(WebCore)/Modules/mediastream/MediaDevices.js \
12611260 $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
12621261 $(WebCore)/Modules/streams/CountQueuingStrategy.js \

@@WEBCORE_JS_BUILTINS = \
12681267 $(WebCore)/Modules/streams/WritableStream.js \
12691268#
12701269
1271 all : $(WEBCORE_JS_BUILTINS:%.js=%Builtins.cpp)
 1270BUILTINS_GENERATOR_SCRIPTS = \
 1271 $(JavaScriptCore_SCRIPTS_DIR)/builtins.py \
 1272 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generator.py \
 1273 $(JavaScriptCore_SCRIPTS_DIR)/builtins_model.py \
 1274 $(JavaScriptCore_SCRIPTS_DIR)/builtins_templates.py \
 1275 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generate_combined_header.py \
 1276 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generate_combined_implementation.py \
 1277 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generate_separate_header.py \
 1278 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generate_separate_implementation.py \
 1279 $(JavaScriptCore_SCRIPTS_DIR)/builtins_generate_separate_wrapper.py \
 1280 $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py \
 1281 $(JavaScriptCore_SCRIPTS_DIR)/lazywriter.py \
 1282#
 1283
 1284# Adding/removing scripts should trigger regeneration, but changing which builtins are
 1285# generated should not affect other builtins when not passing '--combined' to the generator.
 1286
 1287.PHONY: force
 1288WebCore_BUILTINS_DEPENDENCIES_LIST : $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py force
 1289 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py '$(BUILTINS_GENERATOR_SCRIPTS)' $@
 1290
 1291%Builtins.h: %.js $(BUILTINS_GENERATOR_SCRIPTS) WebCore_BUILTINS_DEPENDENCIES_LIST
 1292 $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py --output-directory . --framework WebCore $<
12721293
1273 %Builtins.cpp: %.js
1274  $(PYTHON) $(WebCore)/generate-js-builtins --input $< --generate_js_builtins_path $(JavaScriptCore_SCRIPTS_DIR)
 1294all : $(notdir $(WebCore_BUILTINS_SOURCES:%.js=%Builtins.h))
12751295
12761296# ------------------------
12771297

Source/WebCore/WebCore.xcodeproj/project.pbxproj

11491149 2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F71B56D7810020AAF7 /* DOMPath.cpp */; };
11501150 2D5002FB1B56D7990020AAF7 /* PathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F91B56D7990020AAF7 /* PathUtilities.cpp */; };
11511151 2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
1152  2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */; settings = {ASSET_TAGS = (); }; };
 1152 2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5036671BCDDDC400E20BB3 /* GestureEvents.cpp */; };
11531153 2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
11541154 2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
11551155 2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };

15191519 416E6FEA1BBD1684000A6034 /* StreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
15201520 416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
15211521 416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
1522  416E6FEA1BBD1684000A6044 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
15231522 416E6FE91BBD12E5000A6053 /* WritableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
 1523 416E6FEA1BBD1684000A6044 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
15241524 417253AA1354BBBC00360F2A /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417253A81354BBBC00360F2A /* MediaControlElements.cpp */; };
15251525 417253AB1354BBBC00360F2A /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 417253A91354BBBC00360F2A /* MediaControlElements.h */; };
15261526 417DA6D913734E6E007C57FB /* Internals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA4CF13734326007C57FB /* Internals.cpp */; };

26592659 7C48A6D1191C9D6500026674 /* WebKitNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C48A6CF191C9D6500026674 /* WebKitNamespace.h */; };
26602660 7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85989DCA0ACC8BBD00A0BC51 /* DOMWheelEventInternal.h */; };
26612661 7C4C96DC1AD4483500365A50 /* JSReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */; };
 2662 7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */; };
26622663 7C4C96DD1AD4483500365A50 /* JSReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A50 /* JSReadableStream.h */; };
 2664 7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A60 /* JSWritableStream.h */; };
26632665 7C4C96DE1AD4483500365A50 /* JSReadableStreamReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */; };
26642666 7C4C96DF1AD4483500365A50 /* JSReadableStreamReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96DB1AD4483500365A50 /* JSReadableStreamReader.h */; };
2665  7C4C96DC1AD4483500365A60 /* JSWritableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */; };
2666  7C4C96DD1AD4483500365A60 /* JSWritableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96D91AD4483500365A60 /* JSWritableStream.h */; };
26672667 7C4C96E31AD44ABF00365A50 /* LaunchServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
26682668 7C4EDD741A7B607800198C4D /* FontCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C4EDD731A7B607800198C4D /* FontCocoa.mm */; };
26692669 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };

55085508 BC779E171BB227CA00CAA8BF /* StyleCustomPropertyData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC779E151BB226A200CAA8BF /* StyleCustomPropertyData.h */; settings = {ATTRIBUTES = (Private, ); }; };
55095509 BC7D8FEF1BD03B6400FFE540 /* CSSUnsetValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FED1BD03B6400FFE540 /* CSSUnsetValue.cpp */; };
55105510 BC7D8FF01BD03B6400FFE540 /* CSSUnsetValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FEE1BD03B6400FFE540 /* CSSUnsetValue.h */; };
5511  BC7D8FF31BD1A47900FFE540 /* CSSRevertValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */; settings = {ASSET_TAGS = (); }; };
5512  BC7D8FF41BD1A47900FFE540 /* CSSRevertValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */; settings = {ASSET_TAGS = (); }; };
 5511 BC7D8FF31BD1A47900FFE540 /* CSSRevertValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7D8FF11BD1A47900FFE540 /* CSSRevertValue.cpp */; };
 5512 BC7D8FF41BD1A47900FFE540 /* CSSRevertValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7D8FF21BD1A47900FFE540 /* CSSRevertValue.h */; };
55135513 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7F44A70B9E324E00A9D081 /* ImageObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
55145514 BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC7FA61E0D1F0CBD00DB22A9 /* LiveNodeList.cpp */; };
55155515 BC7FA6210D1F0CBD00DB22A9 /* LiveNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7FA61F0D1F0CBD00DB22A9 /* LiveNodeList.h */; };

1011810118 7C48A6CF191C9D6500026674 /* WebKitNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNamespace.h; sourceTree = "<group>"; };
1011910119 7C48A6D2191C9D8E00026674 /* WebKitNamespace.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitNamespace.idl; sourceTree = "<group>"; };
1012010120 7C4C96D81AD4483500365A50 /* JSReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStream.cpp; sourceTree = "<group>"; };
 10121 7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWritableStream.cpp; sourceTree = "<group>"; };
1012110122 7C4C96D91AD4483500365A50 /* JSReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStream.h; sourceTree = "<group>"; };
 10123 7C4C96D91AD4483500365A60 /* JSWritableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWritableStream.h; sourceTree = "<group>"; };
1012210124 7C4C96DA1AD4483500365A50 /* JSReadableStreamReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamReader.cpp; sourceTree = "<group>"; };
1012310125 7C4C96DB1AD4483500365A50 /* JSReadableStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamReader.h; sourceTree = "<group>"; };
10124  7C4C96D81AD4483500365A60 /* JSWritableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWritableStream.cpp; sourceTree = "<group>"; };
10125  7C4C96D91AD4483500365A60 /* JSWritableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWritableStream.h; sourceTree = "<group>"; };
1012610126 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchServicesSPI.h; sourceTree = "<group>"; };
1012710127 7C4EDD731A7B607800198C4D /* FontCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCocoa.mm; sourceTree = "<group>"; };
1012810128 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorOverlay.cpp; sourceTree = "<group>"; };

1135911359 98CE4325129E00BD005821DC /* LinkLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkLoader.cpp; sourceTree = "<group>"; };
1136011360 98CE4329129E00E5005821DC /* LinkLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoader.h; sourceTree = "<group>"; };
1136111361 98EB1F941313FE0500D0E1EA /* NotImplemented.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotImplemented.h; sourceTree = "<group>"; };
11362  9908B0EC1BCACF1F00ED0F65 /* generate-js-builtins */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "generate-js-builtins"; sourceTree = "<group>"; };
1136311362 9908B0ED1BCACF9100ED0F65 /* ByteLengthQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ByteLengthQueuingStrategy.js; sourceTree = "<group>"; };
1136411363 9908B0EE1BCACF9100ED0F65 /* CountQueuingStrategy.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = CountQueuingStrategy.js; sourceTree = "<group>"; };
1136511364 9908B0F11BCACF9100ED0F55 /* StreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = StreamInternals.js; sourceTree = "<group>"; };
1136611365 9908B0FD1BCAD07D00ED0F55 /* StreamInternalsBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamInternalsBuiltins.cpp; sourceTree = "<group>"; };
1136711366 9908B0EF1BCACF9100ED0F65 /* ReadableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStream.js; sourceTree = "<group>"; };
 11367 9908B0EF1BCACF9100ED0F75 /* WritableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WritableStream.js; sourceTree = "<group>"; };
1136811368 9908B0F01BCACF9100ED0F65 /* ReadableStreamController.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamController.js; sourceTree = "<group>"; };
1136911369 9908B0F11BCACF9100ED0F65 /* ReadableStreamInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamInternals.js; sourceTree = "<group>"; };
1137011370 9908B0F21BCACF9100ED0F65 /* ReadableStreamReader.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = ReadableStreamReader.js; sourceTree = "<group>"; };
11371  9908B0EF1BCACF9100ED0F75 /* WritableStream.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = WritableStream.js; sourceTree = "<group>"; };
1137211371 9908B0F31BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteLengthQueuingStrategyBuiltins.cpp; sourceTree = "<group>"; };
1137311372 9908B0F41BCACFFE00ED0F65 /* ByteLengthQueuingStrategyBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteLengthQueuingStrategyBuiltinsWrapper.h; sourceTree = "<group>"; };
1137411373 9908B0F51BCAD07D00ED0F65 /* ByteLengthQueuingStrategyBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteLengthQueuingStrategyBuiltins.h; sourceTree = "<group>"; };

1137611375 9908B0F71BCAD07D00ED0F65 /* CountQueuingStrategyBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountQueuingStrategyBuiltins.h; sourceTree = "<group>"; };
1137711376 9908B0F81BCAD07D00ED0F65 /* CountQueuingStrategyBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CountQueuingStrategyBuiltinsWrapper.h; sourceTree = "<group>"; };
1137811377 9908B0F91BCAD07D00ED0F65 /* ReadableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamBuiltins.cpp; sourceTree = "<group>"; };
 11378 9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamBuiltins.cpp; sourceTree = "<group>"; };
1137911379 9908B0FA1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamControllerBuiltins.cpp; sourceTree = "<group>"; };
1138011380 9908B0FB1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamControllerBuiltins.h; sourceTree = "<group>"; };
1138111381 9908B0FC1BCAD07D00ED0F65 /* ReadableStreamControllerBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamControllerBuiltinsWrapper.h; sourceTree = "<group>"; };

1138311383 9908B0FE1BCAD07D00ED0F65 /* ReadableStreamReaderBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamReaderBuiltins.cpp; sourceTree = "<group>"; };
1138411384 9908B0FF1BCAD07D00ED0F65 /* ReadableStreamReaderBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamReaderBuiltins.h; sourceTree = "<group>"; };
1138511385 9908B1001BCAD07D00ED0F65 /* ReadableStreamReaderBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamReaderBuiltinsWrapper.h; sourceTree = "<group>"; };
11386  9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WritableStreamBuiltins.cpp; sourceTree = "<group>"; };
1138711386 9920398018B95BC600B39AF9 /* UserInputBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserInputBridge.cpp; sourceTree = "<group>"; };
1138811387 9920398118B95BC600B39AF9 /* UserInputBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInputBridge.h; sourceTree = "<group>"; };
1138911388 99C7CCB218C663E40032E413 /* MemoizedDOMResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoizedDOMResult.h; sourceTree = "<group>"; };

1142411423 9B03D8071BB3110D00B764CA /* StreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
1142511424 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltins.h; sourceTree = "<group>"; };
1142611425 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltins.h; sourceTree = "<group>"; };
 11426 9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamBuiltins.h; sourceTree = "<group>"; };
1142711427 9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
1142811428 9B03D8071BB3110D00B764DA /* ReadableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
11429  9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamBuiltins.h; sourceTree = "<group>"; };
1143011429 9B03D8071BB3110D00B764E8 /* WritableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WritableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
1143111430 9B19B67E1B964E5200348745 /* ShadowRoot.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRoot.idl; sourceTree = "<group>"; };
1143211431 9B1AB0791648C69D0051F3F2 /* HTMLFormControlsCollection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLFormControlsCollection.idl; sourceTree = "<group>"; };

1535115350 0867D691FE84028FC02AAC07 /* WebKit */ = {
1535215351 isa = PBXGroup;
1535315352 children = (
15354  9908B0EC1BCACF1F00ED0F65 /* generate-js-builtins */,
1535515353 65C97AF208EA908800ACD273 /* config.h */,
1535615354 EDEC98020AED7E170059137F /* WebCorePrefix.h */,
1535715355 9307061309E0CA8200B17FE4 /* DerivedSources.make */,

1640116399 9908B0F11BCACF9100ED0F55 /* StreamInternals.js */,
1640216400 41A023ED1A39DB7900F722DF /* WritableStream.idl */,
1640316401 9908B0EF1BCACF9100ED0F75 /* WritableStream.js */,
16404 
1640516402 );
1640616403 path = streams;
1640716404 sourceTree = "<group>";

1725717254 1A1414B413A0F0500019996C /* WebKitFontFamilyNames.h */,
1725817255 99CC0B6818BEA1FF006CEBCC /* WebReplayInputs.cpp */,
1725917256 99CC0B6918BEA1FF006CEBCC /* WebReplayInputs.h */,
 17257 9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */,
1726017258 9B03D8061BB3110D00B764E8 /* WritableStreamBuiltins.h */,
1726117259 9B03D8071BB3110D00B764E8 /* WritableStreamBuiltinsWrapper.h */,
17262  9908B0F91BCAD07D00ED0F75 /* WritableStreamBuiltins.cpp */,
1726317260 656581EA09D1508D000E61D7 /* XLinkNames.cpp */,
1726417261 656581EB09D1508D000E61D7 /* XLinkNames.h */,
1726517262 A833C80A0A2CF25600D57664 /* XMLNames.cpp */,

2912329120 9746AF2614F4DDE6003E7A70 /* GeolocationController.cpp in Sources */,
2912429121 0FB6252E18DE1B1500A07C05 /* GeometryUtilities.cpp in Sources */,
2912529122 46C83EFD1A9BBE2900A79A41 /* GeoNotifier.cpp in Sources */,
 29123 2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */,
2912629124 B2AFFC830D00A5C10030074D /* GlyphPageMac.cpp in Sources */,
2912729125 BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */,
2912829126 BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */,

2975129749 0705853317FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp in Sources */,
2975229750 0705853517FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp in Sources */,
2975329751 E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */,
29754  0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */,
2975529752 E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */,
2975629753 75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */,
2975729754 410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,

3016330160 51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
3016430161 BCE65BEA0EACDF16007E4533 /* Length.cpp in Sources */,
3016530162 E55F497A151B888000BB67DB /* LengthFunctions.cpp in Sources */,
 30163 0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */,
3016630164 FFB698CC1833EE0D00158A31 /* LineBreaker.cpp in Sources */,
3016730165 89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */,
3016830166 FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,

3049430492 D302754912A5FE84004BD828 /* RenderDetailsMarker.cpp in Sources */,
3049530493 9B32CDAA13DF7FA900F34D13 /* RenderedPosition.cpp in Sources */,
3049630494 E43A023D17EB3713004CDD25 /* RenderElement.cpp in Sources */,
30497  0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */,
3049830495 0F5B7A5410F65D7A00376302 /* RenderEmbeddedObject.cpp in Sources */,
3049930496 A8EA73C30A1900E300A8EF5F /* RenderFieldset.cpp in Sources */,
3050030497 066C77300AB603FD00238CC4 /* RenderFileUploadControl.cpp in Sources */,

3056630563 AB247A6C0AFD6383003FA5FD /* RenderSlider.cpp in Sources */,
3056730564 31955A86160D199000858025 /* RenderSnapshottedPlugIn.cpp in Sources */,
3056830565 BC8C8FAD0DDCD31B00B592F4 /* RenderStyle.cpp in Sources */,
 30566 0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */,
3056930567 0F4E57171313276200CF85AF /* RenderSVGAllInOne.cpp in Sources */,
3057030568 A8DF4AEC0980C42C0052981B /* RenderTable.cpp in Sources */,
3057130569 6ED878C4147493F4004C3597 /* RenderTableCaption.cpp in Sources */,

3088130879 24D912B713CA9A6900D21915 /* SVGAltGlyphItemElement.cpp in Sources */,
3088230880 B22279760D00BF220071B782 /* SVGAngle.cpp in Sources */,
3088330881 B22279790D00BF220071B782 /* SVGAnimateColorElement.cpp in Sources */,
30884  2D5036681BCDDDC400E20BB3 /* GestureEvents.cpp in Sources */,
3088530882 4362C7B913AC6F1A00344BEB /* SVGAnimatedAngle.cpp in Sources */,
3088630883 431A308813B8F978007791E4 /* SVGAnimatedBoolean.cpp in Sources */,
3088730884 43A625F913B3304000AC94B8 /* SVGAnimatedColor.cpp in Sources */,

Source/WebCore/bindings/js/JSDOMWindowBase.cpp

@@void JSDOMWindowBase::finishCreation(VM& vm, JSDOMWindowShell* shell)
9595 GlobalPropertyInfo(\
9696 static_cast<JSVMClientData*>(vm.clientData)->builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), \
9797 m_privateFunctions.readableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
98  WEBCOREREADABLESTREAMINTERNALS_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 98 WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
9999#undef DECLARE_GLOBAL_STATIC
100100#define DECLARE_GLOBAL_STATIC(name)\
101101 GlobalPropertyInfo(\
102102 static_cast<JSVMClientData*>(vm.clientData)->builtinFunctions().streamInternalsBuiltins().name##PrivateName(), \
103103 m_privateFunctions.streamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
104  WEBCORESTREAMINTERNALS_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
 104 WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
105105#undef DECLARE_GLOBAL_STATIC
106106#endif
107107 };

Source/WebCore/generate-js-builtins

1 #!/usr/bin/python
2 # Copyright (C) 2015 Canon Inc. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 # 1. Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # 2. Redistributions in binary form must reproduce the above copyright
10 # notice, this list of conditions and the following disclaimer in the
11 # documentation and/or other materials provided with the distribution.
12 #
13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 
26 import argparse
27 import filecmp
28 import os
29 import subprocess
30 
31 from string import Template
32 
33 
34 parser = argparse.ArgumentParser()
35 parser.add_argument('--output_dir', default='', help='output directory')
36 parser.add_argument('--input', help='path to input JS file')
37 parser.add_argument('--generate_js_builtins_path', help='path to directory containing JavaScriptCore\'s generate-js-builtins')
38 
39 args = parser.parse_args()
40 filename = os.path.splitext(os.path.basename(args.input))[0]
41 
42 # generate JS builtins
43 namespace = "WebCore"
44 prefix = "WEBCORE" + filename.upper()
45 output = os.path.join(args.output_dir, filename + "Builtins")
46 jsc_generate_builtin_script = os.path.join(args.generate_js_builtins_path, "generate-js-builtins")
47 
48 subprocess.call(["python", jsc_generate_builtin_script, "--output", output, "--namespace", namespace, "--prefix", prefix, args.input], stderr=subprocess.STDOUT)
49 
50 # generate JS builtins wrapper
51 output_base = output + "Wrapper"
52 
53 builtinsWrapperHeader = open(output_base + ".h.tmp", "w")
54 
55 builtinsWrapperHeader.write(Template(
56 """
57 /* Generated by generate-js-builtins do not hand edit. */
58 
59 /*
60  *
61  * This library is free software; you can redistribute it and/or
62  * modify it under the terms of the GNU Lesser General Public
63  * License as published by the Free Software Foundation; either
64  * version 2 of the License, or (at your option) any later version.
65  *
66  * This library is distributed in the hope that it will be useful,
67  * but WITHOUT ANY WARRANTY; without even the implied warranty of
68  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
69  * Lesser General Public License for more details.
70  *
71  * You should have received a copy of the GNU Lesser General Public
72  * License along with this library; if not, write to the Free Software
73  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
74  */
75 
76 #ifndef ${Filename}BuiltinsWrapper_h
77 #define ${Filename}BuiltinsWrapper_h
78 
79 #include "${Filename}Builtins.h"
80 #include <bytecode/UnlinkedFunctionExecutable.h>
81 #include <builtins/BuiltinUtils.h>
82 #include <runtime/Identifier.h>
83 #include <runtime/JSFunction.h>
84 
85 namespace WebCore {
86 
87 class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner {
88 public:
89  explicit ${Filename}BuiltinsWrapper(JSC::VM* vm)
90  : m_vm(*vm)
91  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
92 #define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) , m_##name##Source(JSC::makeSource(StringImpl::createFromLiteral(s_##name, length)))
93  ${Prefix}_FOREACH_BUILTIN(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
94 #undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
95  {
96  }
97 
98 #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \\
99  JSC::UnlinkedFunctionExecutable* name##Executable(); \\
100  const JSC::SourceCode& name##Source() const { return m_##name##Source; }
101  ${Prefix}_FOREACH_BUILTIN(EXPOSE_BUILTIN_EXECUTABLES)
102 #undef EXPOSE_BUILTIN_EXECUTABLES
103 
104  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
105 
106  void exportNames();
107 
108 private:
109  JSC::VM& m_vm;
110 
111  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
112 
113 #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length) \\
114  JSC::SourceCode m_##name##Source;\\
115  JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
116  ${Prefix}_FOREACH_BUILTIN(DECLARE_BUILTIN_SOURCE_MEMBERS)
117 #undef DECLARE_BUILTIN_SOURCE_MEMBERS
118 
119 };
120 
121 #define DEFINE_BUILTIN_EXECUTABLES(name, functionName, length) \\
122 inline JSC::UnlinkedFunctionExecutable* ${Filename}BuiltinsWrapper::name##Executable() \\
123 {\\
124  if (!m_##name##Executable)\\
125  m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, functionName##PublicName(), s_##name##ConstructAbility), this, &m_##name##Executable);\\
126  return m_##name##Executable.get();\\
127 }
128 ${Prefix}_FOREACH_BUILTIN(DEFINE_BUILTIN_EXECUTABLES)
129 #undef DEFINE_BUILTIN_EXECUTABLES
130 
131 inline void ${Filename}BuiltinsWrapper::exportNames()
132 {
133 #define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
134  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
135 #undef EXPORT_FUNCTION_NAME
136 }
137 
138 class ${Filename}BuiltinFunctions {
139 public:
140  explicit ${Filename}BuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
141 
142  void init(JSC::JSGlobalObject&);
143  void visit(JSC::SlotVisitor&);
144 
145 public:
146  JSC::VM& m_vm;
147 
148 #define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \\
149  JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
150  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
151 #undef DECLARE_BUILTIN_SOURCE_MEMBERS
152 };
153 
154 inline void ${Filename}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
155 {
156 #define EXPORT_FUNCTION(codeName, functionName, length)\\
157  m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
158  ${Prefix}_FOREACH_BUILTIN(EXPORT_FUNCTION)
159 #undef EXPORT_FUNCTION
160 }
161 
162 inline void ${Filename}BuiltinFunctions::visit(JSC::SlotVisitor& visitor)
163 {
164 #define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
165  ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
166 #undef VISIT_FUNCTION
167 }
168 
169 } // namespace WebCore
170 
171 #endif // ${Filename}BuiltinsWrapper_h
172 """).substitute(dict(Filename=filename, Prefix=prefix)))
173 
174 builtinsWrapperHeader.close()
175 
176 if (not os.path.exists(output_base + ".h")) or (not filecmp.cmp(output_base + ".h.tmp", output_base + ".h", shallow=False)):
177  if (os.path.exists(output_base + ".h")):
178  os.remove(output_base + ".h")
179  os.rename(output_base + ".h.tmp", output_base + ".h")
180 else:
181  os.remove(output_base + ".h.tmp")

Tools/ChangeLog

 12015-10-20 Brian Burg <bburg@apple.com>
 2
 3 Restructure generate-js-bindings script to be modular and testable
 4 https://bugs.webkit.org/show_bug.cgi?id=149929
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Add a stub shell script and basic webkitpy support for running builtins
 9 generator tests.
 10
 11 * Scripts/run-builtins-generator-tests: Added.
 12 (main):
 13 * Scripts/webkitpy/codegen/__init__.py: Added.
 14 * Scripts/webkitpy/codegen/main.py: Added.
 15
 16 The only interesting difference here from the inspector protocol
 17 generator equivalent is that this implementation decodes the target
 18 framework and output mode (combined or separate) from the test's file name.
 19
 20 (BuiltinsGeneratorTests):
 21 (BuiltinsGeneratorTests.__init__):
 22 (BuiltinsGeneratorTests.generate_from_js_builtins):
 23 (BuiltinsGeneratorTests.write_error_file):
 24 (BuiltinsGeneratorTests.detect_changes):
 25 (BuiltinsGeneratorTests.run_tests):
 26 (BuiltinsGeneratorTests.main):
 27
1282015-10-20 Alexey Proskuryakov <ap@apple.com>
229
330 Mac Debug EWS never finishes when there are failures

Tools/Scripts/run-builtins-generator-tests

 1#!/usr/bin/env python
 2# Copyright (C) 2015 Apple Inc. All rights reserved.
 3#
 4# Redistribution and use in source and binary forms, with or without
 5# modification, are permitted provided that the following conditions
 6# are met:
 7# 1. Redistributions of source code must retain the above copyright
 8# notice, this list of conditions and the following disclaimer.
 9# 2. Redistributions in binary form must reproduce the above copyright
 10# notice, this list of conditions and the following disclaimer in the
 11# documentation and/or other materials provided with the distribution.
 12#
 13# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
 14# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 15# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
 17# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 18# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 19# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 20# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 21# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 22# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 23# THE POSSIBILITY OF SUCH DAMAGE.
 24
 25import sys
 26from webkitpy.common.system import executive
 27
 28def main(argv):
 29 """Runs the JS builtins code generator on test input files and compares
 30 the results with reference files.
 31
 32 Options:
 33 --reset-results: Overwrites the reference files with the generated results.
 34
 35 """
 36 reset_results = "--reset-results" in argv
 37
 38 from webkitpy.codegen.main import BuiltinsGeneratorTests
 39 return BuiltinsGeneratorTests(reset_results, executive.Executive()).main()
 40
 41if __name__ == '__main__':
 42 sys.exit(main(sys.argv))

Tools/Scripts/webkitpy/codegen/__init__.py

 1# Required for Python to search this directory for module files

Tools/Scripts/webkitpy/codegen/main.py

 1# Copyright (C) 2011 Google Inc. All rights reserved.
 2# Copyright (C) 2014 Apple Inc. All rights reserved.
 3#
 4# Redistribution and use in source and binary forms, with or without
 5# modification, are permitted provided that the following conditions
 6# are met:
 7#
 8# 1. Redistributions of source code must retain the above copyright
 9# notice, this list of conditions and the following disclaimer.
 10# 2. Redistributions in binary form must reproduce the above copyright
 11# notice, this list of conditions and the following disclaimer in the
 12# documentation and/or other materials provided with the distribution.
 13#
 14# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 15# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 16# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 17# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 18# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 19# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 20# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 21# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 22# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 23# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 24# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 25
 26import os
 27import os.path
 28import shutil
 29import sys
 30import tempfile
 31from webkitpy.common.checkout.scm.detection import detect_scm_system
 32from webkitpy.common.system.executive import ScriptError
 33
 34
 35class BuiltinsGeneratorTests:
 36
 37 def __init__(self, reset_results, executive):
 38 self.reset_results = reset_results
 39 self.executive = executive
 40
 41 def generate_from_js_builtins(self, builtins_file, output_directory, framework_name="", combined_outputs=False):
 42 cmd = ['python',
 43 'JavaScriptCore/Scripts/generate-js-builtins.py',
 44 '--output-directory', output_directory,
 45 '--force',
 46 '--framework', framework_name,
 47 '--test']
 48
 49 if combined_outputs:
 50 cmd.append('--combined')
 51
 52 cmd.append(builtins_file)
 53
 54 exit_code = 0
 55 try:
 56 stderr_output = self.executive.run_command(cmd)
 57 if stderr_output:
 58 self.write_error_file(builtins_file, output_directory, stderr_output)
 59 except ScriptError, e:
 60 print e.output
 61 exit_code = e.exit_code
 62 return exit_code
 63
 64 def write_error_file(self, input_filepath, output_directory, error_output):
 65 output_filepath = os.path.join(output_directory, os.path.basename(input_filepath) + '-error')
 66
 67 with open(output_filepath, "w") as output_file:
 68 output_file.write(error_output)
 69
 70 def detect_changes(self, work_directory, reference_directory):
 71 changes_found = False
 72 for output_file in os.listdir(work_directory):
 73 cmd = ['diff',
 74 '-u',
 75 '-N',
 76 os.path.join(reference_directory, output_file),
 77 os.path.join(work_directory, output_file)]
 78
 79 exit_code = 0
 80 try:
 81 output = self.executive.run_command(cmd)
 82 except ScriptError, e:
 83 output = e.output
 84 exit_code = e.exit_code
 85
 86 if exit_code or output:
 87 print 'FAIL: %s' % output_file
 88 print output
 89 changes_found = True
 90 else:
 91 print 'PASS: %s' % output_file
 92 return changes_found
 93
 94 def run_tests(self, input_directory, reference_directory):
 95 work_directory = reference_directory
 96
 97 passed = True
 98 for input_file in os.listdir(input_directory):
 99 (test_name, extension) = os.path.splitext(input_file)
 100 if extension != '.js':
 101 continue
 102 # Generate output into the work directory (either the given one or a
 103 # temp one if not reset_results is performed)
 104 if not self.reset_results:
 105 work_directory = tempfile.mkdtemp()
 106
 107 (framework_name, test_case, output_mode) = test_name.split('-')
 108 if not framework_name or not output_mode or not test_case:
 109 print "Invalid test case name: should be Framework-TestCaseName-OutputMode.js"
 110 continue
 111
 112 combined_outputs = output_mode == "Combined"
 113 if self.generate_from_js_builtins(os.path.join(input_directory, input_file), work_directory, framework_name=framework_name, combined_outputs=combined_outputs):
 114 passed = False
 115
 116 if self.reset_results:
 117 print "Reset results for test: %s" % (input_file)
 118 continue
 119
 120 # Detect changes
 121 if self.detect_changes(work_directory, reference_directory):
 122 passed = False
 123 shutil.rmtree(work_directory)
 124
 125 return passed
 126
 127 def main(self):
 128 current_scm = detect_scm_system(os.curdir)
 129 os.chdir(os.path.join(current_scm.checkout_root, 'Source'))
 130
 131 all_tests_passed = True
 132
 133 input_directory = os.path.join('JavaScriptCore', 'Scripts', 'tests', 'builtins')
 134 reference_directory = os.path.join('JavaScriptCore', 'Scripts', 'tests', 'builtins', 'expected')
 135 if not self.run_tests(input_directory, reference_directory):
 136 all_tests_passed = False
 137
 138 print ''
 139 if all_tests_passed:
 140 print 'All tests PASS!'
 141 return 0
 142 else:
 143 print 'Some tests FAIL! (To update the reference files, execute "run-builtins-generator-tests --reset-results")'
 144 return -1