Commit 19fe5092 authored by ggaren@apple.com's avatar ggaren@apple.com

Source/JavaScriptCore: Rolling back in r86653 with build fixed.

Reviewed by Gavin Barraclough and Oliver Hunt.

Global object initialization is expensive
https://bugs.webkit.org/show_bug.cgi?id=60933
        
Changed a bunch of globals to allocate their properties lazily, and changed
the global object to allocate a bunch of its globals lazily.
        
This reduces the footprint of a global object from 287 objects with 58
functions for 24K to 173 objects with 20 functions for 15K.

Large patch, but it's all mechanical.

* DerivedSources.make:
* JavaScriptCore.exp: Build!

* create_hash_table: Added a special case for fromCharCode, since it uses
a custom "thunk generator".

* heap/Heap.cpp:
(JSC::TypeCounter::operator()): Fixed a bug where the type counter would
overcount objects that were owned through more than one mechanism because
it was getting in the way of counting the results for this patch.

* interpreter/CallFrame.h:
(JSC::ExecState::arrayConstructorTable):
(JSC::ExecState::arrayPrototypeTable):
(JSC::ExecState::booleanPrototypeTable):
(JSC::ExecState::dateConstructorTable):
(JSC::ExecState::errorPrototypeTable):
(JSC::ExecState::globalObjectTable):
(JSC::ExecState::numberConstructorTable):
(JSC::ExecState::numberPrototypeTable):
(JSC::ExecState::objectPrototypeTable):
(JSC::ExecState::regExpPrototypeTable):
(JSC::ExecState::stringConstructorTable): Added new tables.

* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
(JSC::ArrayConstructor::getOwnPropertySlot):
(JSC::ArrayConstructor::getOwnPropertyDescriptor):
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::createStructure):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::getOwnPropertySlot):
(JSC::ArrayPrototype::getOwnPropertyDescriptor):
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::BooleanPrototype):
(JSC::BooleanPrototype::getOwnPropertySlot):
(JSC::BooleanPrototype::getOwnPropertyDescriptor):
* runtime/BooleanPrototype.h:
(JSC::BooleanPrototype::createStructure):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
(JSC::DateConstructor::getOwnPropertySlot):
(JSC::DateConstructor::getOwnPropertyDescriptor):
* runtime/DateConstructor.h:
(JSC::DateConstructor::createStructure):
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::ErrorPrototype):
(JSC::ErrorPrototype::getOwnPropertySlot):
(JSC::ErrorPrototype::getOwnPropertyDescriptor):
* runtime/ErrorPrototype.h:
(JSC::ErrorPrototype::createStructure): Standardized these objects
to use static tables for function properties.

* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):
* runtime/JSGlobalData.h: Added new tables.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::addStaticGlobals):
(JSC::JSGlobalObject::getOwnPropertySlot):
(JSC::JSGlobalObject::getOwnPropertyDescriptor):
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObjectFunctions.cpp:
* runtime/JSGlobalObjectFunctions.h: Changed JSGlobalObject to use a
static table for its global functions. This required uninlining some
things to avoid a circular header dependency. However, those things
probably shouldn't have been inlined in the first place.
        
Even more global object properties can be made lazy, but that requires
more in-depth changes.

* runtime/MathObject.cpp:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertySlot):
(JSC::NumberConstructor::getOwnPropertyDescriptor):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::NumberPrototype):
(JSC::NumberPrototype::getOwnPropertySlot):
(JSC::NumberPrototype::getOwnPropertyDescriptor):
* runtime/NumberPrototype.h:
(JSC::NumberPrototype::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::ObjectPrototype):
(JSC::ObjectPrototype::put):
(JSC::ObjectPrototype::getOwnPropertySlot):
(JSC::ObjectPrototype::getOwnPropertyDescriptor):
* runtime/ObjectPrototype.h:
(JSC::ObjectPrototype::createStructure):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::RegExpPrototype):
(JSC::RegExpPrototype::getOwnPropertySlot):
(JSC::RegExpPrototype::getOwnPropertyDescriptor):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::createStructure):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
(JSC::StringConstructor::getOwnPropertySlot):
(JSC::StringConstructor::getOwnPropertyDescriptor):
* runtime/StringConstructor.h:
(JSC::StringConstructor::createStructure): Standardized these objects
to use static tables for function properties.

LayoutTests: Global object initialization is expensive
https://bugs.webkit.org/show_bug.cgi?id=60933
        
Reviewed by Gavin Barraclough.

Added a few more expected failures, now that more code uses static hash
tables.
        
The fact that built-ins are not deletable, but should be, is covered by
https://bugs.webkit.org/show_bug.cgi?id=61014

* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e0883203
2011-05-17 Geoffrey Garen <ggaren@apple.com>
Reviewed by Gavin Barraclough.
Global object initialization is expensive
https://bugs.webkit.org/show_bug.cgi?id=60933
Added a few more expected failures, now that more code uses static hash
tables.
The fact that built-ins are not deletable, but should be, is covered by
https://bugs.webkit.org/show_bug.cgi?id=61014
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt:
2011-05-17 Cris Neckar <cdn@chromium.org>
Reviewed by Adam Barth.
S15.6.2.1_A4
PASS
FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Boolean"
TEST COMPLETE
S15.6.3.1_A1
PASS
FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean"
TEST COMPLETE
S15.6.4_A1
PASS
FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean"
TEST COMPLETE
S15.7.2.1_A4
PASS
FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Number"
TEST COMPLETE
S15.7.3.1_A2_T1
PASS
FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number"
TEST COMPLETE
S15.7.4_A1
PASS
FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number"
TEST COMPLETE
S15.9.4.2_A1_T2
PASS
FAIL SputnikError: #2: The Date.parse property has not the attributes DontDelete
TEST COMPLETE
S15.9.4.3_A1_T2
PASS
FAIL SputnikError: #2: The Date.UTC property has not the attributes DontDelete
TEST COMPLETE
......@@ -176,14 +176,23 @@ SET(JavaScriptCore_SOURCES
SET(JavaScriptCore_HEADERS )
SET(JavaScriptCore_LUT_FILES
runtime/ArrayConstructor.cpp
runtime/ArrayPrototype.cpp
runtime/BooleanPrototype.cpp
runtime/DateConstructor.cpp
runtime/DatePrototype.cpp
runtime/ErrorPrototype.cpp
runtime/JSGlobalObject.cpp
runtime/JSONObject.cpp
runtime/MathObject.cpp
runtime/NumberConstructor.cpp
runtime/NumberPrototype.cpp
runtime/ObjectConstructor.cpp
runtime/ObjectPrototype.cpp
runtime/RegExpConstructor.cpp
runtime/RegExpObject.cpp
runtime/RegExpPrototype.cpp
runtime/StringConstructor.cpp
runtime/StringPrototype.cpp
)
......
2011-05-16 Geoffrey Garen <ggaren@apple.com>
Rolling back in r86653 with build fixed.
Reviewed by Gavin Barraclough and Oliver Hunt.
Global object initialization is expensive
https://bugs.webkit.org/show_bug.cgi?id=60933
Changed a bunch of globals to allocate their properties lazily, and changed
the global object to allocate a bunch of its globals lazily.
This reduces the footprint of a global object from 287 objects with 58
functions for 24K to 173 objects with 20 functions for 15K.
Large patch, but it's all mechanical.
* DerivedSources.make:
* JavaScriptCore.exp: Build!
* create_hash_table: Added a special case for fromCharCode, since it uses
a custom "thunk generator".
* heap/Heap.cpp:
(JSC::TypeCounter::operator()): Fixed a bug where the type counter would
overcount objects that were owned through more than one mechanism because
it was getting in the way of counting the results for this patch.
* interpreter/CallFrame.h:
(JSC::ExecState::arrayConstructorTable):
(JSC::ExecState::arrayPrototypeTable):
(JSC::ExecState::booleanPrototypeTable):
(JSC::ExecState::dateConstructorTable):
(JSC::ExecState::errorPrototypeTable):
(JSC::ExecState::globalObjectTable):
(JSC::ExecState::numberConstructorTable):
(JSC::ExecState::numberPrototypeTable):
(JSC::ExecState::objectPrototypeTable):
(JSC::ExecState::regExpPrototypeTable):
(JSC::ExecState::stringConstructorTable): Added new tables.
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
(JSC::ArrayConstructor::getOwnPropertySlot):
(JSC::ArrayConstructor::getOwnPropertyDescriptor):
* runtime/ArrayConstructor.h:
(JSC::ArrayConstructor::createStructure):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::getOwnPropertySlot):
(JSC::ArrayPrototype::getOwnPropertyDescriptor):
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::BooleanPrototype):
(JSC::BooleanPrototype::getOwnPropertySlot):
(JSC::BooleanPrototype::getOwnPropertyDescriptor):
* runtime/BooleanPrototype.h:
(JSC::BooleanPrototype::createStructure):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
(JSC::DateConstructor::getOwnPropertySlot):
(JSC::DateConstructor::getOwnPropertyDescriptor):
* runtime/DateConstructor.h:
(JSC::DateConstructor::createStructure):
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::ErrorPrototype):
(JSC::ErrorPrototype::getOwnPropertySlot):
(JSC::ErrorPrototype::getOwnPropertyDescriptor):
* runtime/ErrorPrototype.h:
(JSC::ErrorPrototype::createStructure): Standardized these objects
to use static tables for function properties.
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):
* runtime/JSGlobalData.h: Added new tables.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::addStaticGlobals):
(JSC::JSGlobalObject::getOwnPropertySlot):
(JSC::JSGlobalObject::getOwnPropertyDescriptor):
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObjectFunctions.cpp:
* runtime/JSGlobalObjectFunctions.h: Changed JSGlobalObject to use a
static table for its global functions. This required uninlining some
things to avoid a circular header dependency. However, those things
probably shouldn't have been inlined in the first place.
Even more global object properties can be made lazy, but that requires
more in-depth changes.
* runtime/MathObject.cpp:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertySlot):
(JSC::NumberConstructor::getOwnPropertyDescriptor):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::NumberPrototype):
(JSC::NumberPrototype::getOwnPropertySlot):
(JSC::NumberPrototype::getOwnPropertyDescriptor):
* runtime/NumberPrototype.h:
(JSC::NumberPrototype::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::ObjectPrototype):
(JSC::ObjectPrototype::put):
(JSC::ObjectPrototype::getOwnPropertySlot):
(JSC::ObjectPrototype::getOwnPropertyDescriptor):
* runtime/ObjectPrototype.h:
(JSC::ObjectPrototype::createStructure):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::RegExpPrototype):
(JSC::RegExpPrototype::getOwnPropertySlot):
(JSC::RegExpPrototype::getOwnPropertyDescriptor):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::createStructure):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
(JSC::StringConstructor::getOwnPropertySlot):
(JSC::StringConstructor::getOwnPropertyDescriptor):
* runtime/StringConstructor.h:
(JSC::StringConstructor::createStructure): Standardized these objects
to use static tables for function properties.
2011-05-17 Sam Weinig <sam@webkit.org>
Reviewed by Oliver Hunt.
......
......@@ -35,19 +35,28 @@ VPATH = \
.PHONY : all
all : \
ArrayConstructor.lut.h \
ArrayPrototype.lut.h \
BooleanPrototype.lut.h \
DateConstructor.lut.h \
DatePrototype.lut.h \
ErrorPrototype.lut.h \
HeaderDetection.h \
JSONObject.lut.h \
JavaScriptCore.JSVALUE32_64.exp \
JavaScriptCore.JSVALUE64.exp \
JSGlobalObject.lut.h \
Lexer.lut.h \
MathObject.lut.h \
NumberConstructor.lut.h \
NumberPrototype.lut.h \
ObjectConstructor.lut.h \
ObjectPrototype.lut.h \
RegExpConstructor.lut.h \
RegExpPrototype.lut.h \
RegExpJitTables.h \
RegExpObject.lut.h \
StringConstructor.lut.h \
StringPrototype.lut.h \
docs/bytecode.html \
#
......
......@@ -14,15 +14,24 @@ CONFIG(standalone_package) {
}
LUT_FILES += \
runtime/ArrayConstructor.cpp \
runtime/ArrayPrototype.cpp \
runtime/BooleanPrototype.cpp \
runtime/DateConstructor.cpp \
runtime/DatePrototype.cpp \
runtime/ErrorPrototype.cpp \
runtime/JSGlobalObject.cpp \
runtime/JSONObject.cpp \
runtime/MathObject.cpp \
runtime/NumberConstructor.cpp \
runtime/NumberPrototype.cpp \
runtime/ObjectConstructor.cpp \
runtime/ObjectPrototype.cpp \
runtime/RegExpConstructor.cpp \
runtime/RegExpObject.cpp \
runtime/StringPrototype.cpp
runtime/RegExpPrototype.cpp \
runtime/StringConstructor.cpp \
runtime/StringPrototype.cpp \
KEYWORDLUT_FILES += \
parser/Keywords.table
......
......@@ -145,14 +145,26 @@ EXTRA_DIST += \
# Clean rules for JavaScriptCore
# FIXME: Should this list be generated from javascriptcore_built_nosources?
CLEANFILES += \
Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \
Source/JavaScriptCore/runtime/DatePrototype.lut.h \
Source/JavaScriptCore/runtime/JSONObject.lut.h \
Source/JavaScriptCore/runtime/MathObject.lut.h \
Source/JavaScriptCore/runtime/NumberConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpObject.lut.h \
Source/JavaScriptCore/runtime/StringPrototype.lut.h \
Source/JavaScriptCore/Lexer.lut.h \
Source/JavaScriptCore/RegExpJitTables.h \
Source/JavaScriptCore/runtime/ArrayConstructor.lut.h \
Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \
Source/JavaScriptCore/runtime/BooleanPrototype.lut.h \
Source/JavaScriptCore/runtime/DateConstructor.lut.h \
Source/JavaScriptCore/runtime/DatePrototype.lut.h \
Source/JavaScriptCore/runtime/ErrorPrototype.lut.h \
Source/JavaScriptCore/runtime/JSGlobalObject.lut.h \
Source/JavaScriptCore/runtime/JSONObject.lut.h \
Source/JavaScriptCore/runtime/MathObject.lut.h \
Source/JavaScriptCore/runtime/NumberConstructor.lut.h \
Source/JavaScriptCore/runtime/NumberPrototype.lut.h \
Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \
Source/JavaScriptCore/runtime/ObjectPrototype.lut.h \
Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpObject.lut.h \
Source/JavaScriptCore/runtime/RegExpPrototype.lut.h \
Source/JavaScriptCore/runtime/StringConstructor.lut.h \
Source/JavaScriptCore/runtime/StringPrototype.lut.h \
Programs/jsc \
Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
Programs/minidom
......@@ -13,15 +13,24 @@ javascriptcore_h_api += \
javascriptcore_built_nosources += \
Source/JavaScriptCore/Lexer.lut.h \
Source/JavaScriptCore/RegExpJitTables.h \
Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \
Source/JavaScriptCore/runtime/DatePrototype.lut.h \
Source/JavaScriptCore/runtime/JSONObject.lut.h \
Source/JavaScriptCore/runtime/MathObject.lut.h \
Source/JavaScriptCore/runtime/NumberConstructor.lut.h \
Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpObject.lut.h \
Source/JavaScriptCore/runtime/StringPrototype.lut.h
Source/JavaScriptCore/runtime/ArrayConstructor.lut.h \
Source/JavaScriptCore/runtime/ArrayPrototype.lut.h \
Source/JavaScriptCore/runtime/BooleanPrototype.lut.h \
Source/JavaScriptCore/runtime/DateConstructor.lut.h \
Source/JavaScriptCore/runtime/DatePrototype.lut.h \
Source/JavaScriptCore/runtime/ErrorPrototype.lut.h \
Source/JavaScriptCore/runtime/JSGlobalObject.lut.h \
Source/JavaScriptCore/runtime/JSONObject.lut.h \
Source/JavaScriptCore/runtime/MathObject.lut.h \
Source/JavaScriptCore/runtime/NumberConstructor.lut.h \
Source/JavaScriptCore/runtime/NumberPrototype.lut.h \
Source/JavaScriptCore/runtime/ObjectConstructor.lut.h \
Source/JavaScriptCore/runtime/ObjectPrototype.lut.h \
Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
Source/JavaScriptCore/runtime/RegExpObject.lut.h \
Source/JavaScriptCore/runtime/RegExpPrototype.lut.h \
Source/JavaScriptCore/runtime/StringConstructor.lut.h \
Source/JavaScriptCore/runtime/StringPrototype.lut.h
javascriptcore_sources += \
Source/JavaScriptCore/API/APICast.h \
......
......@@ -159,9 +159,13 @@ __ZN3JSC14JSGlobalObject11disableEvalEv
__ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
__ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
__ZN3JSC14JSGlobalObject13visitChildrenERNS_9MarkStackE
__ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
__ZN3JSC14JSGlobalObject6s_infoE
__ZN3JSC14JSGlobalObjectD2Ev
__ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE
__ZN3JSC14MachineThreads16addCurrentThreadEv
......@@ -217,8 +221,8 @@ __ZN3JSC24JSObjectWithGlobalObjectC2ERNS_12JSGlobalDataEPNS_14JSGlobalObjectEPNS
__ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
__ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
__ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
__ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
__ZN3JSC3NaNE
__ZN3JSC41constructFunctionSkippingEvalEnabledCheckEPNS_9ExecStateEPNS_14JSGlobalObjectERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi
__ZN3JSC4Heap16activityCallbackEv
__ZN3JSC4Heap16allocateSlowCaseEm
__ZN3JSC4Heap16objectTypeCountsEv
......@@ -375,10 +379,10 @@ __ZN3WTF10fastStrDupEPKc
__ZN3WTF11OSAllocator16reserveAndCommitEmNS0_5UsageEbb
__ZN3WTF11OSAllocator18releaseDecommittedEPvm
__ZN3WTF11commentAtomE
__ZN3WTF11emptyStringEv
__ZN3WTF11currentTimeEv
__ZN3WTF11dtoaRoundDPEPcdiRbRiRj
__ZN3WTF11dtoaRoundSFEPcdiRbRiRj
__ZN3WTF11emptyStringEv
__ZN3WTF11fastReallocEPvm
__ZN3WTF12AtomicString11addSlowCaseEPNS_10StringImplE
__ZN3WTF12AtomicString16fromUTF8InternalEPKcS2_
......
......@@ -692,19 +692,27 @@
'yarr/YarrSyntaxChecker.h',
],
'javascriptcore_derived_source_files': [
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/Lexer.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpJitTables.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ArrayPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/BooleanPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DateConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/DatePrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/HeaderDetection.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ErrorPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSGlobalObject.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/JSONObject.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/Lexer.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/MathObject.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/NumberPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpJitTables.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpObject.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/RegExpPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringConstructor.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/StringPrototype.lut.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/TracingDtrace.h',
'<(PRODUCT_DIR)/DerivedSources/JavaScriptCore/ObjectConstructor.lut.h',
],
'minidom_files': [
'API/tests/JSNode.c',
......
......@@ -56,6 +56,7 @@ EXPORTS
?addPropertyTransitionToExistingStructure@Structure@JSC@@SAPAV12@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
?addPropertyWithoutTransition@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@IPAVJSCell@2@@Z
?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z
?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z
?allocate@Heap@JSC@@QAEPAXI@Z
?allocateFromSizeClass@MarkedSpace@JSC@@AAEPAXAAUSizeClass@12@@Z
?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z
......@@ -182,6 +183,7 @@ EXPORTS
?getConstructData@JSCell@JSC@@UAE?AW4ConstructType@2@AATConstructData@2@@Z
?getJSNumber@JSCell@JSC@@UAE?AVJSValue@2@XZ
?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
......@@ -191,6 +193,7 @@ EXPORTS
?getOwnPropertySlot@JSArray@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
?getOwnPropertySlot@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
?getOwnPropertySlot@JSObject@JSC@@UAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
?getOwnPropertySlot@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z
?getOwnPropertySlot@JSString@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z
......@@ -240,10 +243,6 @@ EXPORTS
?lockCount@JSLock@JSC@@SAHXZ
?lookupGetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
?lookupSetter@JSObject@JSC@@UAE?AVJSValue@2@PAVExecState@2@ABVIdentifier@2@@Z
?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z
?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z
?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z
?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z
?materializePropertyMap@Structure@JSC@@AAEXAAVJSGlobalData@2@@Z
?monthFromDayInYear@WTF@@YAHH_N@Z
?msToYear@WTF@@YAHN@Z
......@@ -297,6 +296,7 @@ EXPORTS
?restoreAll@Profile@JSC@@QAEXXZ
?retrieveCaller@Interpreter@JSC@@QBE?AVJSValue@2@PAVExecState@2@PAVJSFunction@2@@Z
?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z
?s_info@JSGlobalObject@JSC@@2UClassInfo@2@B
?setAccessorDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@0I@Z
?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z
?setDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@I@Z
......@@ -369,6 +369,10 @@ EXPORTS
?unprotect@Heap@JSC@@QAE_NVJSValue@2@@Z
?unwrappedObject@JSObject@JSC@@UAEPAV12@XZ
?utf8@UString@JSC@@QBE?AVCString@WTF@@_N@Z
?visitChildren@JSGlobalObject@JSC@@UAEXAAVMarkStack@2@@Z
?visitChildren@JSObject@JSC@@UAEXAAVMarkStack@2@@Z
?visitChildren@JSWrapperObject@JSC@@EAEXAAVMarkStack@2@@Z
?visitChildren@ScopeChainNode@JSC@@UAEXAAVMarkStack@2@@Z
?vtableAnchor@InternalFunction@JSC@@EAEXXZ
?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
......
......@@ -284,6 +284,9 @@ sub output() {
if ($key eq "pow") {
$thunkGenerator = "powThunkGenerator";
}
if ($key eq "fromCharCode") {
$thunkGenerator = "fromCharCodeThunkGenerator";
}
print " { \"$key\", $attrs[$i], (intptr_t)" . $castStr . "($firstValue), (intptr_t)$secondValue THUNK_GENERATOR($thunkGenerator) },\n";
$i++;
}
......
/*
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
*
* This library is free software; you can redistribute it and/or
......@@ -313,6 +313,7 @@ public:
private:
const char* typeName(JSCell*);
OwnPtr<TypeCountSet> m_typeCountSet;
HashSet<JSCell*> m_cells;
};
inline TypeCounter::TypeCounter()
......@@ -339,6 +340,8 @@ inline const char* TypeCounter::typeName(JSCell* cell)
inline void TypeCounter::operator()(JSCell* cell)
{
if (!m_cells.add(cell).second)
return;
m_typeCountSet->add(typeName(cell));
}
......
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -75,15 +75,24 @@ namespace JSC {
#ifndef NDEBUG
void dumpCaller();
#endif
static const HashTable* arrayTable(CallFrame* callFrame) { return callFrame->globalData().arrayTable; }
static const HashTable* arrayConstructorTable(CallFrame* callFrame) { return callFrame->globalData().arrayConstructorTable; }
static const HashTable* arrayPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().arrayPrototypeTable; }
static const HashTable* booleanPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().booleanPrototypeTable; }
static const HashTable* dateTable(CallFrame* callFrame) { return callFrame->globalData().dateTable; }
static const HashTable* dateConstructorTable(CallFrame* callFrame) { return callFrame->globalData().dateConstructorTable; }
static const HashTable* errorPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().errorPrototypeTable; }
static const HashTable* globalObjectTable(CallFrame* callFrame) { return callFrame->globalData().globalObjectTable; }
static const HashTable* jsonTable(CallFrame* callFrame) { return callFrame->globalData().jsonTable; }
static const HashTable* mathTable(CallFrame* callFrame) { return callFrame->globalData().mathTable; }
static const HashTable* numberTable(CallFrame* callFrame) { return callFrame->globalData().numberTable; }
static const HashTable* numberConstructorTable(CallFrame* callFrame) { return callFrame->globalData().numberConstructorTable; }
static const HashTable* numberPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().numberPrototypeTable; }
static const HashTable* objectConstructorTable(CallFrame* callFrame) { return callFrame->globalData().objectConstructorTable; }
static const HashTable* objectPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().objectPrototypeTable; }
static const HashTable* regExpTable(CallFrame* callFrame) { return callFrame->globalData().regExpTable; }
static const HashTable* regExpConstructorTable(CallFrame* callFrame) { return callFrame->globalData().regExpConstructorTable; }
static const HashTable* regExpPrototypeTable(CallFrame* callFrame) { return callFrame->globalData().regExpPrototypeTable; }
static const HashTable* stringTable(CallFrame* callFrame) { return callFrame->globalData().stringTable; }
static const HashTable* stringConstructorTable(CallFrame* callFrame) { return callFrame->globalData().stringConstructorTable; }
static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
Register* registers() { return this; }
......
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2003 Peter Kelly (pmk@post.com)
* Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
*
......@@ -33,23 +33,43 @@
namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype, Structure* functionStructure)
}
#include "ArrayConstructor.lut.h"
namespace JSC {
const ClassInfo ArrayConstructor::s_info = { "Function", &InternalFunction::s_info, 0, ExecState::arrayConstructorTable };
/* Source for ArrayConstructor.lut.h
@begin arrayConstructorTable
isArray arrayConstructorIsArray DontEnum|Function 1
@end
*/
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
: InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
{
// ECMA 15.4.3.1 Array.prototype
putDirectWithoutTransition(exec->globalData(), exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
putDirectWithoutTransition(exec->globalData(), exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
}
bool ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
{
return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, slot);
}
// ES5
putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);
bool ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor);
}
// ------------------------------ Functions ---------------------------
static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args)
{
JSGlobalObject* globalObject = asInternalFunction(exec->callee())->globalObject();
......@@ -72,7 +92,6 @@ static EncodedJSValue JSC_HOST_CALL constructWithArrayConstructor(ExecState* exe
return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
// ECMA 15.4.2
ConstructType ArrayConstructor::getConstructData(ConstructData& constructData)
{
constructData.native.function = constructWithArrayConstructor;
......@@ -85,7 +104,6 @@ static EncodedJSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
// ECMA 15.6.1
CallType ArrayConstructor::getCallData(CallData& callData)
{
// equivalent to 'new Array(....)'
......
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -29,7 +29,21 @@ namespace JSC {
class ArrayConstructor : public InternalFunction {
public:
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*, Structure*);
ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
static const ClassInfo s_info;
static