source: webkit/trunk/Source/JavaScriptCore/DerivedSources.make@ 86727

Last change on this file since 86727 was 86727, checked in by [email protected], 14 years ago

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.

  • 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:
  • Property svn:eol-style set to native
File size: 3.3 KB
Line 
1# Copyright (C) 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions
5# are met:
6#
7# 1. Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9# 2. Redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the
11# documentation and/or other materials provided with the distribution.
12# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
13# its contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
17# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
20# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27VPATH = \
28 $(JavaScriptCore) \
29 $(JavaScriptCore)/parser \
30 $(JavaScriptCore)/docs \
31 $(JavaScriptCore)/runtime \
32 $(JavaScriptCore)/interpreter \
33 $(JavaScriptCore)/jit \
34#
35
36.PHONY : all
37all : \
38 ArrayConstructor.lut.h \
39 ArrayPrototype.lut.h \
40 BooleanPrototype.lut.h \
41 DateConstructor.lut.h \
42 DatePrototype.lut.h \
43 ErrorPrototype.lut.h \
44 HeaderDetection.h \
45 JSONObject.lut.h \
46 JavaScriptCore.JSVALUE32_64.exp \
47 JavaScriptCore.JSVALUE64.exp \
48 JSGlobalObject.lut.h \
49 Lexer.lut.h \
50 MathObject.lut.h \
51 NumberConstructor.lut.h \
52 NumberPrototype.lut.h \
53 ObjectConstructor.lut.h \
54 ObjectPrototype.lut.h \
55 RegExpConstructor.lut.h \
56 RegExpPrototype.lut.h \
57 RegExpJitTables.h \
58 RegExpObject.lut.h \
59 StringConstructor.lut.h \
60 StringPrototype.lut.h \
61 docs/bytecode.html \
62#
63
64# lookup tables for classes
65
66%.lut.h: create_hash_table %.cpp
67 $^ -i > $@
68Lexer.lut.h: create_hash_table Keywords.table
69 $^ > $@
70
71docs/bytecode.html: make-bytecode-docs.pl Interpreter.cpp
72 perl $^ $@
73
74# character tables for Yarr
75
76RegExpJitTables.h: create_regex_tables
77 python $^ > $@
78
79# export files
80
81JavaScriptCore.JSVALUE32_64.exp: JavaScriptCore.exp JavaScriptCore.JSVALUE32_64only.exp
82 cat $^ > $@
83
84JavaScriptCore.JSVALUE64.exp: JavaScriptCore.exp JavaScriptCore.JSVALUE64only.exp
85 cat $^ > $@
86
87
88# header detection
89
90ifeq ($(OS),MACOS)
91
92HeaderDetection.h : DerivedSources.make /System/Library/CoreServices/SystemVersion.plist
93 rm -f $@
94 echo "/* This is a generated file. Do not edit. */" > $@
95 if [ -f $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders/pthread_machdep.h ]; then echo "#define HAVE_PTHREAD_MACHDEP_H 1" >> $@; else echo >> $@; fi
96
97else
98
99HeaderDetection.h :
100 echo > $@
101
102endif
Note: See TracBrowser for help on using the repository browser.