Introduce Symbol type for property type inference
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Oct 2015 02:09:34 +0000 (02:09 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Oct 2015 02:09:34 +0000 (02:09 +0000)
commit537ce32c451ea6096ad4761e2791b8e58e565894
tree886523049041e44b795c2035f217ca8efa50fc18
parent4d6f24e042ff22c912f450e88c04d2371961d8d8
Introduce Symbol type for property type inference
https://bugs.webkit.org/show_bug.cgi?id=149622

Reviewed by Geoffrey Garen.

This patch introduces Symbol type into property type inference.
One of the use cases of ES6 Symbol is enum value. In this case,
we may hold different symbols as the same property of the same structure.
Current property type inference does not support Symbol type, so in the
above case, the property will be inferred as Top type.

* bytecode/PutByIdFlags.h:
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::set):
* dfg/DFGInferredTypeCheck.cpp:
(JSC::DFG::insertInferredTypeCheck):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::checkInferredType):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::branchIfNotType):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/InferredType.cpp:
(JSC::InferredType::kindForFlags):
(JSC::InferredType::Descriptor::forValue):
(JSC::InferredType::Descriptor::putByIdFlags):
(JSC::InferredType::Descriptor::merge):
(WTF::printInternal):
* runtime/InferredType.h:
* tests/stress/prop-type-symbol-then-object.js: Added.
(foo):
(bar):
(toString):
* tests/stress/prop-type-symbol-then-string.js: Added.
(foo):
(bar):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/PutByIdFlags.h
Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
Source/JavaScriptCore/dfg/DFGInferredTypeCheck.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/jit/AssemblyHelpers.cpp
Source/JavaScriptCore/llint/LLIntData.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
Source/JavaScriptCore/runtime/InferredType.cpp
Source/JavaScriptCore/runtime/InferredType.h
Source/JavaScriptCore/tests/stress/prop-type-symbol-then-object.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/prop-type-symbol-then-string.js [new file with mode: 0644]