mustang 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/Isolate +9 -0
- data/README.md +6 -12
- data/Rakefile +30 -4
- data/TODO.md +9 -0
- data/ext/v8/extconf.rb +56 -0
- data/ext/v8/v8.cpp +37 -0
- data/ext/v8/v8_array.cpp +161 -0
- data/ext/v8/v8_array.h +17 -0
- data/ext/v8/v8_base.cpp +147 -0
- data/ext/v8/v8_base.h +23 -0
- data/ext/v8/v8_cast.cpp +151 -0
- data/ext/v8/v8_cast.h +64 -0
- data/ext/v8/v8_context.cpp +174 -0
- data/ext/v8/v8_context.h +12 -0
- data/ext/v8/v8_date.cpp +61 -0
- data/ext/v8/v8_date.h +16 -0
- data/ext/v8/v8_errors.cpp +147 -0
- data/ext/v8/v8_errors.h +19 -0
- data/ext/v8/v8_external.cpp +66 -0
- data/ext/v8/v8_external.h +16 -0
- data/ext/v8/v8_function.cpp +182 -0
- data/ext/v8/v8_function.h +14 -0
- data/ext/v8/v8_integer.cpp +70 -0
- data/ext/v8/v8_integer.h +16 -0
- data/ext/v8/v8_macros.h +30 -0
- data/ext/v8/v8_main.cpp +53 -0
- data/ext/v8/v8_main.h +13 -0
- data/ext/v8/v8_number.cpp +62 -0
- data/ext/v8/v8_number.h +16 -0
- data/ext/v8/v8_object.cpp +172 -0
- data/ext/v8/v8_object.h +17 -0
- data/ext/v8/v8_ref.cpp +72 -0
- data/ext/v8/v8_ref.h +43 -0
- data/ext/v8/v8_regexp.cpp +148 -0
- data/ext/v8/v8_regexp.h +16 -0
- data/ext/v8/v8_string.cpp +78 -0
- data/ext/v8/v8_string.h +16 -0
- data/ext/v8/v8_value.cpp +370 -0
- data/ext/v8/v8_value.h +19 -0
- data/gemspec.yml +2 -1
- data/lib/core_ext/class.rb +14 -0
- data/lib/core_ext/object.rb +12 -0
- data/lib/core_ext/symbol.rb +23 -0
- data/lib/mustang.rb +44 -0
- data/lib/mustang/context.rb +69 -0
- data/lib/mustang/errors.rb +36 -0
- data/lib/support/delegated.rb +25 -0
- data/lib/v8/array.rb +21 -0
- data/lib/v8/context.rb +13 -0
- data/lib/v8/date.rb +20 -0
- data/lib/v8/error.rb +15 -0
- data/lib/v8/external.rb +16 -0
- data/lib/v8/function.rb +11 -0
- data/lib/v8/integer.rb +16 -0
- data/lib/v8/number.rb +16 -0
- data/lib/v8/object.rb +66 -0
- data/lib/v8/regexp.rb +23 -0
- data/lib/v8/string.rb +27 -0
- data/mustang.gemspec +3 -0
- data/spec/core_ext/class_spec.rb +19 -0
- data/spec/core_ext/object_spec.rb +19 -0
- data/spec/core_ext/symbol_spec.rb +27 -0
- data/spec/fixtures/test1.js +2 -0
- data/spec/fixtures/test2.js +2 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/v8/array_spec.rb +88 -0
- data/spec/v8/cast_spec.rb +151 -0
- data/spec/v8/context_spec.rb +78 -0
- data/spec/v8/data_spec.rb +39 -0
- data/spec/v8/date_spec.rb +45 -0
- data/spec/v8/empty_spec.rb +27 -0
- data/spec/v8/errors_spec.rb +142 -0
- data/spec/v8/external_spec.rb +44 -0
- data/spec/v8/function_spec.rb +170 -0
- data/spec/v8/integer_spec.rb +41 -0
- data/spec/v8/main_spec.rb +18 -0
- data/spec/v8/null_spec.rb +27 -0
- data/spec/v8/number_spec.rb +40 -0
- data/spec/v8/object_spec.rb +79 -0
- data/spec/v8/primitive_spec.rb +9 -0
- data/spec/v8/regexp_spec.rb +65 -0
- data/spec/v8/string_spec.rb +48 -0
- data/spec/v8/undefined_spec.rb +27 -0
- data/spec/v8/value_spec.rb +215 -0
- data/vendor/v8/.gitignore +2 -0
- data/vendor/v8/AUTHORS +3 -1
- data/vendor/v8/ChangeLog +117 -0
- data/vendor/v8/SConstruct +334 -53
- data/vendor/v8/include/v8-debug.h +21 -11
- data/vendor/v8/include/v8-preparser.h +1 -1
- data/vendor/v8/include/v8-profiler.h +122 -43
- data/vendor/v8/include/v8-testing.h +5 -0
- data/vendor/v8/include/v8.h +171 -17
- data/vendor/v8/preparser/SConscript +38 -0
- data/vendor/v8/preparser/preparser-process.cc +77 -114
- data/vendor/v8/samples/shell.cc +232 -46
- data/vendor/v8/src/SConscript +29 -5
- data/vendor/v8/src/accessors.cc +70 -211
- data/vendor/v8/{test/cctest/test-mips.cc → src/allocation-inl.h} +15 -18
- data/vendor/v8/src/allocation.cc +0 -82
- data/vendor/v8/src/allocation.h +9 -42
- data/vendor/v8/src/api.cc +1645 -1156
- data/vendor/v8/src/api.h +76 -12
- data/vendor/v8/src/apiutils.h +0 -7
- data/vendor/v8/src/arguments.h +15 -4
- data/vendor/v8/src/arm/assembler-arm-inl.h +10 -9
- data/vendor/v8/src/arm/assembler-arm.cc +62 -23
- data/vendor/v8/src/arm/assembler-arm.h +76 -11
- data/vendor/v8/src/arm/builtins-arm.cc +39 -33
- data/vendor/v8/src/arm/code-stubs-arm.cc +1182 -402
- data/vendor/v8/src/arm/code-stubs-arm.h +20 -54
- data/vendor/v8/src/arm/codegen-arm.cc +159 -106
- data/vendor/v8/src/arm/codegen-arm.h +6 -6
- data/vendor/v8/src/arm/constants-arm.h +16 -1
- data/vendor/v8/src/arm/cpu-arm.cc +7 -5
- data/vendor/v8/src/arm/debug-arm.cc +6 -4
- data/vendor/v8/src/arm/deoptimizer-arm.cc +51 -14
- data/vendor/v8/src/arm/disasm-arm.cc +47 -15
- data/vendor/v8/src/arm/frames-arm.h +1 -1
- data/vendor/v8/src/arm/full-codegen-arm.cc +724 -408
- data/vendor/v8/src/arm/ic-arm.cc +90 -85
- data/vendor/v8/src/arm/lithium-arm.cc +140 -69
- data/vendor/v8/src/arm/lithium-arm.h +161 -46
- data/vendor/v8/src/arm/lithium-codegen-arm.cc +567 -297
- data/vendor/v8/src/arm/lithium-codegen-arm.h +21 -9
- data/vendor/v8/src/arm/lithium-gap-resolver-arm.cc +2 -0
- data/vendor/v8/src/arm/macro-assembler-arm.cc +457 -96
- data/vendor/v8/src/arm/macro-assembler-arm.h +115 -18
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.cc +20 -13
- data/vendor/v8/src/arm/regexp-macro-assembler-arm.h +1 -0
- data/vendor/v8/src/arm/simulator-arm.cc +184 -101
- data/vendor/v8/src/arm/simulator-arm.h +26 -21
- data/vendor/v8/src/arm/stub-cache-arm.cc +450 -467
- data/vendor/v8/src/arm/virtual-frame-arm.cc +14 -12
- data/vendor/v8/src/arm/virtual-frame-arm.h +11 -8
- data/vendor/v8/src/array.js +35 -18
- data/vendor/v8/src/assembler.cc +186 -92
- data/vendor/v8/src/assembler.h +106 -69
- data/vendor/v8/src/ast-inl.h +5 -0
- data/vendor/v8/src/ast.cc +46 -35
- data/vendor/v8/src/ast.h +107 -50
- data/vendor/v8/src/atomicops.h +2 -0
- data/vendor/v8/src/atomicops_internals_mips_gcc.h +169 -0
- data/vendor/v8/src/bootstrapper.cc +649 -399
- data/vendor/v8/src/bootstrapper.h +94 -27
- data/vendor/v8/src/builtins.cc +359 -227
- data/vendor/v8/src/builtins.h +157 -123
- data/vendor/v8/src/checks.cc +2 -2
- data/vendor/v8/src/checks.h +4 -0
- data/vendor/v8/src/code-stubs.cc +27 -17
- data/vendor/v8/src/code-stubs.h +38 -17
- data/vendor/v8/src/codegen-inl.h +5 -1
- data/vendor/v8/src/codegen.cc +27 -17
- data/vendor/v8/src/codegen.h +9 -9
- data/vendor/v8/src/compilation-cache.cc +92 -206
- data/vendor/v8/src/compilation-cache.h +205 -30
- data/vendor/v8/src/compiler.cc +107 -120
- data/vendor/v8/src/compiler.h +17 -2
- data/vendor/v8/src/contexts.cc +22 -15
- data/vendor/v8/src/contexts.h +14 -8
- data/vendor/v8/src/conversions.cc +86 -30
- data/vendor/v8/src/counters.cc +19 -4
- data/vendor/v8/src/counters.h +28 -16
- data/vendor/v8/src/cpu-profiler-inl.h +4 -3
- data/vendor/v8/src/cpu-profiler.cc +123 -72
- data/vendor/v8/src/cpu-profiler.h +33 -19
- data/vendor/v8/src/cpu.h +2 -0
- data/vendor/v8/src/d8-debug.cc +3 -3
- data/vendor/v8/src/d8-debug.h +7 -6
- data/vendor/v8/src/d8-posix.cc +2 -0
- data/vendor/v8/src/d8.cc +22 -12
- data/vendor/v8/src/d8.gyp +3 -0
- data/vendor/v8/src/d8.js +618 -0
- data/vendor/v8/src/data-flow.h +3 -3
- data/vendor/v8/src/dateparser.h +4 -2
- data/vendor/v8/src/debug-agent.cc +10 -9
- data/vendor/v8/src/debug-agent.h +9 -11
- data/vendor/v8/src/debug-debugger.js +121 -0
- data/vendor/v8/src/debug.cc +331 -227
- data/vendor/v8/src/debug.h +248 -219
- data/vendor/v8/src/deoptimizer.cc +173 -62
- data/vendor/v8/src/deoptimizer.h +119 -19
- data/vendor/v8/src/disasm.h +3 -0
- data/vendor/v8/src/disassembler.cc +10 -9
- data/vendor/v8/src/execution.cc +185 -129
- data/vendor/v8/src/execution.h +47 -78
- data/vendor/v8/src/extensions/experimental/break-iterator.cc +250 -0
- data/vendor/v8/src/extensions/experimental/break-iterator.h +89 -0
- data/vendor/v8/src/extensions/experimental/experimental.gyp +2 -0
- data/vendor/v8/src/extensions/experimental/i18n-extension.cc +22 -2
- data/vendor/v8/src/extensions/externalize-string-extension.cc +2 -2
- data/vendor/v8/src/extensions/gc-extension.cc +1 -1
- data/vendor/v8/src/factory.cc +261 -154
- data/vendor/v8/src/factory.h +162 -158
- data/vendor/v8/src/flag-definitions.h +17 -11
- data/vendor/v8/src/frame-element.cc +0 -5
- data/vendor/v8/src/frame-element.h +9 -13
- data/vendor/v8/src/frames-inl.h +7 -0
- data/vendor/v8/src/frames.cc +56 -46
- data/vendor/v8/src/frames.h +36 -25
- data/vendor/v8/src/full-codegen.cc +15 -24
- data/vendor/v8/src/full-codegen.h +13 -41
- data/vendor/v8/src/func-name-inferrer.cc +7 -6
- data/vendor/v8/src/func-name-inferrer.h +1 -1
- data/vendor/v8/src/gdb-jit.cc +1 -0
- data/vendor/v8/src/global-handles.cc +118 -56
- data/vendor/v8/src/global-handles.h +98 -40
- data/vendor/v8/src/globals.h +2 -2
- data/vendor/v8/src/handles-inl.h +106 -9
- data/vendor/v8/src/handles.cc +220 -157
- data/vendor/v8/src/handles.h +38 -59
- data/vendor/v8/src/hashmap.h +3 -3
- data/vendor/v8/src/heap-inl.h +141 -25
- data/vendor/v8/src/heap-profiler.cc +117 -63
- data/vendor/v8/src/heap-profiler.h +38 -21
- data/vendor/v8/src/heap.cc +805 -564
- data/vendor/v8/src/heap.h +640 -594
- data/vendor/v8/src/hydrogen-instructions.cc +216 -73
- data/vendor/v8/src/hydrogen-instructions.h +259 -124
- data/vendor/v8/src/hydrogen.cc +996 -1171
- data/vendor/v8/src/hydrogen.h +163 -144
- data/vendor/v8/src/ia32/assembler-ia32-inl.h +12 -11
- data/vendor/v8/src/ia32/assembler-ia32.cc +85 -39
- data/vendor/v8/src/ia32/assembler-ia32.h +82 -16
- data/vendor/v8/src/ia32/builtins-ia32.cc +64 -58
- data/vendor/v8/src/ia32/code-stubs-ia32.cc +248 -324
- data/vendor/v8/src/ia32/code-stubs-ia32.h +3 -44
- data/vendor/v8/src/ia32/codegen-ia32.cc +217 -165
- data/vendor/v8/src/ia32/codegen-ia32.h +3 -0
- data/vendor/v8/src/ia32/cpu-ia32.cc +6 -5
- data/vendor/v8/src/ia32/debug-ia32.cc +8 -5
- data/vendor/v8/src/ia32/deoptimizer-ia32.cc +124 -14
- data/vendor/v8/src/ia32/disasm-ia32.cc +85 -62
- data/vendor/v8/src/ia32/frames-ia32.h +1 -1
- data/vendor/v8/src/ia32/full-codegen-ia32.cc +348 -435
- data/vendor/v8/src/ia32/ic-ia32.cc +91 -91
- data/vendor/v8/src/ia32/lithium-codegen-ia32.cc +500 -255
- data/vendor/v8/src/ia32/lithium-codegen-ia32.h +13 -4
- data/vendor/v8/src/ia32/lithium-gap-resolver-ia32.cc +6 -0
- data/vendor/v8/src/ia32/lithium-ia32.cc +122 -45
- data/vendor/v8/src/ia32/lithium-ia32.h +128 -41
- data/vendor/v8/src/ia32/macro-assembler-ia32.cc +109 -84
- data/vendor/v8/src/ia32/macro-assembler-ia32.h +18 -9
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.cc +26 -15
- data/vendor/v8/src/ia32/regexp-macro-assembler-ia32.h +1 -0
- data/vendor/v8/src/ia32/register-allocator-ia32.cc +30 -30
- data/vendor/v8/src/ia32/simulator-ia32.h +4 -4
- data/vendor/v8/src/ia32/stub-cache-ia32.cc +383 -400
- data/vendor/v8/src/ia32/virtual-frame-ia32.cc +36 -13
- data/vendor/v8/src/ia32/virtual-frame-ia32.h +11 -5
- data/vendor/v8/src/ic-inl.h +12 -2
- data/vendor/v8/src/ic.cc +304 -221
- data/vendor/v8/src/ic.h +115 -58
- data/vendor/v8/src/interpreter-irregexp.cc +25 -21
- data/vendor/v8/src/interpreter-irregexp.h +2 -1
- data/vendor/v8/src/isolate.cc +883 -0
- data/vendor/v8/src/isolate.h +1304 -0
- data/vendor/v8/src/json.js +10 -10
- data/vendor/v8/src/jsregexp.cc +111 -80
- data/vendor/v8/src/jsregexp.h +6 -7
- data/vendor/v8/src/jump-target-heavy.cc +5 -8
- data/vendor/v8/src/jump-target-heavy.h +0 -6
- data/vendor/v8/src/jump-target-inl.h +1 -1
- data/vendor/v8/src/jump-target-light.cc +3 -3
- data/vendor/v8/src/lithium-allocator-inl.h +2 -0
- data/vendor/v8/src/lithium-allocator.cc +42 -30
- data/vendor/v8/src/lithium-allocator.h +8 -22
- data/vendor/v8/src/lithium.cc +1 -0
- data/vendor/v8/src/liveedit.cc +141 -99
- data/vendor/v8/src/liveedit.h +7 -2
- data/vendor/v8/src/liveobjectlist-inl.h +90 -0
- data/vendor/v8/src/liveobjectlist.cc +2537 -1
- data/vendor/v8/src/liveobjectlist.h +245 -35
- data/vendor/v8/src/log-utils.cc +122 -35
- data/vendor/v8/src/log-utils.h +33 -36
- data/vendor/v8/src/log.cc +299 -241
- data/vendor/v8/src/log.h +177 -110
- data/vendor/v8/src/mark-compact.cc +612 -470
- data/vendor/v8/src/mark-compact.h +153 -80
- data/vendor/v8/src/messages.cc +16 -14
- data/vendor/v8/src/messages.js +30 -7
- data/vendor/v8/src/mips/assembler-mips-inl.h +155 -35
- data/vendor/v8/src/mips/assembler-mips.cc +1093 -219
- data/vendor/v8/src/mips/assembler-mips.h +552 -153
- data/vendor/v8/src/mips/builtins-mips.cc +43 -100
- data/vendor/v8/src/mips/code-stubs-mips.cc +752 -0
- data/vendor/v8/src/mips/code-stubs-mips.h +511 -0
- data/vendor/v8/src/mips/codegen-mips-inl.h +8 -14
- data/vendor/v8/src/mips/codegen-mips.cc +672 -896
- data/vendor/v8/src/mips/codegen-mips.h +271 -69
- data/vendor/v8/src/mips/constants-mips.cc +44 -20
- data/vendor/v8/src/mips/constants-mips.h +238 -40
- data/vendor/v8/src/mips/cpu-mips.cc +20 -3
- data/vendor/v8/src/mips/debug-mips.cc +35 -7
- data/vendor/v8/src/mips/deoptimizer-mips.cc +91 -0
- data/vendor/v8/src/mips/disasm-mips.cc +329 -93
- data/vendor/v8/src/mips/frames-mips.cc +2 -50
- data/vendor/v8/src/mips/frames-mips.h +24 -9
- data/vendor/v8/src/mips/full-codegen-mips.cc +473 -23
- data/vendor/v8/src/mips/ic-mips.cc +81 -45
- data/vendor/v8/src/mips/jump-target-mips.cc +11 -106
- data/vendor/v8/src/mips/lithium-codegen-mips.h +65 -0
- data/vendor/v8/src/mips/lithium-mips.h +304 -0
- data/vendor/v8/src/mips/macro-assembler-mips.cc +2391 -390
- data/vendor/v8/src/mips/macro-assembler-mips.h +718 -121
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.cc +478 -0
- data/vendor/v8/src/mips/regexp-macro-assembler-mips.h +250 -0
- data/vendor/v8/src/mips/register-allocator-mips-inl.h +0 -3
- data/vendor/v8/src/mips/register-allocator-mips.h +3 -2
- data/vendor/v8/src/mips/simulator-mips.cc +1009 -221
- data/vendor/v8/src/mips/simulator-mips.h +119 -36
- data/vendor/v8/src/mips/stub-cache-mips.cc +331 -148
- data/vendor/v8/src/mips/{fast-codegen-mips.cc → virtual-frame-mips-inl.h} +11 -30
- data/vendor/v8/src/mips/virtual-frame-mips.cc +137 -149
- data/vendor/v8/src/mips/virtual-frame-mips.h +294 -312
- data/vendor/v8/src/mirror-debugger.js +9 -8
- data/vendor/v8/src/mksnapshot.cc +2 -2
- data/vendor/v8/src/objects-debug.cc +16 -16
- data/vendor/v8/src/objects-inl.h +421 -195
- data/vendor/v8/src/objects-printer.cc +7 -7
- data/vendor/v8/src/objects-visiting.cc +1 -1
- data/vendor/v8/src/objects-visiting.h +33 -12
- data/vendor/v8/src/objects.cc +935 -658
- data/vendor/v8/src/objects.h +234 -139
- data/vendor/v8/src/parser.cc +484 -439
- data/vendor/v8/src/parser.h +35 -14
- data/vendor/v8/src/platform-cygwin.cc +173 -107
- data/vendor/v8/src/platform-freebsd.cc +224 -72
- data/vendor/v8/src/platform-linux.cc +234 -95
- data/vendor/v8/src/platform-macos.cc +215 -82
- data/vendor/v8/src/platform-nullos.cc +9 -3
- data/vendor/v8/src/platform-openbsd.cc +22 -7
- data/vendor/v8/src/platform-posix.cc +30 -5
- data/vendor/v8/src/platform-solaris.cc +120 -38
- data/vendor/v8/src/platform-tls-mac.h +62 -0
- data/vendor/v8/src/platform-tls-win32.h +62 -0
- data/vendor/v8/src/platform-tls.h +50 -0
- data/vendor/v8/src/platform-win32.cc +195 -97
- data/vendor/v8/src/platform.h +72 -15
- data/vendor/v8/src/preparse-data.cc +2 -0
- data/vendor/v8/src/preparser-api.cc +8 -2
- data/vendor/v8/src/preparser.cc +1 -1
- data/vendor/v8/src/prettyprinter.cc +43 -52
- data/vendor/v8/src/prettyprinter.h +1 -1
- data/vendor/v8/src/profile-generator-inl.h +0 -28
- data/vendor/v8/src/profile-generator.cc +942 -685
- data/vendor/v8/src/profile-generator.h +210 -176
- data/vendor/v8/src/property.cc +6 -0
- data/vendor/v8/src/property.h +14 -3
- data/vendor/v8/src/regexp-macro-assembler-irregexp.cc +1 -1
- data/vendor/v8/src/regexp-macro-assembler.cc +28 -19
- data/vendor/v8/src/regexp-macro-assembler.h +11 -6
- data/vendor/v8/src/regexp-stack.cc +18 -10
- data/vendor/v8/src/regexp-stack.h +45 -21
- data/vendor/v8/src/regexp.js +3 -3
- data/vendor/v8/src/register-allocator-inl.h +3 -3
- data/vendor/v8/src/register-allocator.cc +1 -7
- data/vendor/v8/src/register-allocator.h +5 -15
- data/vendor/v8/src/rewriter.cc +2 -1
- data/vendor/v8/src/runtime-profiler.cc +158 -128
- data/vendor/v8/src/runtime-profiler.h +131 -15
- data/vendor/v8/src/runtime.cc +2409 -1692
- data/vendor/v8/src/runtime.h +93 -17
- data/vendor/v8/src/safepoint-table.cc +3 -0
- data/vendor/v8/src/safepoint-table.h +9 -3
- data/vendor/v8/src/scanner-base.cc +21 -28
- data/vendor/v8/src/scanner-base.h +22 -11
- data/vendor/v8/src/scanner.cc +3 -5
- data/vendor/v8/src/scanner.h +4 -2
- data/vendor/v8/src/scopeinfo.cc +11 -16
- data/vendor/v8/src/scopeinfo.h +26 -15
- data/vendor/v8/src/scopes.cc +67 -37
- data/vendor/v8/src/scopes.h +26 -12
- data/vendor/v8/src/serialize.cc +193 -154
- data/vendor/v8/src/serialize.h +41 -36
- data/vendor/v8/src/small-pointer-list.h +163 -0
- data/vendor/v8/src/snapshot-common.cc +1 -1
- data/vendor/v8/src/snapshot.h +3 -1
- data/vendor/v8/src/spaces-inl.h +30 -25
- data/vendor/v8/src/spaces.cc +263 -370
- data/vendor/v8/src/spaces.h +178 -166
- data/vendor/v8/src/string-search.cc +4 -3
- data/vendor/v8/src/string-search.h +21 -20
- data/vendor/v8/src/string-stream.cc +32 -24
- data/vendor/v8/src/string.js +7 -7
- data/vendor/v8/src/stub-cache.cc +324 -248
- data/vendor/v8/src/stub-cache.h +181 -155
- data/vendor/v8/src/token.cc +3 -3
- data/vendor/v8/src/token.h +3 -3
- data/vendor/v8/src/top.cc +218 -390
- data/vendor/v8/src/type-info.cc +98 -32
- data/vendor/v8/src/type-info.h +10 -3
- data/vendor/v8/src/unicode.cc +1 -1
- data/vendor/v8/src/unicode.h +1 -1
- data/vendor/v8/src/utils.h +3 -0
- data/vendor/v8/src/v8-counters.cc +18 -11
- data/vendor/v8/src/v8-counters.h +34 -13
- data/vendor/v8/src/v8.cc +66 -121
- data/vendor/v8/src/v8.h +7 -4
- data/vendor/v8/src/v8globals.h +18 -12
- data/vendor/v8/src/{memory.h → v8memory.h} +0 -0
- data/vendor/v8/src/v8natives.js +59 -18
- data/vendor/v8/src/v8threads.cc +127 -114
- data/vendor/v8/src/v8threads.h +42 -35
- data/vendor/v8/src/v8utils.h +2 -39
- data/vendor/v8/src/variables.h +1 -1
- data/vendor/v8/src/version.cc +26 -5
- data/vendor/v8/src/version.h +4 -0
- data/vendor/v8/src/virtual-frame-heavy-inl.h +2 -4
- data/vendor/v8/src/virtual-frame-light-inl.h +5 -4
- data/vendor/v8/src/vm-state-inl.h +21 -17
- data/vendor/v8/src/vm-state.h +7 -5
- data/vendor/v8/src/win32-headers.h +1 -0
- data/vendor/v8/src/x64/assembler-x64-inl.h +12 -11
- data/vendor/v8/src/x64/assembler-x64.cc +80 -40
- data/vendor/v8/src/x64/assembler-x64.h +67 -17
- data/vendor/v8/src/x64/builtins-x64.cc +34 -33
- data/vendor/v8/src/x64/code-stubs-x64.cc +636 -377
- data/vendor/v8/src/x64/code-stubs-x64.h +14 -48
- data/vendor/v8/src/x64/codegen-x64-inl.h +1 -1
- data/vendor/v8/src/x64/codegen-x64.cc +158 -136
- data/vendor/v8/src/x64/codegen-x64.h +4 -1
- data/vendor/v8/src/x64/cpu-x64.cc +7 -5
- data/vendor/v8/src/x64/debug-x64.cc +8 -6
- data/vendor/v8/src/x64/deoptimizer-x64.cc +195 -20
- data/vendor/v8/src/x64/disasm-x64.cc +42 -23
- data/vendor/v8/src/x64/frames-x64.cc +1 -1
- data/vendor/v8/src/x64/frames-x64.h +2 -2
- data/vendor/v8/src/x64/full-codegen-x64.cc +780 -218
- data/vendor/v8/src/x64/ic-x64.cc +77 -79
- data/vendor/v8/src/x64/jump-target-x64.cc +1 -1
- data/vendor/v8/src/x64/lithium-codegen-x64.cc +698 -181
- data/vendor/v8/src/x64/lithium-codegen-x64.h +31 -6
- data/vendor/v8/src/x64/lithium-x64.cc +136 -54
- data/vendor/v8/src/x64/lithium-x64.h +142 -51
- data/vendor/v8/src/x64/macro-assembler-x64.cc +456 -187
- data/vendor/v8/src/x64/macro-assembler-x64.h +166 -34
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.cc +44 -28
- data/vendor/v8/src/x64/regexp-macro-assembler-x64.h +8 -4
- data/vendor/v8/src/x64/register-allocator-x64-inl.h +3 -3
- data/vendor/v8/src/x64/register-allocator-x64.cc +12 -8
- data/vendor/v8/src/x64/simulator-x64.h +5 -5
- data/vendor/v8/src/x64/stub-cache-x64.cc +299 -344
- data/vendor/v8/src/x64/virtual-frame-x64.cc +37 -13
- data/vendor/v8/src/x64/virtual-frame-x64.h +13 -7
- data/vendor/v8/src/zone-inl.h +49 -3
- data/vendor/v8/src/zone.cc +42 -41
- data/vendor/v8/src/zone.h +37 -34
- data/vendor/v8/test/benchmarks/testcfg.py +100 -0
- data/vendor/v8/test/cctest/SConscript +5 -4
- data/vendor/v8/test/cctest/cctest.h +3 -2
- data/vendor/v8/test/cctest/cctest.status +6 -11
- data/vendor/v8/test/cctest/test-accessors.cc +3 -3
- data/vendor/v8/test/cctest/test-alloc.cc +39 -33
- data/vendor/v8/test/cctest/test-api.cc +1092 -205
- data/vendor/v8/test/cctest/test-assembler-arm.cc +39 -25
- data/vendor/v8/test/cctest/test-assembler-ia32.cc +36 -37
- data/vendor/v8/test/cctest/test-assembler-mips.cc +1098 -40
- data/vendor/v8/test/cctest/test-assembler-x64.cc +32 -25
- data/vendor/v8/test/cctest/test-ast.cc +1 -0
- data/vendor/v8/test/cctest/test-circular-queue.cc +8 -5
- data/vendor/v8/test/cctest/test-compiler.cc +24 -24
- data/vendor/v8/test/cctest/test-cpu-profiler.cc +140 -5
- data/vendor/v8/test/cctest/test-dataflow.cc +1 -0
- data/vendor/v8/test/cctest/test-debug.cc +136 -77
- data/vendor/v8/test/cctest/test-decls.cc +1 -1
- data/vendor/v8/test/cctest/test-deoptimization.cc +25 -24
- data/vendor/v8/test/cctest/test-disasm-arm.cc +9 -4
- data/vendor/v8/test/cctest/test-disasm-ia32.cc +10 -8
- data/vendor/v8/test/cctest/test-func-name-inference.cc +10 -4
- data/vendor/v8/test/cctest/test-heap-profiler.cc +226 -164
- data/vendor/v8/test/cctest/test-heap.cc +240 -217
- data/vendor/v8/test/cctest/test-liveedit.cc +1 -0
- data/vendor/v8/test/cctest/test-log-stack-tracer.cc +18 -20
- data/vendor/v8/test/cctest/test-log.cc +114 -108
- data/vendor/v8/test/cctest/test-macro-assembler-x64.cc +247 -177
- data/vendor/v8/test/cctest/test-mark-compact.cc +129 -90
- data/vendor/v8/test/cctest/test-parsing.cc +15 -14
- data/vendor/v8/test/cctest/test-platform-linux.cc +1 -0
- data/vendor/v8/test/cctest/test-platform-tls.cc +66 -0
- data/vendor/v8/test/cctest/test-platform-win32.cc +1 -0
- data/vendor/v8/test/cctest/test-profile-generator.cc +1 -1
- data/vendor/v8/test/cctest/test-regexp.cc +53 -41
- data/vendor/v8/test/cctest/test-reloc-info.cc +18 -11
- data/vendor/v8/test/cctest/test-serialize.cc +44 -43
- data/vendor/v8/test/cctest/test-sockets.cc +8 -3
- data/vendor/v8/test/cctest/test-spaces.cc +47 -29
- data/vendor/v8/test/cctest/test-strings.cc +20 -20
- data/vendor/v8/test/cctest/test-thread-termination.cc +8 -3
- data/vendor/v8/test/cctest/test-threads.cc +5 -3
- data/vendor/v8/test/cctest/test-utils.cc +5 -4
- data/vendor/v8/test/cctest/testcfg.py +7 -3
- data/vendor/v8/test/es5conform/es5conform.status +2 -77
- data/vendor/v8/test/es5conform/testcfg.py +1 -1
- data/vendor/v8/test/message/testcfg.py +1 -1
- data/vendor/v8/test/mjsunit/accessors-on-global-object.js +3 -3
- data/vendor/v8/test/mjsunit/array-concat.js +43 -1
- data/vendor/v8/test/mjsunit/array-join.js +25 -0
- data/vendor/v8/test/mjsunit/bitops-info.js +7 -1
- data/vendor/v8/test/mjsunit/compiler/array-length.js +2 -2
- data/vendor/v8/test/mjsunit/compiler/global-accessors.js +47 -0
- data/vendor/v8/test/mjsunit/compiler/pic.js +1 -1
- data/vendor/v8/test/mjsunit/compiler/regress-loadfield.js +65 -0
- data/vendor/v8/test/mjsunit/math-sqrt.js +5 -1
- data/vendor/v8/test/mjsunit/mjsunit.js +59 -8
- data/vendor/v8/test/mjsunit/mjsunit.status +0 -12
- data/vendor/v8/test/mjsunit/mul-exhaustive.js +129 -11
- data/vendor/v8/test/mjsunit/negate-zero.js +1 -1
- data/vendor/v8/test/mjsunit/object-freeze.js +5 -13
- data/vendor/v8/test/mjsunit/object-prevent-extensions.js +9 -50
- data/vendor/v8/test/mjsunit/object-seal.js +4 -13
- data/vendor/v8/test/mjsunit/override-eval-with-non-function.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-1145.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-1172-bis.js +37 -0
- data/vendor/v8/test/mjsunit/regress/regress-1181.js +54 -0
- data/vendor/v8/test/mjsunit/regress/regress-1207.js +35 -0
- data/vendor/v8/test/mjsunit/regress/regress-1209.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-1210.js +48 -0
- data/vendor/v8/test/mjsunit/regress/regress-1213.js +43 -0
- data/vendor/v8/test/mjsunit/regress/regress-1218.js +29 -0
- data/vendor/v8/test/mjsunit/regress/regress-1229.js +79 -0
- data/vendor/v8/test/mjsunit/regress/regress-1233.js +47 -0
- data/vendor/v8/test/mjsunit/regress/regress-1236.js +34 -0
- data/vendor/v8/test/mjsunit/regress/regress-1237.js +36 -0
- data/vendor/v8/test/mjsunit/regress/regress-1240.js +39 -0
- data/vendor/v8/test/mjsunit/regress/regress-1257.js +58 -0
- data/vendor/v8/test/mjsunit/regress/regress-1278.js +69 -0
- data/vendor/v8/test/mjsunit/regress/regress-create-exception.js +1 -0
- data/vendor/v8/test/mjsunit/regress/regress-lazy-deopt-reloc.js +52 -0
- data/vendor/v8/test/mjsunit/sin-cos.js +15 -10
- data/vendor/v8/test/mjsunit/smi-negative-zero.js +2 -2
- data/vendor/v8/test/mjsunit/str-to-num.js +1 -1
- data/vendor/v8/test/mjsunit/strict-mode.js +435 -0
- data/vendor/v8/test/mjsunit/testcfg.py +23 -6
- data/vendor/v8/test/mozilla/mozilla.status +0 -2
- data/vendor/v8/test/mozilla/testcfg.py +1 -1
- data/vendor/v8/test/preparser/empty.js +28 -0
- data/vendor/v8/test/preparser/functions-only.js +38 -0
- data/vendor/v8/test/preparser/non-alphanum.js +34 -0
- data/vendor/v8/test/preparser/symbols-only.js +49 -0
- data/vendor/v8/test/preparser/testcfg.py +90 -0
- data/vendor/v8/test/sputnik/testcfg.py +1 -1
- data/vendor/v8/test/test262/README +16 -0
- data/vendor/v8/test/test262/harness-adapt.js +80 -0
- data/vendor/v8/test/test262/test262.status +1506 -0
- data/vendor/v8/test/test262/testcfg.py +123 -0
- data/vendor/v8/tools/freebsd-tick-processor +10 -0
- data/vendor/v8/tools/gyp/v8.gyp +8 -33
- data/vendor/v8/tools/linux-tick-processor +5 -3
- data/vendor/v8/tools/test.py +37 -14
- data/vendor/v8/tools/tickprocessor.js +22 -8
- data/vendor/v8/tools/visual_studio/v8_base.vcproj +13 -1
- data/vendor/v8/tools/visual_studio/v8_base_arm.vcproj +5 -1
- data/vendor/v8/tools/visual_studio/v8_base_x64.vcproj +5 -1
- data/vendor/v8/tools/visual_studio/x64.vsprops +1 -0
- metadata +1495 -1341
- data/ext/extconf.rb +0 -22
- data/ext/mustang.cpp +0 -58
- data/vendor/v8/src/top.h +0 -608
@@ -39,31 +39,54 @@ namespace internal {
|
|
39
39
|
// At GC the destroyed global handles are removed from the free list
|
40
40
|
// and deallocated.
|
41
41
|
|
42
|
-
// Callback function on handling weak global handles.
|
43
|
-
// typedef bool (*WeakSlotCallback)(Object** pointer);
|
44
|
-
|
45
42
|
// An object group is treated like a single JS object: if one of object in
|
46
43
|
// the group is alive, all objects in the same group are considered alive.
|
47
44
|
// An object group is used to simulate object relationship in a DOM tree.
|
48
45
|
class ObjectGroup : public Malloced {
|
49
46
|
public:
|
50
47
|
ObjectGroup() : objects_(4) {}
|
51
|
-
|
52
|
-
: objects_(static_cast<int>(capacity))
|
48
|
+
ObjectGroup(size_t capacity, v8::RetainedObjectInfo* info)
|
49
|
+
: objects_(static_cast<int>(capacity)),
|
50
|
+
info_(info) { }
|
51
|
+
~ObjectGroup();
|
53
52
|
|
54
53
|
List<Object**> objects_;
|
54
|
+
v8::RetainedObjectInfo* info_;
|
55
|
+
|
56
|
+
private:
|
57
|
+
DISALLOW_COPY_AND_ASSIGN(ObjectGroup);
|
58
|
+
};
|
59
|
+
|
60
|
+
|
61
|
+
// An implicit references group consists of two parts: a parent object and
|
62
|
+
// a list of children objects. If the parent is alive, all the children
|
63
|
+
// are alive too.
|
64
|
+
class ImplicitRefGroup : public Malloced {
|
65
|
+
public:
|
66
|
+
ImplicitRefGroup() : children_(4) {}
|
67
|
+
ImplicitRefGroup(HeapObject* parent, size_t capacity)
|
68
|
+
: parent_(parent),
|
69
|
+
children_(static_cast<int>(capacity)) { }
|
70
|
+
|
71
|
+
HeapObject* parent_;
|
72
|
+
List<Object**> children_;
|
73
|
+
|
74
|
+
private:
|
75
|
+
DISALLOW_COPY_AND_ASSIGN(ImplicitRefGroup);
|
55
76
|
};
|
56
77
|
|
57
78
|
|
58
79
|
typedef void (*WeakReferenceGuest)(Object* object, void* parameter);
|
59
80
|
|
60
|
-
class GlobalHandles
|
81
|
+
class GlobalHandles {
|
61
82
|
public:
|
83
|
+
~GlobalHandles();
|
84
|
+
|
62
85
|
// Creates a new global handle that is alive until Destroy is called.
|
63
|
-
|
86
|
+
Handle<Object> Create(Object* value);
|
64
87
|
|
65
88
|
// Destroy a global handle.
|
66
|
-
|
89
|
+
void Destroy(Object** location);
|
67
90
|
|
68
91
|
// Make the global handle weak and set the callback parameter for the
|
69
92
|
// handle. When the garbage collector recognizes that only weak global
|
@@ -71,23 +94,25 @@ class GlobalHandles : public AllStatic {
|
|
71
94
|
// function is invoked (for each handle) with the handle and corresponding
|
72
95
|
// parameter as arguments. Note: cleared means set to Smi::FromInt(0). The
|
73
96
|
// reason is that Smi::FromInt(0) does not change during garage collection.
|
74
|
-
|
75
|
-
|
76
|
-
|
97
|
+
void MakeWeak(Object** location,
|
98
|
+
void* parameter,
|
99
|
+
WeakReferenceCallback callback);
|
100
|
+
|
101
|
+
static void SetWrapperClassId(Object** location, uint16_t class_id);
|
77
102
|
|
78
103
|
// Returns the current number of weak handles.
|
79
|
-
|
104
|
+
int NumberOfWeakHandles() { return number_of_weak_handles_; }
|
80
105
|
|
81
|
-
|
106
|
+
void RecordStats(HeapStats* stats);
|
82
107
|
|
83
108
|
// Returns the current number of weak handles to global objects.
|
84
109
|
// These handles are also included in NumberOfWeakHandles().
|
85
|
-
|
110
|
+
int NumberOfGlobalObjectWeakHandles() {
|
86
111
|
return number_of_global_object_weak_handles_;
|
87
112
|
}
|
88
113
|
|
89
114
|
// Clear the weakness of a global handle.
|
90
|
-
|
115
|
+
void ClearWeakness(Object** location);
|
91
116
|
|
92
117
|
// Tells whether global handle is near death.
|
93
118
|
static bool IsNearDeath(Object** location);
|
@@ -97,65 +122,89 @@ class GlobalHandles : public AllStatic {
|
|
97
122
|
|
98
123
|
// Process pending weak handles.
|
99
124
|
// Returns true if next major GC is likely to collect more garbage.
|
100
|
-
|
125
|
+
bool PostGarbageCollectionProcessing();
|
101
126
|
|
102
127
|
// Iterates over all strong handles.
|
103
|
-
|
128
|
+
void IterateStrongRoots(ObjectVisitor* v);
|
104
129
|
|
105
130
|
// Iterates over all handles.
|
106
|
-
|
131
|
+
void IterateAllRoots(ObjectVisitor* v);
|
132
|
+
|
133
|
+
// Iterates over all handles that have embedder-assigned class ID.
|
134
|
+
void IterateAllRootsWithClassIds(ObjectVisitor* v);
|
107
135
|
|
108
136
|
// Iterates over all weak roots in heap.
|
109
|
-
|
137
|
+
void IterateWeakRoots(ObjectVisitor* v);
|
110
138
|
|
111
139
|
// Iterates over weak roots that are bound to a given callback.
|
112
|
-
|
113
|
-
|
140
|
+
void IterateWeakRoots(WeakReferenceGuest f,
|
141
|
+
WeakReferenceCallback callback);
|
114
142
|
|
115
143
|
// Find all weak handles satisfying the callback predicate, mark
|
116
144
|
// them as pending.
|
117
|
-
|
145
|
+
void IdentifyWeakHandles(WeakSlotCallback f);
|
118
146
|
|
119
147
|
// Add an object group.
|
120
|
-
// Should only used in GC callback function before a collection.
|
148
|
+
// Should be only used in GC callback function before a collection.
|
149
|
+
// All groups are destroyed after a mark-compact collection.
|
150
|
+
void AddObjectGroup(Object*** handles,
|
151
|
+
size_t length,
|
152
|
+
v8::RetainedObjectInfo* info);
|
153
|
+
|
154
|
+
// Add an implicit references' group.
|
155
|
+
// Should be only used in GC callback function before a collection.
|
121
156
|
// All groups are destroyed after a mark-compact collection.
|
122
|
-
|
157
|
+
void AddImplicitReferences(HeapObject* parent,
|
158
|
+
Object*** children,
|
159
|
+
size_t length);
|
123
160
|
|
124
161
|
// Returns the object groups.
|
125
|
-
|
162
|
+
List<ObjectGroup*>* object_groups() { return &object_groups_; }
|
163
|
+
|
164
|
+
// Returns the implicit references' groups.
|
165
|
+
List<ImplicitRefGroup*>* implicit_ref_groups() {
|
166
|
+
return &implicit_ref_groups_;
|
167
|
+
}
|
126
168
|
|
127
169
|
// Remove bags, this should only happen after GC.
|
128
|
-
|
170
|
+
void RemoveObjectGroups();
|
171
|
+
void RemoveImplicitRefGroups();
|
129
172
|
|
130
173
|
// Tear down the global handle structure.
|
131
|
-
|
174
|
+
void TearDown();
|
175
|
+
|
176
|
+
Isolate* isolate() { return isolate_; }
|
132
177
|
|
133
178
|
#ifdef DEBUG
|
134
|
-
|
135
|
-
|
179
|
+
void PrintStats();
|
180
|
+
void Print();
|
136
181
|
#endif
|
137
182
|
class Pool;
|
138
183
|
private:
|
184
|
+
explicit GlobalHandles(Isolate* isolate);
|
185
|
+
|
139
186
|
// Internal node structure, one for each global handle.
|
140
187
|
class Node;
|
141
188
|
|
189
|
+
Isolate* isolate_;
|
190
|
+
|
142
191
|
// Field always containing the number of weak and near-death handles.
|
143
|
-
|
192
|
+
int number_of_weak_handles_;
|
144
193
|
|
145
194
|
// Field always containing the number of weak and near-death handles
|
146
195
|
// to global objects. These objects are also included in
|
147
196
|
// number_of_weak_handles_.
|
148
|
-
|
197
|
+
int number_of_global_object_weak_handles_;
|
149
198
|
|
150
199
|
// Global handles are kept in a single linked list pointed to by head_.
|
151
|
-
|
152
|
-
|
153
|
-
|
200
|
+
Node* head_;
|
201
|
+
Node* head() { return head_; }
|
202
|
+
void set_head(Node* value) { head_ = value; }
|
154
203
|
|
155
204
|
// Free list for DESTROYED global handles not yet deallocated.
|
156
|
-
|
157
|
-
|
158
|
-
|
205
|
+
Node* first_free_;
|
206
|
+
Node* first_free() { return first_free_; }
|
207
|
+
void set_first_free(Node* value) { first_free_ = value; }
|
159
208
|
|
160
209
|
// List of deallocated nodes.
|
161
210
|
// Deallocated nodes form a prefix of all the nodes and
|
@@ -168,11 +217,20 @@ class GlobalHandles : public AllStatic {
|
|
168
217
|
// node node ... node node
|
169
218
|
// .next -> .next -> .next ->
|
170
219
|
// <- .next_free <- .next_free <- .next_free
|
171
|
-
|
172
|
-
|
173
|
-
|
220
|
+
Node* first_deallocated_;
|
221
|
+
Node* first_deallocated() { return first_deallocated_; }
|
222
|
+
void set_first_deallocated(Node* value) {
|
174
223
|
first_deallocated_ = value;
|
175
224
|
}
|
225
|
+
|
226
|
+
Pool* pool_;
|
227
|
+
int post_gc_processing_count_;
|
228
|
+
List<ObjectGroup*> object_groups_;
|
229
|
+
List<ImplicitRefGroup*> implicit_ref_groups_;
|
230
|
+
|
231
|
+
friend class Isolate;
|
232
|
+
|
233
|
+
DISALLOW_COPY_AND_ASSIGN(GlobalHandles);
|
176
234
|
};
|
177
235
|
|
178
236
|
|
data/vendor/v8/src/globals.h
CHANGED
@@ -54,7 +54,7 @@ namespace internal {
|
|
54
54
|
#if CAN_USE_UNALIGNED_ACCESSES
|
55
55
|
#define V8_HOST_CAN_READ_UNALIGNED 1
|
56
56
|
#endif
|
57
|
-
#elif defined(
|
57
|
+
#elif defined(__MIPSEL__)
|
58
58
|
#define V8_HOST_ARCH_MIPS 1
|
59
59
|
#define V8_HOST_ARCH_32_BIT 1
|
60
60
|
#else
|
@@ -72,7 +72,7 @@ namespace internal {
|
|
72
72
|
#define V8_TARGET_ARCH_IA32 1
|
73
73
|
#elif defined(__ARMEL__)
|
74
74
|
#define V8_TARGET_ARCH_ARM 1
|
75
|
-
#elif defined(
|
75
|
+
#elif defined(__MIPSEL__)
|
76
76
|
#define V8_TARGET_ARCH_MIPS 1
|
77
77
|
#else
|
78
78
|
#error Target architecture was not detected as supported by v8
|
data/vendor/v8/src/handles-inl.h
CHANGED
@@ -29,21 +29,37 @@
|
|
29
29
|
#ifndef V8_HANDLES_INL_H_
|
30
30
|
#define V8_HANDLES_INL_H_
|
31
31
|
|
32
|
+
#include "api.h"
|
32
33
|
#include "apiutils.h"
|
33
34
|
#include "handles.h"
|
34
|
-
#include "
|
35
|
+
#include "isolate.h"
|
35
36
|
|
36
37
|
namespace v8 {
|
37
38
|
namespace internal {
|
38
39
|
|
39
|
-
|
40
|
+
inline Isolate* GetIsolateForHandle(Object* obj) {
|
41
|
+
return Isolate::Current();
|
42
|
+
}
|
43
|
+
|
44
|
+
inline Isolate* GetIsolateForHandle(HeapObject* obj) {
|
45
|
+
return obj->GetIsolate();
|
46
|
+
}
|
47
|
+
|
48
|
+
template<typename T>
|
40
49
|
Handle<T>::Handle(T* obj) {
|
41
50
|
ASSERT(!obj->IsFailure());
|
42
|
-
location_ = HandleScope::CreateHandle(obj);
|
51
|
+
location_ = HandleScope::CreateHandle(obj, GetIsolateForHandle(obj));
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
template<typename T>
|
56
|
+
Handle<T>::Handle(T* obj, Isolate* isolate) {
|
57
|
+
ASSERT(!obj->IsFailure());
|
58
|
+
location_ = HandleScope::CreateHandle(obj, isolate);
|
43
59
|
}
|
44
60
|
|
45
61
|
|
46
|
-
template <
|
62
|
+
template <typename T>
|
47
63
|
inline T* Handle<T>::operator*() const {
|
48
64
|
ASSERT(location_ != NULL);
|
49
65
|
ASSERT(reinterpret_cast<Address>(*location_) != kHandleZapValue);
|
@@ -51,10 +67,91 @@ inline T* Handle<T>::operator*() const {
|
|
51
67
|
}
|
52
68
|
|
53
69
|
|
70
|
+
HandleScope::HandleScope() {
|
71
|
+
Isolate* isolate = Isolate::Current();
|
72
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
73
|
+
isolate->handle_scope_data();
|
74
|
+
isolate_ = isolate;
|
75
|
+
prev_next_ = current->next;
|
76
|
+
prev_limit_ = current->limit;
|
77
|
+
current->level++;
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
HandleScope::HandleScope(Isolate* isolate) {
|
82
|
+
ASSERT(isolate == Isolate::Current());
|
83
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
84
|
+
isolate->handle_scope_data();
|
85
|
+
isolate_ = isolate;
|
86
|
+
prev_next_ = current->next;
|
87
|
+
prev_limit_ = current->limit;
|
88
|
+
current->level++;
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
HandleScope::~HandleScope() {
|
93
|
+
CloseScope();
|
94
|
+
}
|
95
|
+
|
96
|
+
void HandleScope::CloseScope() {
|
97
|
+
ASSERT(isolate_ == Isolate::Current());
|
98
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
99
|
+
isolate_->handle_scope_data();
|
100
|
+
current->next = prev_next_;
|
101
|
+
current->level--;
|
102
|
+
if (current->limit != prev_limit_) {
|
103
|
+
current->limit = prev_limit_;
|
104
|
+
DeleteExtensions(isolate_);
|
105
|
+
}
|
106
|
+
#ifdef DEBUG
|
107
|
+
ZapRange(prev_next_, prev_limit_);
|
108
|
+
#endif
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
template <typename T>
|
113
|
+
Handle<T> HandleScope::CloseAndEscape(Handle<T> handle_value) {
|
114
|
+
T* value = *handle_value;
|
115
|
+
// Throw away all handles in the current scope.
|
116
|
+
CloseScope();
|
117
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
118
|
+
isolate_->handle_scope_data();
|
119
|
+
// Allocate one handle in the parent scope.
|
120
|
+
ASSERT(current->level > 0);
|
121
|
+
Handle<T> result(CreateHandle<T>(value, isolate_));
|
122
|
+
// Reinitialize the current scope (so that it's ready
|
123
|
+
// to be used or closed again).
|
124
|
+
prev_next_ = current->next;
|
125
|
+
prev_limit_ = current->limit;
|
126
|
+
current->level++;
|
127
|
+
return result;
|
128
|
+
}
|
129
|
+
|
130
|
+
|
131
|
+
template <typename T>
|
132
|
+
T** HandleScope::CreateHandle(T* value, Isolate* isolate) {
|
133
|
+
ASSERT(isolate == Isolate::Current());
|
134
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
135
|
+
isolate->handle_scope_data();
|
136
|
+
|
137
|
+
internal::Object** cur = current->next;
|
138
|
+
if (cur == current->limit) cur = Extend();
|
139
|
+
// Update the current next field, set the value in the created
|
140
|
+
// handle, and return the result.
|
141
|
+
ASSERT(cur < current->limit);
|
142
|
+
current->next = cur + 1;
|
143
|
+
|
144
|
+
T** result = reinterpret_cast<T**>(cur);
|
145
|
+
*result = value;
|
146
|
+
return result;
|
147
|
+
}
|
148
|
+
|
149
|
+
|
54
150
|
#ifdef DEBUG
|
55
151
|
inline NoHandleAllocation::NoHandleAllocation() {
|
56
152
|
v8::ImplementationUtilities::HandleScopeData* current =
|
57
|
-
|
153
|
+
Isolate::Current()->handle_scope_data();
|
154
|
+
|
58
155
|
// Shrink the current handle scope to make it impossible to do
|
59
156
|
// handle allocations without an explicit handle scope.
|
60
157
|
current->limit = current->next;
|
@@ -67,10 +164,10 @@ inline NoHandleAllocation::NoHandleAllocation() {
|
|
67
164
|
inline NoHandleAllocation::~NoHandleAllocation() {
|
68
165
|
// Restore state in current handle scope to re-enable handle
|
69
166
|
// allocations.
|
70
|
-
v8::ImplementationUtilities::HandleScopeData*
|
71
|
-
|
72
|
-
ASSERT_EQ(0,
|
73
|
-
|
167
|
+
v8::ImplementationUtilities::HandleScopeData* data =
|
168
|
+
Isolate::Current()->handle_scope_data();
|
169
|
+
ASSERT_EQ(0, data->level);
|
170
|
+
data->level = level_;
|
74
171
|
}
|
75
172
|
#endif
|
76
173
|
|
data/vendor/v8/src/handles.cc
CHANGED
@@ -45,57 +45,62 @@ namespace v8 {
|
|
45
45
|
namespace internal {
|
46
46
|
|
47
47
|
|
48
|
-
v8::ImplementationUtilities::HandleScopeData HandleScope::current_ =
|
49
|
-
{ NULL, NULL, 0 };
|
50
|
-
|
51
|
-
|
52
48
|
int HandleScope::NumberOfHandles() {
|
53
|
-
|
49
|
+
Isolate* isolate = Isolate::Current();
|
50
|
+
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
|
51
|
+
int n = impl->blocks()->length();
|
54
52
|
if (n == 0) return 0;
|
55
53
|
return ((n - 1) * kHandleBlockSize) + static_cast<int>(
|
56
|
-
(
|
54
|
+
(isolate->handle_scope_data()->next - impl->blocks()->last()));
|
57
55
|
}
|
58
56
|
|
59
57
|
|
60
58
|
Object** HandleScope::Extend() {
|
61
|
-
|
59
|
+
Isolate* isolate = Isolate::Current();
|
60
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
61
|
+
isolate->handle_scope_data();
|
62
62
|
|
63
|
-
|
63
|
+
Object** result = current->next;
|
64
|
+
|
65
|
+
ASSERT(result == current->limit);
|
64
66
|
// Make sure there's at least one scope on the stack and that the
|
65
67
|
// top of the scope stack isn't a barrier.
|
66
|
-
if (
|
68
|
+
if (current->level == 0) {
|
67
69
|
Utils::ReportApiFailure("v8::HandleScope::CreateHandle()",
|
68
70
|
"Cannot create a handle without a HandleScope");
|
69
71
|
return NULL;
|
70
72
|
}
|
71
|
-
HandleScopeImplementer* impl =
|
73
|
+
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
|
72
74
|
// If there's more room in the last block, we use that. This is used
|
73
75
|
// for fast creation of scopes after scope barriers.
|
74
76
|
if (!impl->blocks()->is_empty()) {
|
75
77
|
Object** limit = &impl->blocks()->last()[kHandleBlockSize];
|
76
|
-
if (
|
77
|
-
|
78
|
-
ASSERT(limit -
|
78
|
+
if (current->limit != limit) {
|
79
|
+
current->limit = limit;
|
80
|
+
ASSERT(limit - current->next < kHandleBlockSize);
|
79
81
|
}
|
80
82
|
}
|
81
83
|
|
82
84
|
// If we still haven't found a slot for the handle, we extend the
|
83
85
|
// current handle scope by allocating a new handle block.
|
84
|
-
if (result ==
|
86
|
+
if (result == current->limit) {
|
85
87
|
// If there's a spare block, use it for growing the current scope.
|
86
88
|
result = impl->GetSpareOrNewBlock();
|
87
89
|
// Add the extension to the global list of blocks, but count the
|
88
90
|
// extension as part of the current scope.
|
89
91
|
impl->blocks()->Add(result);
|
90
|
-
|
92
|
+
current->limit = &result[kHandleBlockSize];
|
91
93
|
}
|
92
94
|
|
93
95
|
return result;
|
94
96
|
}
|
95
97
|
|
96
98
|
|
97
|
-
void HandleScope::DeleteExtensions() {
|
98
|
-
|
99
|
+
void HandleScope::DeleteExtensions(Isolate* isolate) {
|
100
|
+
ASSERT(isolate == Isolate::Current());
|
101
|
+
v8::ImplementationUtilities::HandleScopeData* current =
|
102
|
+
isolate->handle_scope_data();
|
103
|
+
isolate->handle_scope_implementer()->DeleteExtensions(current->limit);
|
99
104
|
}
|
100
105
|
|
101
106
|
|
@@ -108,37 +113,44 @@ void HandleScope::ZapRange(Object** start, Object** end) {
|
|
108
113
|
|
109
114
|
|
110
115
|
Address HandleScope::current_level_address() {
|
111
|
-
return reinterpret_cast<Address>(
|
116
|
+
return reinterpret_cast<Address>(
|
117
|
+
&Isolate::Current()->handle_scope_data()->level);
|
112
118
|
}
|
113
119
|
|
114
120
|
|
115
121
|
Address HandleScope::current_next_address() {
|
116
|
-
return reinterpret_cast<Address>(
|
122
|
+
return reinterpret_cast<Address>(
|
123
|
+
&Isolate::Current()->handle_scope_data()->next);
|
117
124
|
}
|
118
125
|
|
119
126
|
|
120
127
|
Address HandleScope::current_limit_address() {
|
121
|
-
return reinterpret_cast<Address>(
|
128
|
+
return reinterpret_cast<Address>(
|
129
|
+
&Isolate::Current()->handle_scope_data()->limit);
|
122
130
|
}
|
123
131
|
|
124
132
|
|
125
133
|
Handle<FixedArray> AddKeysFromJSArray(Handle<FixedArray> content,
|
126
134
|
Handle<JSArray> array) {
|
127
|
-
CALL_HEAP_FUNCTION(content->
|
135
|
+
CALL_HEAP_FUNCTION(content->GetIsolate(),
|
136
|
+
content->AddKeysFromJSArray(*array), FixedArray);
|
128
137
|
}
|
129
138
|
|
130
139
|
|
131
140
|
Handle<FixedArray> UnionOfKeys(Handle<FixedArray> first,
|
132
141
|
Handle<FixedArray> second) {
|
133
|
-
CALL_HEAP_FUNCTION(first->
|
142
|
+
CALL_HEAP_FUNCTION(first->GetIsolate(),
|
143
|
+
first->UnionOfKeys(*second), FixedArray);
|
134
144
|
}
|
135
145
|
|
136
146
|
|
137
147
|
Handle<JSGlobalProxy> ReinitializeJSGlobalProxy(
|
138
148
|
Handle<JSFunction> constructor,
|
139
149
|
Handle<JSGlobalProxy> global) {
|
140
|
-
CALL_HEAP_FUNCTION(
|
141
|
-
|
150
|
+
CALL_HEAP_FUNCTION(
|
151
|
+
constructor->GetIsolate(),
|
152
|
+
constructor->GetHeap()->ReinitializeJSGlobalProxy(*constructor, *global),
|
153
|
+
JSGlobalProxy);
|
142
154
|
}
|
143
155
|
|
144
156
|
|
@@ -153,7 +165,8 @@ void SetExpectedNofProperties(Handle<JSFunction> func, int nof) {
|
|
153
165
|
func->shared()->set_expected_nof_properties(nof);
|
154
166
|
if (func->has_initial_map()) {
|
155
167
|
Handle<Map> new_initial_map =
|
156
|
-
|
168
|
+
func->GetIsolate()->factory()->CopyMapDropTransitions(
|
169
|
+
Handle<Map>(func->initial_map()));
|
157
170
|
new_initial_map->set_unused_property_fields(nof);
|
158
171
|
func->set_initial_map(*new_initial_map);
|
159
172
|
}
|
@@ -161,7 +174,8 @@ void SetExpectedNofProperties(Handle<JSFunction> func, int nof) {
|
|
161
174
|
|
162
175
|
|
163
176
|
void SetPrototypeProperty(Handle<JSFunction> func, Handle<JSObject> value) {
|
164
|
-
CALL_HEAP_FUNCTION_VOID(func->
|
177
|
+
CALL_HEAP_FUNCTION_VOID(func->GetIsolate(),
|
178
|
+
func->SetPrototype(*value));
|
165
179
|
}
|
166
180
|
|
167
181
|
|
@@ -193,20 +207,23 @@ void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
|
|
193
207
|
void NormalizeProperties(Handle<JSObject> object,
|
194
208
|
PropertyNormalizationMode mode,
|
195
209
|
int expected_additional_properties) {
|
196
|
-
CALL_HEAP_FUNCTION_VOID(object->
|
197
|
-
|
198
|
-
|
210
|
+
CALL_HEAP_FUNCTION_VOID(object->GetIsolate(),
|
211
|
+
object->NormalizeProperties(
|
212
|
+
mode,
|
213
|
+
expected_additional_properties));
|
199
214
|
}
|
200
215
|
|
201
216
|
|
202
217
|
void NormalizeElements(Handle<JSObject> object) {
|
203
|
-
CALL_HEAP_FUNCTION_VOID(object->
|
218
|
+
CALL_HEAP_FUNCTION_VOID(object->GetIsolate(),
|
219
|
+
object->NormalizeElements());
|
204
220
|
}
|
205
221
|
|
206
222
|
|
207
223
|
void TransformToFastProperties(Handle<JSObject> object,
|
208
224
|
int unused_property_fields) {
|
209
225
|
CALL_HEAP_FUNCTION_VOID(
|
226
|
+
object->GetIsolate(),
|
210
227
|
object->TransformToFastProperties(unused_property_fields));
|
211
228
|
}
|
212
229
|
|
@@ -215,24 +232,26 @@ void NumberDictionarySet(Handle<NumberDictionary> dictionary,
|
|
215
232
|
uint32_t index,
|
216
233
|
Handle<Object> value,
|
217
234
|
PropertyDetails details) {
|
218
|
-
CALL_HEAP_FUNCTION_VOID(dictionary->
|
235
|
+
CALL_HEAP_FUNCTION_VOID(dictionary->GetIsolate(),
|
236
|
+
dictionary->Set(index, *value, details));
|
219
237
|
}
|
220
238
|
|
221
239
|
|
222
240
|
void FlattenString(Handle<String> string) {
|
223
|
-
CALL_HEAP_FUNCTION_VOID(string->TryFlatten());
|
241
|
+
CALL_HEAP_FUNCTION_VOID(string->GetIsolate(), string->TryFlatten());
|
224
242
|
}
|
225
243
|
|
226
244
|
|
227
245
|
Handle<String> FlattenGetString(Handle<String> string) {
|
228
|
-
CALL_HEAP_FUNCTION(string->TryFlatten(), String);
|
246
|
+
CALL_HEAP_FUNCTION(string->GetIsolate(), string->TryFlatten(), String);
|
229
247
|
}
|
230
248
|
|
231
249
|
|
232
250
|
Handle<Object> SetPrototype(Handle<JSFunction> function,
|
233
251
|
Handle<Object> prototype) {
|
234
252
|
ASSERT(function->should_have_prototype());
|
235
|
-
CALL_HEAP_FUNCTION(
|
253
|
+
CALL_HEAP_FUNCTION(function->GetIsolate(),
|
254
|
+
Accessors::FunctionSetPrototype(*function,
|
236
255
|
*prototype,
|
237
256
|
NULL),
|
238
257
|
Object);
|
@@ -242,17 +261,25 @@ Handle<Object> SetPrototype(Handle<JSFunction> function,
|
|
242
261
|
Handle<Object> SetProperty(Handle<JSObject> object,
|
243
262
|
Handle<String> key,
|
244
263
|
Handle<Object> value,
|
245
|
-
PropertyAttributes attributes
|
246
|
-
|
264
|
+
PropertyAttributes attributes,
|
265
|
+
StrictModeFlag strict_mode) {
|
266
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(),
|
267
|
+
object->SetProperty(*key, *value, attributes, strict_mode),
|
268
|
+
Object);
|
247
269
|
}
|
248
270
|
|
249
271
|
|
250
272
|
Handle<Object> SetProperty(Handle<Object> object,
|
251
273
|
Handle<Object> key,
|
252
274
|
Handle<Object> value,
|
253
|
-
PropertyAttributes attributes
|
275
|
+
PropertyAttributes attributes,
|
276
|
+
StrictModeFlag strict_mode) {
|
277
|
+
Isolate* isolate = Isolate::Current();
|
254
278
|
CALL_HEAP_FUNCTION(
|
255
|
-
|
279
|
+
isolate,
|
280
|
+
Runtime::SetObjectProperty(
|
281
|
+
isolate, object, key, value, attributes, strict_mode),
|
282
|
+
Object);
|
256
283
|
}
|
257
284
|
|
258
285
|
|
@@ -260,8 +287,12 @@ Handle<Object> ForceSetProperty(Handle<JSObject> object,
|
|
260
287
|
Handle<Object> key,
|
261
288
|
Handle<Object> value,
|
262
289
|
PropertyAttributes attributes) {
|
290
|
+
Isolate* isolate = object->GetIsolate();
|
263
291
|
CALL_HEAP_FUNCTION(
|
264
|
-
|
292
|
+
isolate,
|
293
|
+
Runtime::ForceSetObjectProperty(
|
294
|
+
isolate, object, key, value, attributes),
|
295
|
+
Object);
|
265
296
|
}
|
266
297
|
|
267
298
|
|
@@ -269,14 +300,18 @@ Handle<Object> SetNormalizedProperty(Handle<JSObject> object,
|
|
269
300
|
Handle<String> key,
|
270
301
|
Handle<Object> value,
|
271
302
|
PropertyDetails details) {
|
272
|
-
CALL_HEAP_FUNCTION(object->
|
303
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(),
|
304
|
+
object->SetNormalizedProperty(*key, *value, details),
|
273
305
|
Object);
|
274
306
|
}
|
275
307
|
|
276
308
|
|
277
309
|
Handle<Object> ForceDeleteProperty(Handle<JSObject> object,
|
278
310
|
Handle<Object> key) {
|
279
|
-
|
311
|
+
Isolate* isolate = object->GetIsolate();
|
312
|
+
CALL_HEAP_FUNCTION(isolate,
|
313
|
+
Runtime::ForceDeleteObjectProperty(isolate, object, key),
|
314
|
+
Object);
|
280
315
|
}
|
281
316
|
|
282
317
|
|
@@ -285,8 +320,10 @@ Handle<Object> SetLocalPropertyIgnoreAttributes(
|
|
285
320
|
Handle<String> key,
|
286
321
|
Handle<Object> value,
|
287
322
|
PropertyAttributes attributes) {
|
288
|
-
CALL_HEAP_FUNCTION(
|
289
|
-
|
323
|
+
CALL_HEAP_FUNCTION(
|
324
|
+
object->GetIsolate(),
|
325
|
+
object->SetLocalPropertyIgnoreAttributes(*key, *value, attributes),
|
326
|
+
Object);
|
290
327
|
}
|
291
328
|
|
292
329
|
|
@@ -294,40 +331,48 @@ void SetLocalPropertyNoThrow(Handle<JSObject> object,
|
|
294
331
|
Handle<String> key,
|
295
332
|
Handle<Object> value,
|
296
333
|
PropertyAttributes attributes) {
|
297
|
-
|
334
|
+
Isolate* isolate = object->GetIsolate();
|
335
|
+
ASSERT(!isolate->has_pending_exception());
|
298
336
|
CHECK(!SetLocalPropertyIgnoreAttributes(
|
299
337
|
object, key, value, attributes).is_null());
|
300
|
-
CHECK(!
|
338
|
+
CHECK(!isolate->has_pending_exception());
|
301
339
|
}
|
302
340
|
|
303
341
|
|
304
342
|
Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object,
|
305
343
|
Handle<String> key,
|
306
344
|
Handle<Object> value,
|
307
|
-
PropertyAttributes attributes
|
308
|
-
|
345
|
+
PropertyAttributes attributes,
|
346
|
+
StrictModeFlag strict_mode) {
|
347
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(),
|
348
|
+
object->SetPropertyWithInterceptor(*key,
|
309
349
|
*value,
|
310
|
-
attributes
|
350
|
+
attributes,
|
351
|
+
strict_mode),
|
311
352
|
Object);
|
312
353
|
}
|
313
354
|
|
314
355
|
|
315
356
|
Handle<Object> GetProperty(Handle<JSObject> obj,
|
316
357
|
const char* name) {
|
317
|
-
|
318
|
-
|
358
|
+
Isolate* isolate = obj->GetIsolate();
|
359
|
+
Handle<String> str = isolate->factory()->LookupAsciiSymbol(name);
|
360
|
+
CALL_HEAP_FUNCTION(isolate, obj->GetProperty(*str), Object);
|
319
361
|
}
|
320
362
|
|
321
363
|
|
322
364
|
Handle<Object> GetProperty(Handle<Object> obj,
|
323
365
|
Handle<Object> key) {
|
324
|
-
|
366
|
+
Isolate* isolate = Isolate::Current();
|
367
|
+
CALL_HEAP_FUNCTION(isolate,
|
368
|
+
Runtime::GetObjectProperty(isolate, obj, key), Object);
|
325
369
|
}
|
326
370
|
|
327
371
|
|
328
372
|
Handle<Object> GetElement(Handle<Object> obj,
|
329
373
|
uint32_t index) {
|
330
|
-
|
374
|
+
Isolate* isolate = Isolate::Current();
|
375
|
+
CALL_HEAP_FUNCTION(isolate, Runtime::GetElement(obj, index), Object);
|
331
376
|
}
|
332
377
|
|
333
378
|
|
@@ -335,7 +380,9 @@ Handle<Object> GetPropertyWithInterceptor(Handle<JSObject> receiver,
|
|
335
380
|
Handle<JSObject> holder,
|
336
381
|
Handle<String> name,
|
337
382
|
PropertyAttributes* attributes) {
|
338
|
-
|
383
|
+
Isolate* isolate = receiver->GetIsolate();
|
384
|
+
CALL_HEAP_FUNCTION(isolate,
|
385
|
+
holder->GetPropertyWithInterceptor(*receiver,
|
339
386
|
*name,
|
340
387
|
attributes),
|
341
388
|
Object);
|
@@ -350,15 +397,22 @@ Handle<Object> GetPrototype(Handle<Object> obj) {
|
|
350
397
|
|
351
398
|
Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) {
|
352
399
|
const bool skip_hidden_prototypes = false;
|
353
|
-
CALL_HEAP_FUNCTION(obj->
|
400
|
+
CALL_HEAP_FUNCTION(obj->GetIsolate(),
|
401
|
+
obj->SetPrototype(*value, skip_hidden_prototypes), Object);
|
402
|
+
}
|
403
|
+
|
404
|
+
|
405
|
+
Handle<Object> PreventExtensions(Handle<JSObject> object) {
|
406
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(), object->PreventExtensions(), Object);
|
354
407
|
}
|
355
408
|
|
356
409
|
|
357
410
|
Handle<Object> GetHiddenProperties(Handle<JSObject> obj,
|
358
411
|
bool create_if_needed) {
|
412
|
+
Isolate* isolate = obj->GetIsolate();
|
359
413
|
Object* holder = obj->BypassGlobalProxy();
|
360
|
-
if (holder->IsUndefined()) return
|
361
|
-
obj = Handle<JSObject>(JSObject::cast(holder));
|
414
|
+
if (holder->IsUndefined()) return isolate->factory()->undefined_value();
|
415
|
+
obj = Handle<JSObject>(JSObject::cast(holder), isolate);
|
362
416
|
|
363
417
|
if (obj->HasFastProperties()) {
|
364
418
|
// If the object has fast properties, check whether the first slot
|
@@ -367,10 +421,11 @@ Handle<Object> GetHiddenProperties(Handle<JSObject> obj,
|
|
367
421
|
// code zero) it will always occupy the first entry if present.
|
368
422
|
DescriptorArray* descriptors = obj->map()->instance_descriptors();
|
369
423
|
if ((descriptors->number_of_descriptors() > 0) &&
|
370
|
-
(descriptors->GetKey(0) ==
|
424
|
+
(descriptors->GetKey(0) == isolate->heap()->hidden_symbol()) &&
|
371
425
|
descriptors->IsProperty(0)) {
|
372
426
|
ASSERT(descriptors->GetType(0) == FIELD);
|
373
|
-
return Handle<Object>(obj->FastPropertyAt(descriptors->GetFieldIndex(0))
|
427
|
+
return Handle<Object>(obj->FastPropertyAt(descriptors->GetFieldIndex(0)),
|
428
|
+
isolate);
|
374
429
|
}
|
375
430
|
}
|
376
431
|
|
@@ -381,32 +436,39 @@ Handle<Object> GetHiddenProperties(Handle<JSObject> obj,
|
|
381
436
|
// Hidden properties object not found. Allocate a new hidden properties
|
382
437
|
// object if requested. Otherwise return the undefined value.
|
383
438
|
if (create_if_needed) {
|
384
|
-
Handle<Object> hidden_obj =
|
385
|
-
|
439
|
+
Handle<Object> hidden_obj =
|
440
|
+
isolate->factory()->NewJSObject(isolate->object_function());
|
441
|
+
CALL_HEAP_FUNCTION(isolate,
|
442
|
+
obj->SetHiddenPropertiesObject(*hidden_obj), Object);
|
386
443
|
} else {
|
387
|
-
return
|
444
|
+
return isolate->factory()->undefined_value();
|
388
445
|
}
|
389
446
|
}
|
390
|
-
return Handle<Object>(obj->GetHiddenPropertiesObject());
|
447
|
+
return Handle<Object>(obj->GetHiddenPropertiesObject(), isolate);
|
391
448
|
}
|
392
449
|
|
393
450
|
|
394
451
|
Handle<Object> DeleteElement(Handle<JSObject> obj,
|
395
452
|
uint32_t index) {
|
396
|
-
CALL_HEAP_FUNCTION(obj->
|
453
|
+
CALL_HEAP_FUNCTION(obj->GetIsolate(),
|
454
|
+
obj->DeleteElement(index, JSObject::NORMAL_DELETION),
|
397
455
|
Object);
|
398
456
|
}
|
399
457
|
|
400
458
|
|
401
459
|
Handle<Object> DeleteProperty(Handle<JSObject> obj,
|
402
460
|
Handle<String> prop) {
|
403
|
-
CALL_HEAP_FUNCTION(obj->
|
461
|
+
CALL_HEAP_FUNCTION(obj->GetIsolate(),
|
462
|
+
obj->DeleteProperty(*prop, JSObject::NORMAL_DELETION),
|
404
463
|
Object);
|
405
464
|
}
|
406
465
|
|
407
466
|
|
408
467
|
Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index) {
|
409
|
-
|
468
|
+
Isolate* isolate = Isolate::Current();
|
469
|
+
CALL_HEAP_FUNCTION(
|
470
|
+
isolate,
|
471
|
+
isolate->heap()->LookupSingleCharacterStringFromCode(index), Object);
|
410
472
|
}
|
411
473
|
|
412
474
|
|
@@ -414,14 +476,16 @@ Handle<String> SubString(Handle<String> str,
|
|
414
476
|
int start,
|
415
477
|
int end,
|
416
478
|
PretenureFlag pretenure) {
|
417
|
-
CALL_HEAP_FUNCTION(str->
|
479
|
+
CALL_HEAP_FUNCTION(str->GetIsolate(),
|
480
|
+
str->SubString(start, end, pretenure), String);
|
418
481
|
}
|
419
482
|
|
420
483
|
|
421
484
|
Handle<Object> SetElement(Handle<JSObject> object,
|
422
485
|
uint32_t index,
|
423
|
-
Handle<Object> value
|
424
|
-
|
486
|
+
Handle<Object> value,
|
487
|
+
StrictModeFlag strict_mode) {
|
488
|
+
if (object->HasExternalArrayElements()) {
|
425
489
|
if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) {
|
426
490
|
bool has_exception;
|
427
491
|
Handle<Object> number = Execution::ToNumber(value, &has_exception);
|
@@ -429,26 +493,31 @@ Handle<Object> SetElement(Handle<JSObject> object,
|
|
429
493
|
value = number;
|
430
494
|
}
|
431
495
|
}
|
432
|
-
CALL_HEAP_FUNCTION(object->
|
496
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(),
|
497
|
+
object->SetElement(index, *value, strict_mode), Object);
|
433
498
|
}
|
434
499
|
|
435
500
|
|
436
501
|
Handle<Object> SetOwnElement(Handle<JSObject> object,
|
437
502
|
uint32_t index,
|
438
|
-
Handle<Object> value
|
439
|
-
|
503
|
+
Handle<Object> value,
|
504
|
+
StrictModeFlag strict_mode) {
|
440
505
|
ASSERT(!object->HasExternalArrayElements());
|
441
|
-
CALL_HEAP_FUNCTION(object->
|
506
|
+
CALL_HEAP_FUNCTION(object->GetIsolate(),
|
507
|
+
object->SetElement(index, *value, strict_mode, false),
|
508
|
+
Object);
|
442
509
|
}
|
443
510
|
|
444
511
|
|
445
512
|
Handle<JSObject> Copy(Handle<JSObject> obj) {
|
446
|
-
|
513
|
+
Isolate* isolate = obj->GetIsolate();
|
514
|
+
CALL_HEAP_FUNCTION(isolate,
|
515
|
+
isolate->heap()->CopyJSObject(*obj), JSObject);
|
447
516
|
}
|
448
517
|
|
449
518
|
|
450
519
|
Handle<Object> SetAccessor(Handle<JSObject> obj, Handle<AccessorInfo> info) {
|
451
|
-
CALL_HEAP_FUNCTION(obj->DefineAccessor(*info), Object);
|
520
|
+
CALL_HEAP_FUNCTION(obj->GetIsolate(), obj->DefineAccessor(*info), Object);
|
452
521
|
}
|
453
522
|
|
454
523
|
|
@@ -469,8 +538,9 @@ static void ClearWrapperCache(Persistent<v8::Value> handle, void*) {
|
|
469
538
|
Proxy* proxy = Script::cast(wrapper->value())->wrapper();
|
470
539
|
ASSERT(proxy->proxy() == reinterpret_cast<Address>(cache.location()));
|
471
540
|
proxy->set_proxy(0);
|
472
|
-
|
473
|
-
|
541
|
+
Isolate* isolate = Isolate::Current();
|
542
|
+
isolate->global_handles()->Destroy(cache.location());
|
543
|
+
isolate->counters()->script_wrappers()->Decrement();
|
474
544
|
}
|
475
545
|
|
476
546
|
|
@@ -480,19 +550,20 @@ Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
|
|
480
550
|
return Handle<JSValue>(
|
481
551
|
reinterpret_cast<JSValue**>(script->wrapper()->proxy()));
|
482
552
|
}
|
483
|
-
|
553
|
+
Isolate* isolate = Isolate::Current();
|
484
554
|
// Construct a new script wrapper.
|
485
|
-
|
486
|
-
Handle<JSFunction> constructor =
|
555
|
+
isolate->counters()->script_wrappers()->Increment();
|
556
|
+
Handle<JSFunction> constructor = isolate->script_function();
|
487
557
|
Handle<JSValue> result =
|
488
|
-
Handle<JSValue>::cast(
|
558
|
+
Handle<JSValue>::cast(isolate->factory()->NewJSObject(constructor));
|
489
559
|
result->set_value(*script);
|
490
560
|
|
491
561
|
// Create a new weak global handle and use it to cache the wrapper
|
492
562
|
// for future use. The cache will automatically be cleared by the
|
493
563
|
// garbage collector when it is not used anymore.
|
494
|
-
Handle<Object> handle =
|
495
|
-
|
564
|
+
Handle<Object> handle = isolate->global_handles()->Create(*result);
|
565
|
+
isolate->global_handles()->MakeWeak(handle.location(), NULL,
|
566
|
+
&ClearWrapperCache);
|
496
567
|
script->wrapper()->set_proxy(reinterpret_cast<Address>(handle.location()));
|
497
568
|
return result;
|
498
569
|
}
|
@@ -503,20 +574,22 @@ Handle<JSValue> GetScriptWrapper(Handle<Script> script) {
|
|
503
574
|
void InitScriptLineEnds(Handle<Script> script) {
|
504
575
|
if (!script->line_ends()->IsUndefined()) return;
|
505
576
|
|
577
|
+
Isolate* isolate = script->GetIsolate();
|
578
|
+
|
506
579
|
if (!script->source()->IsString()) {
|
507
580
|
ASSERT(script->source()->IsUndefined());
|
508
|
-
Handle<FixedArray> empty =
|
581
|
+
Handle<FixedArray> empty = isolate->factory()->NewFixedArray(0);
|
509
582
|
script->set_line_ends(*empty);
|
510
583
|
ASSERT(script->line_ends()->IsFixedArray());
|
511
584
|
return;
|
512
585
|
}
|
513
586
|
|
514
|
-
Handle<String> src(String::cast(script->source()));
|
587
|
+
Handle<String> src(String::cast(script->source()), isolate);
|
515
588
|
|
516
589
|
Handle<FixedArray> array = CalculateLineEnds(src, true);
|
517
590
|
|
518
|
-
if (*array !=
|
519
|
-
array->set_map(
|
591
|
+
if (*array != isolate->heap()->empty_fixed_array()) {
|
592
|
+
array->set_map(isolate->heap()->fixed_cow_array_map());
|
520
593
|
}
|
521
594
|
|
522
595
|
script->set_line_ends(*array);
|
@@ -525,11 +598,12 @@ void InitScriptLineEnds(Handle<Script> script) {
|
|
525
598
|
|
526
599
|
|
527
600
|
template <typename SourceChar>
|
528
|
-
static void CalculateLineEnds(
|
601
|
+
static void CalculateLineEnds(Isolate* isolate,
|
602
|
+
List<int>* line_ends,
|
529
603
|
Vector<const SourceChar> src,
|
530
604
|
bool with_last_line) {
|
531
605
|
const int src_len = src.length();
|
532
|
-
StringSearch<char, SourceChar> search(CStrVector("\n"));
|
606
|
+
StringSearch<char, SourceChar> search(isolate, CStrVector("\n"));
|
533
607
|
|
534
608
|
// Find and record line ends.
|
535
609
|
int position = 0;
|
@@ -554,17 +628,24 @@ Handle<FixedArray> CalculateLineEnds(Handle<String> src,
|
|
554
628
|
// length of (unpacked) code.
|
555
629
|
int line_count_estimate = src->length() >> 4;
|
556
630
|
List<int> line_ends(line_count_estimate);
|
631
|
+
Isolate* isolate = src->GetIsolate();
|
557
632
|
{
|
558
633
|
AssertNoAllocation no_heap_allocation; // ensure vectors stay valid.
|
559
634
|
// Dispatch on type of strings.
|
560
635
|
if (src->IsAsciiRepresentation()) {
|
561
|
-
CalculateLineEnds(
|
636
|
+
CalculateLineEnds(isolate,
|
637
|
+
&line_ends,
|
638
|
+
src->ToAsciiVector(),
|
639
|
+
with_last_line);
|
562
640
|
} else {
|
563
|
-
CalculateLineEnds(
|
641
|
+
CalculateLineEnds(isolate,
|
642
|
+
&line_ends,
|
643
|
+
src->ToUC16Vector(),
|
644
|
+
with_last_line);
|
564
645
|
}
|
565
646
|
}
|
566
647
|
int line_count = line_ends.length();
|
567
|
-
Handle<FixedArray> array =
|
648
|
+
Handle<FixedArray> array = isolate->factory()->NewFixedArray(line_count);
|
568
649
|
for (int i = 0; i < line_count; i++) {
|
569
650
|
array->set(i, Smi::FromInt(line_ends[i]));
|
570
651
|
}
|
@@ -630,17 +711,18 @@ void CustomArguments::IterateInstance(ObjectVisitor* v) {
|
|
630
711
|
// Compute the property keys from the interceptor.
|
631
712
|
v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver,
|
632
713
|
Handle<JSObject> object) {
|
714
|
+
Isolate* isolate = receiver->GetIsolate();
|
633
715
|
Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor());
|
634
|
-
CustomArguments args(interceptor->data(), *receiver, *object);
|
716
|
+
CustomArguments args(isolate, interceptor->data(), *receiver, *object);
|
635
717
|
v8::AccessorInfo info(args.end());
|
636
718
|
v8::Handle<v8::Array> result;
|
637
719
|
if (!interceptor->enumerator()->IsUndefined()) {
|
638
720
|
v8::NamedPropertyEnumerator enum_fun =
|
639
721
|
v8::ToCData<v8::NamedPropertyEnumerator>(interceptor->enumerator());
|
640
|
-
LOG(ApiObjectAccess("interceptor-named-enum", *object));
|
722
|
+
LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object));
|
641
723
|
{
|
642
724
|
// Leaving JavaScript.
|
643
|
-
VMState state(EXTERNAL);
|
725
|
+
VMState state(isolate, EXTERNAL);
|
644
726
|
result = enum_fun(info);
|
645
727
|
}
|
646
728
|
}
|
@@ -651,17 +733,18 @@ v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver,
|
|
651
733
|
// Compute the element keys from the interceptor.
|
652
734
|
v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSObject> receiver,
|
653
735
|
Handle<JSObject> object) {
|
736
|
+
Isolate* isolate = receiver->GetIsolate();
|
654
737
|
Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
|
655
|
-
CustomArguments args(interceptor->data(), *receiver, *object);
|
738
|
+
CustomArguments args(isolate, interceptor->data(), *receiver, *object);
|
656
739
|
v8::AccessorInfo info(args.end());
|
657
740
|
v8::Handle<v8::Array> result;
|
658
741
|
if (!interceptor->enumerator()->IsUndefined()) {
|
659
742
|
v8::IndexedPropertyEnumerator enum_fun =
|
660
743
|
v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator());
|
661
|
-
LOG(ApiObjectAccess("interceptor-indexed-enum", *object));
|
744
|
+
LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object));
|
662
745
|
{
|
663
746
|
// Leaving JavaScript.
|
664
|
-
VMState state(EXTERNAL);
|
747
|
+
VMState state(isolate, EXTERNAL);
|
665
748
|
result = enum_fun(info);
|
666
749
|
}
|
667
750
|
}
|
@@ -682,31 +765,33 @@ static bool ContainsOnlyValidKeys(Handle<FixedArray> array) {
|
|
682
765
|
Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
|
683
766
|
KeyCollectionType type) {
|
684
767
|
USE(ContainsOnlyValidKeys);
|
685
|
-
|
686
|
-
Handle<
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
768
|
+
Isolate* isolate = object->GetIsolate();
|
769
|
+
Handle<FixedArray> content = isolate->factory()->empty_fixed_array();
|
770
|
+
Handle<JSObject> arguments_boilerplate = Handle<JSObject>(
|
771
|
+
isolate->context()->global_context()->arguments_boilerplate(),
|
772
|
+
isolate);
|
773
|
+
Handle<JSFunction> arguments_function = Handle<JSFunction>(
|
774
|
+
JSFunction::cast(arguments_boilerplate->map()->constructor()),
|
775
|
+
isolate);
|
692
776
|
|
693
777
|
// Only collect keys if access is permitted.
|
694
778
|
for (Handle<Object> p = object;
|
695
|
-
*p !=
|
696
|
-
p = Handle<Object>(p->GetPrototype())) {
|
697
|
-
Handle<JSObject> current(JSObject::cast(*p));
|
779
|
+
*p != isolate->heap()->null_value();
|
780
|
+
p = Handle<Object>(p->GetPrototype(), isolate)) {
|
781
|
+
Handle<JSObject> current(JSObject::cast(*p), isolate);
|
698
782
|
|
699
783
|
// Check access rights if required.
|
700
784
|
if (current->IsAccessCheckNeeded() &&
|
701
|
-
!
|
702
|
-
|
703
|
-
|
785
|
+
!isolate->MayNamedAccess(*current,
|
786
|
+
isolate->heap()->undefined_value(),
|
787
|
+
v8::ACCESS_KEYS)) {
|
788
|
+
isolate->ReportFailedAccessCheck(*current, v8::ACCESS_KEYS);
|
704
789
|
break;
|
705
790
|
}
|
706
791
|
|
707
792
|
// Compute the element keys.
|
708
793
|
Handle<FixedArray> element_keys =
|
709
|
-
|
794
|
+
isolate->factory()->NewFixedArray(current->NumberOfEnumElements());
|
710
795
|
current->GetEnumElementKeys(*element_keys);
|
711
796
|
content = UnionOfKeys(content, element_keys);
|
712
797
|
ASSERT(ContainsOnlyValidKeys(content));
|
@@ -760,28 +845,31 @@ Handle<FixedArray> GetKeysInFixedArrayFor(Handle<JSObject> object,
|
|
760
845
|
|
761
846
|
|
762
847
|
Handle<JSArray> GetKeysFor(Handle<JSObject> object) {
|
763
|
-
|
848
|
+
Isolate* isolate = object->GetIsolate();
|
849
|
+
isolate->counters()->for_in()->Increment();
|
764
850
|
Handle<FixedArray> elements = GetKeysInFixedArrayFor(object,
|
765
851
|
INCLUDE_PROTOS);
|
766
|
-
return
|
852
|
+
return isolate->factory()->NewJSArrayWithElements(elements);
|
767
853
|
}
|
768
854
|
|
769
855
|
|
770
856
|
Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object,
|
771
857
|
bool cache_result) {
|
772
858
|
int index = 0;
|
859
|
+
Isolate* isolate = object->GetIsolate();
|
773
860
|
if (object->HasFastProperties()) {
|
774
861
|
if (object->map()->instance_descriptors()->HasEnumCache()) {
|
775
|
-
|
862
|
+
isolate->counters()->enum_cache_hits()->Increment();
|
776
863
|
DescriptorArray* desc = object->map()->instance_descriptors();
|
777
|
-
return Handle<FixedArray>(FixedArray::cast(desc->GetEnumCache())
|
864
|
+
return Handle<FixedArray>(FixedArray::cast(desc->GetEnumCache()),
|
865
|
+
isolate);
|
778
866
|
}
|
779
|
-
|
867
|
+
isolate->counters()->enum_cache_misses()->Increment();
|
780
868
|
int num_enum = object->NumberOfEnumProperties();
|
781
|
-
Handle<FixedArray> storage =
|
782
|
-
Handle<FixedArray> sort_array =
|
869
|
+
Handle<FixedArray> storage = isolate->factory()->NewFixedArray(num_enum);
|
870
|
+
Handle<FixedArray> sort_array = isolate->factory()->NewFixedArray(num_enum);
|
783
871
|
Handle<DescriptorArray> descs =
|
784
|
-
Handle<DescriptorArray>(object->map()->instance_descriptors());
|
872
|
+
Handle<DescriptorArray>(object->map()->instance_descriptors(), isolate);
|
785
873
|
for (int i = 0; i < descs->number_of_descriptors(); i++) {
|
786
874
|
if (descs->IsProperty(i) && !descs->IsDontEnum(i)) {
|
787
875
|
(*storage)->set(index, descs->GetKey(i));
|
@@ -793,7 +881,8 @@ Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object,
|
|
793
881
|
(*storage)->SortPairs(*sort_array, sort_array->length());
|
794
882
|
if (cache_result) {
|
795
883
|
Handle<FixedArray> bridge_storage =
|
796
|
-
|
884
|
+
isolate->factory()->NewFixedArray(
|
885
|
+
DescriptorArray::kEnumCacheBridgeLength);
|
797
886
|
DescriptorArray* desc = object->map()->instance_descriptors();
|
798
887
|
desc->SetEnumCache(*bridge_storage, *storage);
|
799
888
|
}
|
@@ -801,8 +890,8 @@ Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object,
|
|
801
890
|
return storage;
|
802
891
|
} else {
|
803
892
|
int num_enum = object->NumberOfEnumProperties();
|
804
|
-
Handle<FixedArray> storage =
|
805
|
-
Handle<FixedArray> sort_array =
|
893
|
+
Handle<FixedArray> storage = isolate->factory()->NewFixedArray(num_enum);
|
894
|
+
Handle<FixedArray> sort_array = isolate->factory()->NewFixedArray(num_enum);
|
806
895
|
object->property_dictionary()->CopyEnumKeysTo(*storage, *sort_array);
|
807
896
|
return storage;
|
808
897
|
}
|
@@ -819,10 +908,12 @@ static bool CompileLazyHelper(CompilationInfo* info,
|
|
819
908
|
ClearExceptionFlag flag) {
|
820
909
|
// Compile the source information to a code object.
|
821
910
|
ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled());
|
822
|
-
ASSERT(!
|
911
|
+
ASSERT(!info->isolate()->has_pending_exception());
|
823
912
|
bool result = Compiler::CompileLazy(info);
|
824
|
-
ASSERT(result !=
|
825
|
-
if (!result && flag == CLEAR_EXCEPTION)
|
913
|
+
ASSERT(result != Isolate::Current()->has_pending_exception());
|
914
|
+
if (!result && flag == CLEAR_EXCEPTION) {
|
915
|
+
info->isolate()->clear_pending_exception();
|
916
|
+
}
|
826
917
|
return result;
|
827
918
|
}
|
828
919
|
|
@@ -863,40 +954,12 @@ bool CompileLazyInLoop(Handle<JSFunction> function,
|
|
863
954
|
}
|
864
955
|
|
865
956
|
|
866
|
-
bool CompileOptimized(Handle<JSFunction> function,
|
957
|
+
bool CompileOptimized(Handle<JSFunction> function,
|
958
|
+
int osr_ast_id,
|
959
|
+
ClearExceptionFlag flag) {
|
867
960
|
CompilationInfo info(function);
|
868
961
|
info.SetOptimizing(osr_ast_id);
|
869
|
-
return CompileLazyHelper(&info,
|
870
|
-
}
|
871
|
-
|
872
|
-
|
873
|
-
OptimizedObjectForAddingMultipleProperties::
|
874
|
-
OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object,
|
875
|
-
int expected_additional_properties,
|
876
|
-
bool condition) {
|
877
|
-
object_ = object;
|
878
|
-
if (condition && object_->HasFastProperties() && !object->IsJSGlobalProxy()) {
|
879
|
-
// Normalize the properties of object to avoid n^2 behavior
|
880
|
-
// when extending the object multiple properties. Indicate the number of
|
881
|
-
// properties to be added.
|
882
|
-
unused_property_fields_ = object->map()->unused_property_fields();
|
883
|
-
NormalizeProperties(object_,
|
884
|
-
KEEP_INOBJECT_PROPERTIES,
|
885
|
-
expected_additional_properties);
|
886
|
-
has_been_transformed_ = true;
|
887
|
-
|
888
|
-
} else {
|
889
|
-
has_been_transformed_ = false;
|
890
|
-
}
|
891
|
-
}
|
892
|
-
|
893
|
-
|
894
|
-
OptimizedObjectForAddingMultipleProperties::
|
895
|
-
~OptimizedObjectForAddingMultipleProperties() {
|
896
|
-
// Reoptimize the object to allow fast property access.
|
897
|
-
if (has_been_transformed_) {
|
898
|
-
TransformToFastProperties(object_, unused_property_fields_);
|
899
|
-
}
|
962
|
+
return CompileLazyHelper(&info, flag);
|
900
963
|
}
|
901
964
|
|
902
965
|
} } // namespace v8::internal
|