Structure should initialize its previousID in its constructor.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2014 18:07:37 +0000 (18:07 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2014 18:07:37 +0000 (18:07 +0000)
commitd3b711008a3f5362f9dfaab371a684e72a182daa
tree2a8a59ea70f4925bed72cca84b922d8c6b41c2a3
parentf13fcb10bc3f0c30723192d73a75067092d26f79
Structure should initialize its previousID in its constructor.
<https://webkit.org/b/133606>

Reviewed by Mark Hahnenberg.

Currently, the Structure constructor that takes a previous structure will
initialize its previousID to point to the previous structure's previousID.
This is incorrect.  However, the caller of the Structure::create() factory
method (which instantiated the Structure) will later call setPreviousID()
to set the previousID to the correct previous structure.  This makes the
code confusing to read and more error prone in that the structure relies
on client code to fix its invalid previousID.

This patch fixes this by making the Structure constructor initialize
previousID correctly.

* runtime/Structure.cpp:
(JSC::Structure::Structure):
(JSC::Structure::addPropertyTransition):
(JSC::Structure::nonPropertyTransition):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/Structure.h
Source/JavaScriptCore/runtime/StructureInlines.h