[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:32:26 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5cf37c86abea4f261c01ffacca9ed1745c87e336
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Aug 18 07:21:26 2002 +0000
Separated Completion from Value and made it a pure stack
object. This removed another 160,000 of the remaining 580,000
garbage collected object allocations.
6% speed increas on cvs-js-performance test.
* kjs/completion.cpp: Added. New implementation that doesn't
require a ValueImp *.
(Completion::Completion):
(Completion::complType):
(Completion::value):
(Completion::target):
(Completion::isValueCompletion):
* kjs/completion.h: Added.
* kjs/function.cpp:
(GlobalFuncImp::call): Removed some (apparently mistaken) uses of
Completion as a Value.
* kjs/internal.cpp:
* kjs/internal.h:
* kjs/types.cpp: Removed Completion stuff.
* kjs/types.h: Removed Completion stuff.
* JavaScriptCore.pbproj/project.pbxproj: Added new header.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index e471127..116a8f1 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,28 @@
+2002-08-18 Maciej Stachowiak <mjs at apple.com>
+
+ Separated Completion from Value and made it a pure stack
+ object. This removed another 160,000 of the remaining 580,000
+ garbage collected object allocations.
+
+ 6% speed increas on cvs-js-performance test.
+
+ * kjs/completion.cpp: Added. New implementation that doesn't
+ require a ValueImp *.
+ (Completion::Completion):
+ (Completion::complType):
+ (Completion::value):
+ (Completion::target):
+ (Completion::isValueCompletion):
+ * kjs/completion.h: Added.
+ * kjs/function.cpp:
+ (GlobalFuncImp::call): Removed some (apparently mistaken) uses of
+ Completion as a Value.
+ * kjs/internal.cpp:
+ * kjs/internal.h:
+ * kjs/types.cpp: Removed Completion stuff.
+ * kjs/types.h: Removed Completion stuff.
+ * JavaScriptCore.pbproj/project.pbxproj: Added new header.
+
2002-08-16 Darin Adler <darin at apple.com>
Fix the Development build.
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index e471127..116a8f1 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,3 +1,28 @@
+2002-08-18 Maciej Stachowiak <mjs at apple.com>
+
+ Separated Completion from Value and made it a pure stack
+ object. This removed another 160,000 of the remaining 580,000
+ garbage collected object allocations.
+
+ 6% speed increas on cvs-js-performance test.
+
+ * kjs/completion.cpp: Added. New implementation that doesn't
+ require a ValueImp *.
+ (Completion::Completion):
+ (Completion::complType):
+ (Completion::value):
+ (Completion::target):
+ (Completion::isValueCompletion):
+ * kjs/completion.h: Added.
+ * kjs/function.cpp:
+ (GlobalFuncImp::call): Removed some (apparently mistaken) uses of
+ Completion as a Value.
+ * kjs/internal.cpp:
+ * kjs/internal.h:
+ * kjs/types.cpp: Removed Completion stuff.
+ * kjs/types.h: Removed Completion stuff.
+ * JavaScriptCore.pbproj/project.pbxproj: Added new header.
+
2002-08-16 Darin Adler <darin at apple.com>
Fix the Development build.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index e471127..116a8f1 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,28 @@
+2002-08-18 Maciej Stachowiak <mjs at apple.com>
+
+ Separated Completion from Value and made it a pure stack
+ object. This removed another 160,000 of the remaining 580,000
+ garbage collected object allocations.
+
+ 6% speed increas on cvs-js-performance test.
+
+ * kjs/completion.cpp: Added. New implementation that doesn't
+ require a ValueImp *.
+ (Completion::Completion):
+ (Completion::complType):
+ (Completion::value):
+ (Completion::target):
+ (Completion::isValueCompletion):
+ * kjs/completion.h: Added.
+ * kjs/function.cpp:
+ (GlobalFuncImp::call): Removed some (apparently mistaken) uses of
+ Completion as a Value.
+ * kjs/internal.cpp:
+ * kjs/internal.h:
+ * kjs/types.cpp: Removed Completion stuff.
+ * kjs/types.h: Removed Completion stuff.
+ * JavaScriptCore.pbproj/project.pbxproj: Added new header.
+
2002-08-16 Darin Adler <darin at apple.com>
Fix the Development build.
diff --git a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
index cfad1d3..16ed7e9 100644
--- a/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.pbproj/project.pbxproj
@@ -220,6 +220,7 @@
F50888B7030BB74C012A967E,
F54F0801030CD22001B5C2EB,
F5341393030CEEB1018BE7F3,
+ F5BB2BC7030F772101FCFE1D,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -264,6 +265,7 @@
F5FFE657026B47A6018635CA,
F5341392030CEEB1018BE7F3,
F5341395030CF5F8018BE7F3,
+ F5BB2BC6030F772101FCFE1D,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -320,6 +322,8 @@
F692A8510255597D01FF60F7,
F692A8520255597D01FF60F7,
F692A8530255597D01FF60F7,
+ F5BB2BC4030F772101FCFE1D,
+ F5BB2BC5030F772101FCFE1D,
F692A8550255597D01FF60F7,
F692A8560255597D01FF60F7,
F692A8570255597D01FF60F7,
@@ -532,6 +536,33 @@
isa = PBXBuildStyle;
name = Mixed;
};
+ F5BB2BC4030F772101FCFE1D = {
+ isa = PBXFileReference;
+ name = completion.cpp;
+ path = kjs/completion.cpp;
+ refType = 4;
+ };
+ F5BB2BC5030F772101FCFE1D = {
+ isa = PBXFileReference;
+ name = completion.h;
+ path = kjs/completion.h;
+ refType = 4;
+ };
+ F5BB2BC6030F772101FCFE1D = {
+ fileRef = F5BB2BC4030F772101FCFE1D;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5BB2BC7030F772101FCFE1D = {
+ fileRef = F5BB2BC5030F772101FCFE1D;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
F5C290E50284F960018635CA = {
children = (
F692A8540255597D01FF60F7,
diff --git a/JavaScriptCore/kjs/completion.cpp b/JavaScriptCore/kjs/completion.cpp
new file mode 100644
index 0000000..2cbfd6c
--- /dev/null
+++ b/JavaScriptCore/kjs/completion.cpp
@@ -0,0 +1,54 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ * This file is part of the KDE libraries
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2001 Peter Kelly (pmk at post.com)
+ * Copyright (C) 2002 Apple Computer, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "completion.h"
+
+using namespace KJS;
+
+// ------------------------------ Completion -----------------------------------
+
+Completion::Completion(ComplType c, const Value& v, const UString &t)
+ : comp(c), val(v), tar(t)
+{
+}
+
+ComplType Completion::complType() const
+{
+ return comp;
+}
+
+Value Completion::value() const
+{
+ return val;
+}
+
+UString Completion::target() const
+{
+ return tar;
+}
+
+bool Completion::isValueCompletion() const
+{
+ return val.isNull();
+}
diff --git a/JavaScriptCore/kjs/reference_list.h b/JavaScriptCore/kjs/completion.h
similarity index 51%
copy from JavaScriptCore/kjs/reference_list.h
copy to JavaScriptCore/kjs/completion.h
index 09e11d9..a8547e6 100644
--- a/JavaScriptCore/kjs/reference_list.h
+++ b/JavaScriptCore/kjs/completion.h
@@ -1,6 +1,8 @@
// -*- c-basic-offset: 2 -*-
/*
* This file is part of the KDE libraries
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2001 Peter Kelly (pmk at post.com)
* Copyright (C) 2002 Apple Computer, Inc
*
* This library is free software; you can redistribute it and/or
@@ -20,49 +22,44 @@
*
*/
-#ifndef _KJS_REFERENCE_LIST_H_
-#define _KJS_REFERENCE_LIST_H_
+#ifndef _KJS_COMPLETION_H_
+#define _KJS_COMPLETION_H_
-#include "types.h"
-#include "reference.h"
+#include "value.h"
namespace KJS {
- class ReferenceListNode;
- class ReferenceListHeadNode;
+ /**
+ * Completion types.
+ */
+ enum ComplType { Normal, Break, Continue, ReturnValue, Throw };
- class ReferenceListIterator {
- friend class ReferenceList;
-
+ /**
+ * Completion objects are used to convey the return status and value
+ * from functions.
+ *
+ * See @ref FunctionImp::execute()
+ *
+ * @see FunctionImp
+ *
+ * @short Handle for a Completion type.
+ */
+ class Completion : private Value {
public:
- bool operator!=(const ReferenceListIterator &it) const;
- const Reference *operator->() const;
- const Reference &operator++(int i);
-
+ Completion(ComplType c = Normal, const Value& v = Value(),
+ const UString &t = UString::null);
+ Completion(CompletionImp *v);
+
+ ComplType complType() const;
+ Value value() const;
+ UString target() const;
+ bool isValueCompletion() const;
private:
- ReferenceListIterator(ReferenceListNode *n);
- ReferenceListIterator();
- ReferenceListNode *node;
+ ComplType comp;
+ Value val;
+ UString tar;
};
-
- class ReferenceList {
- public:
- ReferenceList();
- ReferenceList(const ReferenceList &list);
- ReferenceList &operator=(const ReferenceList &list);
- ~ReferenceList();
- void append(const Reference& val);
-
- ReferenceListIterator begin() const;
- ReferenceListIterator end() const;
-
- private:
- void swap(ReferenceList &list);
- ReferenceListHeadNode *head;
- ReferenceListNode *tail;
- };
-
}
-#endif
+#endif
diff --git a/JavaScriptCore/kjs/function.cpp b/JavaScriptCore/kjs/function.cpp
index 9b5c890..a49e42d 100644
--- a/JavaScriptCore/kjs/function.cpp
+++ b/JavaScriptCore/kjs/function.cpp
@@ -416,7 +416,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
if ( progNode->deref() )
delete progNode;
if (c.complType() == ReturnValue)
- return c;
+ return c.value();
// ### setException() on throw?
else if (c.complType() == Normal) {
if (c.isValueCompletion())
@@ -424,7 +424,7 @@ Value GlobalFuncImp::call(ExecState *exec, Object &/*thisObj*/, const List &args
else
return Undefined();
} else {
- return c;
+ return Undefined();
}
}
break;
diff --git a/JavaScriptCore/kjs/internal.cpp b/JavaScriptCore/kjs/internal.cpp
index bf02e4e..15e5ea3 100644
--- a/JavaScriptCore/kjs/internal.cpp
+++ b/JavaScriptCore/kjs/internal.cpp
@@ -331,60 +331,6 @@ void LabelStack::clear()
}
}
-// ------------------------------ CompletionImp --------------------------------
-
-CompletionImp::CompletionImp(ComplType c, const Value& v, const UString& t)
- : comp(c), val(v.imp()), tar(t)
-{
-}
-
-CompletionImp::~CompletionImp()
-{
-}
-
-void CompletionImp::mark()
-{
- ValueImp::mark();
-
- if (val && !val->marked())
- val->mark();
-}
-
-Value CompletionImp::toPrimitive(ExecState */*exec*/, Type /*preferredType*/) const
-{
- // invalid for Completion
- assert(false);
- return Value();
-}
-
-bool CompletionImp::toBoolean(ExecState */*exec*/) const
-{
- // invalid for Completion
- assert(false);
- return false;
-}
-
-double CompletionImp::toNumber(ExecState */*exec*/) const
-{
- // invalid for Completion
- assert(false);
- return 0;
-}
-
-UString CompletionImp::toString(ExecState */*exec*/) const
-{
- // invalid for Completion
- assert(false);
- return UString::null;
-}
-
-Object CompletionImp::toObject(ExecState */*exec*/) const
-{
- // invalid for Completion
- assert(false);
- return Object();
-}
-
// ------------------------------ ListImp --------------------------------------
#ifdef KJS_DEBUG_MEM
diff --git a/JavaScriptCore/kjs/internal.h b/JavaScriptCore/kjs/internal.h
index 0da3e96..c235938 100644
--- a/JavaScriptCore/kjs/internal.h
+++ b/JavaScriptCore/kjs/internal.h
@@ -142,32 +142,6 @@ namespace KJS {
// Internal type impls
// ---------------------------------------------------------------------------
- class CompletionImp : public ValueImp {
- public:
- Type type() const { return CompletionType; }
-
- CompletionImp(ComplType c, const Value& v, const UString& t);
- virtual ~CompletionImp();
- virtual void mark();
-
- Value toPrimitive(ExecState *exec, Type preferred = UnspecifiedType) const;
- bool toBoolean(ExecState *exec) const;
- double toNumber(ExecState *exec) const;
- UString toString(ExecState *exec) const;
- Object toObject(ExecState *exec) const;
-
- ComplType complType() const { return comp; }
- Value value() const { return Value(val); }
- UString target() const { return tar; }
-
- private:
- ComplType comp;
- ValueImp * val;
- UString tar;
- };
-
- inline Completion::Completion(CompletionImp *imp) : Value(imp) { }
-
/**
* @internal
*/
diff --git a/JavaScriptCore/kjs/types.cpp b/JavaScriptCore/kjs/types.cpp
index acaca92..38984d2 100644
--- a/JavaScriptCore/kjs/types.cpp
+++ b/JavaScriptCore/kjs/types.cpp
@@ -203,38 +203,3 @@ void List::globalClear()
}
#endif
-
-// ------------------------------ Completion -----------------------------------
-
-Completion::Completion(ComplType c, const Value& v, const UString &t)
- : Value(new CompletionImp(c,v,t))
-{
-}
-
-Completion Completion::dynamicCast(const Value &v)
-{
- if (v.isNull() || v.type() != CompletionType)
- return 0;
-
- return static_cast<CompletionImp*>(v.imp());
-}
-
-ComplType Completion::complType() const
-{
- return static_cast<CompletionImp*>(rep)->complType();
-}
-
-Value Completion::value() const
-{
- return static_cast<CompletionImp*>(rep)->value();
-}
-
-UString Completion::target() const
-{
- return static_cast<CompletionImp*>(rep)->target();
-}
-
-bool Completion::isValueCompletion() const
-{
- return !value().isNull();
-}
diff --git a/JavaScriptCore/kjs/types.h b/JavaScriptCore/kjs/types.h
index cf93897..c77feed 100644
--- a/JavaScriptCore/kjs/types.h
+++ b/JavaScriptCore/kjs/types.h
@@ -27,6 +27,8 @@
// internal data types
#include "value.h"
+#include "reference.h"
+#include "completion.h"
namespace KJS {
@@ -199,44 +201,6 @@ namespace KJS {
#endif
};
- /**
- * Completion types.
- */
- enum ComplType { Normal, Break, Continue, ReturnValue, Throw };
-
- /**
- * Completion objects are used to convey the return status and value
- * from functions.
- *
- * See @ref FunctionImp::execute()
- *
- * @see FunctionImp
- *
- * @short Handle for a Completion type.
- */
- class Completion : public Value {
- public:
- Completion(ComplType c = Normal, const Value& v = Value(),
- const UString &t = UString::null);
- Completion(CompletionImp *v);
-
- /**
- * Converts a Value into an Completion. If the value's type is not
- * CompletionType, a null object will be returned (i.e. one with it's
- * internal pointer set to 0). If you do not know for sure whether the
- * value is of type CompletionType, you should check the @ref isNull()
- * methods afterwards before calling any methods on the returned value.
- *
- * @return The value converted to an Completion
- */
- static Completion dynamicCast(const Value &v);
-
- ComplType complType() const;
- Value value() const;
- UString target() const;
- bool isValueCompletion() const;
- };
-
}; // namespace
#endif // _KJS_TYPES_H_
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list