Timeline



May 12, 2008:

11:06 PM Changeset in webkit [33371] by mrowe@apple.com
  • 5 edits
    3 adds in branches/squirrelfish

Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
<https://bugs.webkit.org/show_bug.cgi?id=18934>

Reviewed by Geoff

Unfortunately we cannot create new statically optimised globals if there are any
tainted RegisterFiles on the RegisterFileStack. To handle this we re-introduce
(in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.

11:06 PM Changeset in webkit [33370] by mrowe@apple.com
  • 5 edits
    2 adds in branches/squirrelfish

JavaScriptCore:

2008-05-12 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Introduced support for function.caller.

Improved support for walking interesting scopes for function introspection.

This fixes all remaining layout tests not blocked by rebasing to trunk.

SunSpider reports no change.

  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): Fixed a spacing issue.

LayoutTests:

2008-05-12 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Layout test for function.arguments and function.caller in interesting
scopes.

  • fast/js/function-dot-arguments-and-caller-expected.txt: Added.
  • fast/js/function-dot-arguments-and-caller.html: Added.
11:06 PM Changeset in webkit [33369] by mrowe@apple.com
  • 3 edits
    3 adds in branches/squirrelfish

2008-05-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Bug 18961: SQUIRRELFISH: Gmail doesn't load
<https://bugs.webkit.org/show_bug.cgi?id=18961>

Fix codegen for logical nodes so that they don't use their destination
as a temporary.

  • kjs/nodes.cpp: (KJS::LogicalAndNode::emitCode): (KJS::LogicalOrNode::emitCode):
  • fast/js/codegen-temporaries-expected.txt: Added.
  • fast/js/codegen-temporaries.html: Added.
  • fast/js/resources/codegen-temporaries.js: Added.
11:06 PM Changeset in webkit [33368] by mrowe@apple.com
  • 1 edit
    1 add in branches/squirrelfish/WebCore

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Build fix.

  • add missing forwarding header
  • ForwardingHeaders/kjs/SourceProvider.h: Added.
11:06 PM Changeset in webkit [33367] by mrowe@apple.com
  • 38 edits
    3 copies in branches/squirrelfish

JavaScriptCore:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

Three layout tests are fixed:

fast/js/toString-elision-trailing-comma.html
fast/js/toString-prefix-postfix-preserve-parens.html
fast/js/kde/lval-exceptions.html

Functions now save a shared subrange of the original source used
to make them (so in the common case this adds no storage above the
memory cache).

  • kjs/SourceProvider.h: Added. (KJS::SourceProvider): New abstract base class for classes that provide on-demand access to the source for a JavaScript program. This allows function objects to have access to their original source without copying. (KJS::UStringSourceProvider): SourceProvider subclass backed by a KJS::UString. (KJS::UStringSourceProvider::create): (KJS::UStringSourceProvider::getRange): (KJS::UStringSourceProvider::data): (KJS::UStringSourceProvider::length): (KJS::UStringSourceProvider::UStringSourceProvider):
  • kjs/SourceRange.h: Added. (KJS::SourceRange::SourceRange): Class that holds a SourceProvider and a character range into the source, to encapsulate on-demand access to the source of a function. (KJS::SourceRange::toString):
  • VM/Machine.cpp: (KJS::eval): Pass a UStringSourceProvider to the parser.
  • kjs/Parser.cpp: (KJS::Parser::parse): Take a SourceProvider and pass it on to the lexer.
  • kjs/Parser.h: (KJS::Parser::parse): Take a SourceProvider.
  • kjs/lexer.cpp: (KJS::Lexer::setCode): Take a SourceProvider; keep it around, and use it to get the raw buffer and length.
  • kjs/lexer.h: (KJS::Lexer::sourceRange): Convenience function to get a source range based on the lexer's source provieder, and char offsets right before and after the desired range.
  • kjs/function.cpp: (KJS::globalFuncEval): Pass a UStringSourceProvider to the parser.
  • kjs/function_object.cpp: (KJS::functionProtoFuncToString): Use toSourceString to get the source. (KJS::FunctionObjectImp::construct): Give the parser a UStringSourceProvider.
  • kjs/grammar.y: When parsing a function declaration, function expression, or getter or setter, tell the function body about its SourceRange.
  • kjs/interpreter.cpp: (KJS::Interpreter::checkSyntax): Pass a SourceProvider to the parser. (KJS::Interpreter::evaluate): Pass a SourceProvider to the parser.
  • kjs/interpreter.h:
  • kjs/nodes.h: (KJS::FunctionBodyNode::setSource): Establish a SourceRange for this function. (KJS::FunctionBodyNode::toSourceString): Get the source string out of the SourceRange. (KJS::FuncExprNode::): Take a SourceRange and set it on the body. (KJS::FuncDeclNode::): ditto
  • kjs/testkjs.cpp: (prettyPrintScript): Use a SourceProvider appropriately.
  • JavaScriptCore.exp: Export new symbols.
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add new files.
  • JavaScriptCore.xcodeproj/project.pbxproj: Add new files.

JavaScriptGlue:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • JSRun.cpp: (JSRun::Evaluate): Use UString version of eveluate() instead of the now departed UChar*/length variant; use of the lower-level version was gratuitous in any case. (JSRun::CheckSyntax): Ditto for checkSyntax().

WebCore:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • bindings/js/StringSourceProvider.h: Added. SourceProvider subclass backed by a WebCore::String. (WebCore::StringSourceProvider::create): (WebCore::StringSourceProvider::getRange): (WebCore::StringSourceProvider::data): (WebCore::StringSourceProvider::length): (WebCore::StringSourceProvider::StringSourceProvider):
  • bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate): Pass a StringSourceProvider to evaluate() instead of UChar* / length.
  • html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::text): Modified to return the original string as-is when the script element contains only a single text node, to avoid excess memory use.
  • WebCore.vcproj/WebCore.vcproj: Add new file to build.
  • WebCore.xcodeproj/project.pbxproj: ditto

LayoutTests:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

All of these tests expected function.toString to somewhat change
things from the raw original source. They are now prepared for the
fact that this does not happen.

  • fast/js/function-decompilation-operators.html:
  • fast/js/function-names-expected.txt:
  • fast/js/function-prototype-expected.txt:
  • fast/js/function-prototype.html:
  • fast/js/function-toString-object-literals-expected.txt:
  • fast/js/function-toString-parentheses-expected.txt:
  • fast/js/kde/lval-exceptions-expected.txt:
  • fast/js/modify-non-references-expected.txt:
  • fast/js/resources/function-names.js:
  • fast/js/resources/function-toString-object-literals.js:
  • fast/js/resources/function-toString-parentheses.js:
  • fast/js/resources/modify-non-references.js:
  • fast/js/resources/toString-prefix-postfix-preserve-parens.js:
  • fast/js/toString-prefix-postfix-preserve-parens-expected.txt:
11:06 PM Changeset in webkit [33366] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

Bring back RegisterFile tainting in order to correctly handle
natively implemented getters and setters that re-enter JavaScript

Reviewed by Maciej

11:06 PM Changeset in webkit [33365] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-05-09 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • track character offsets of open and close braces, in preparation for saving function source

I verified that there is no performance regression from this change.

  • kjs/grammar.y:
  • kjs/lexer.cpp: (KJS::Lexer::lex): (KJS::Lexer::matchPunctuator):
  • kjs/lexer.h:
11:06 PM Changeset in webkit [33364] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Debug build fix

No reviewer

11:06 PM Changeset in webkit [33363] by mrowe@apple.com
  • 12 edits in branches/squirrelfish

Build fixes for SquirrelFish on windows.

Reviewed by Geoff

11:06 PM Changeset in webkit [33362] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/LayoutTests

2008-05-09 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Restored the expected results for viewsource-empty-attribute-value.html
to what they were prior to r31100. These results expect that the
top-level name in the frame path is "" instead of "1".

It's not clear how r31100 changed the top-level frame in the frame path
to be named "1". The change definitely wasn't related to any expected
behavior in r31100, which was about default margin-bottom for form
elements in quirks mode.

It's also not clear how squirrelfish changes things back.

Sam mentioned that the test result changes intermittently on trunk.

For now, I don't think we need to think deeply about this issue,
since the "" result seems more correct than the "1" result.

  • fast/frames/viewsource-empty-attribute-value-expected.txt:
11:06 PM Changeset in webkit [33361] by mrowe@apple.com
  • 1 edit
    1 add in branches/squirrelfish/LayoutTests

2008-05-09 Geoffrey Garen <ggaren@apple.com>

Added expected results for this test.

  • fast/js/closure-inside-extra-arg-call-expected.txt: Added.
11:06 PM Changeset in webkit [33360] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/WebCore

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed platform/mac/plugins/bindings-test-objc.html.

I've restored -[WebScriptObject setException] and
+[WebScriptObject throwException].

Instead of mucking around in the JavaScript engine's execution state,
throwing an exception sets a global exception string, along with the
environment in which to throw it. An ObjC callback checks the global
exception string and, if it's non-nil and the environment matches the
current exceution environment, throws the global exception string as a
JS exception.

I also removed the old currentGlobalObject infrastructure: it's no longer
used.

11:06 PM Changeset in webkit [33359] by mrowe@apple.com
  • 3 edits
    2 adds in branches/squirrelfish

JavaScriptCore:

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • fix activation tearoff in the case where functions are called with too many arguments

Fixes:
fast/canvas/patternfill-repeat.html
fast/dom/SelectorAPI/bug-17313.html

  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): (KJS::scopeChainForCall): (KJS::Machine::execute): (KJS::Machine::privateExecute):

LayoutTests:

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

Add test cases for failures similar to the SquirrelFish failure on
fast/dom/SelectorAPI/bug-17313.html

  • fast/js/closure-inside-extra-arg-call.html: Added.
  • fast/js/resources/closure-inside-extra-arg-call.js: Added.
11:06 PM Changeset in webkit [33358] by mrowe@apple.com
  • 4 edits
    4 adds in branches/squirrelfish

JavaScriptCore:

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed failure in fast/canvas/canvas-pattern-behaviour.html.

SunSpider reports a small speedup. Not sure what that's about.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump): Fixed op_call_eval to dump as "op_call_eval". This helped me while debugging.
  • VM/Machine.cpp: (KJS::Machine::unwindCallFrame): When looking for an activation to tear off, don't use the scope chain. Inside eval, the scope chain doesn't belong to us; it belongs to our calling function.

Also, don't use the needsFullScopeChain flag to decide whether to tear
off the activation. "function.arguments" can create an activation
for a function whose needsFullScopeChain flag is set to false.

LayoutTests:

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Added specific test cases for the root cause of squirrelfish's failure
in fast/canvas/canvas-pattern-behaviour.html.

  • fast/js/exception-thrown-from-eval-inside-closure-expected.txt: Added.
  • fast/js/exception-thrown-from-eval-inside-closure.html: Added.
  • fast/js/exception-thrown-from-function-with-lazy-activation-expected.txt: Added.
  • fast/js/exception-thrown-from-function-with-lazy-activation.html: Added.
11:05 PM Changeset in webkit [33357] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/LayoutTests

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Updated test results to reflect correct behavior: The line number in
the old results was off by 2.

  • fast/js/recursion-limit-equal-expected.txt:
11:05 PM Changeset in webkit [33356] by mrowe@apple.com
  • 2 edits
    2 moves
    6 deletes in branches/squirrelfish/LayoutTests

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • move frame.xhtml and iframe.xhtml into a resources dir, as they were never meant to be tests
  • dom/xhtml/level2/html/HTMLFrameElement09.xhtml-disabled:
  • dom/xhtml/level2/html/frame.xhtml: Removed.
  • dom/xhtml/level2/html/iframe.xhtml: Removed.
  • dom/xhtml/level2/html/resources/frame.xhtml: Copied from dom/xhtml/level2/html/frame.xhtml.
  • dom/xhtml/level2/html/resources/iframe.xhtml: Copied from dom/xhtml/level2/html/iframe.xhtml.
  • platform/mac/dom/xhtml/level2/html/frame-expected.checksum: Removed.
  • platform/mac/dom/xhtml/level2/html/frame-expected.png: Removed.
  • platform/mac/dom/xhtml/level2/html/frame-expected.txt: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.checksum: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.png: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.txt: Removed.
11:05 PM Changeset in webkit [33355] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix function.call for calls of more than 8 arguments

Fixes svg/carto.net/button.svg

  • kjs/list.cpp: (KJS::List::getSlice): properly set up the m_buffer of the target list.
11:05 PM Changeset in webkit [33354] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • don't return a null RegisterID from RegExpNode in the exception case, since the caller may need a real register

Fixes:

  • fast/regex/early-acid3-86.html
  • http/tests/misc/acid3.html
  • kjs/nodes.cpp: (KJS::RegExpNode::emitCode):
11:05 PM Changeset in webkit [33353] by mrowe@apple.com
  • 13 edits
    2 adds in branches/squirrelfish/LayoutTests

o2008-05-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Added this test to demonstrate that, for "f(x)", it is correct to evaluate
"x" even if "f" is not a function, and therefore "f(x)" will throw an exception.

  • fast/js/function-argument-evaluation-before-exception-expected.txt: Added.
  • fast/js/function-argument-evaluation-before-exception.html: Added.

These tests now have an extra "access denied" message in them, because
of the behavior change mentioned above.

I also added try/catch clauses to eliminate the "is not object"
exception messages from the test output.

  • http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-JSTargetNode-onclick-shortcut.html:
  • http/tests/security/listener/resources/targetChild-XMLHttpRequest-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-XMLHttpRequest-shortcut.html:
  • http/tests/security/listener/resources/targetChild-window-onclick-addEventListener.html:
  • http/tests/security/listener/resources/targetChild-window-onclick-shortcut.html:
  • http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
  • http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
  • http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
  • http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
11:05 PM Changeset in webkit [33352] by mrowe@apple.com
  • 11 edits in branches/squirrelfish/LayoutTests

2008-05-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed up a few more tests that depended on the exact text of exception
messages.

  • In these tests, I fixed a bug in frame.html and iframe.html that caused a function to execute too many times.
  • dom/html/level2/html/HTMLFrameElement09-expected.txt:
  • dom/html/level2/html/HTMLIFrameElement11-expected.txt:
  • dom/html/level2/html/resources/frame.html:
  • dom/html/level2/html/resources/iframe.html:
  • I changed these tests to explicitly report exceptions, so their results don't depend on how the engine constructs messages for implicit exceptions:
  • dom/xhtml/level2/html/HTMLDocument17-expected.txt:
  • dom/xhtml/level2/html/HTMLDocument18-expected.txt:
  • dom/xhtml/level2/html/HTMLDocument19-expected.txt:
  • dom/xhtml/level2/html/HTMLDocument20-expected.txt:
  • dom/xhtml/level2/html/HTMLDocument21-expected.txt:
  • dom/xhtml/level2/html/selfxhtml.js:
11:05 PM Changeset in webkit [33351] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

Partial fix for current performance regressions.

Patch from Cameron Zwarich
Reviewed by Oliver

Fix a performance regression caused by the introduction of property
attributes to SymbolTable in r32859 by encoding the attributes and the
register index into a single field of SymbolTableEntry.

This leaves Node::optimizeVariableAccess() definitely broken, although
it was probably not entirely correct in SquirrelFish before this change.

11:05 PM Changeset in webkit [33350] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-06 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Oliver.

  • add missing ! in an assert that I failed to reverse
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::CodeGenerator):
11:05 PM Changeset in webkit [33349] by mrowe@apple.com
  • 282 edits in branches/squirrelfish/LayoutTests

2008-05-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

To facilitate merging between the squirrelfish branch and trunk, I
edited a bunch of layout tests to make sure their results don't depend
on the exact text of an exception message generated by the JavaScript engine.

(We do want to test JavaScript exception messages -- we just don't want
to test them 300 times over, in tests that aren't supposed to be about
JavaScript at all.)

  • I fixed bugs that were causing these tests to throw exceptions by accident, and updated results to reflect correct behavior:
  • editing/selection/contenteditable-click-inside.html:
  • platform/mac/editing/selection/contenteditable-click-inside-expected.checksum:
  • platform/mac/editing/selection/contenteditable-click-inside-expected.png:
  • platform/mac/editing/selection/contenteditable-click-inside-expected.txt:
  • editing/selection/contenteditable-click-outside.html:
  • platform/mac/editing/selection/contenteditable-click-outside-expected.checksum:
  • platform/mac/editing/selection/contenteditable-click-outside-expected.png:
  • platform/mac/editing/selection/contenteditable-click-outside-expected.txt:
  • fast/forms/selected-index-assert.html:
  • fast/forms/selected-index-assert-expected.txt:
  • tables/mozilla_expected_failures/core/captions1.html:
  • platform/mac/tables/mozilla_expected_failures/core/captions1-expected.txt:
  • I changed these tests to explicitly throw/report exceptions, so their results don't depend on how the engine constructs messages for implicit exceptions:
  • fast/xpath/nsresolver-exception.xhtml:
  • fast/xpath/nsresolver-exception-expected.txt:
  • platform/mac/fast/AppleScript/001.html:
  • platform/mac/fast/AppleScript/001-expected.txt:
  • dom/xhtml/level3/core/selfxhtml.js
  • dom/xhtml/level3/core/*expected.txt (about 280 of these changed)
11:04 PM Changeset in webkit [33348] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-05-06 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

The basic approach is to have "this" only be present in the symbol
table at compile time, not runtime.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::~CodeGenerator): Remove "this" from symbol table. (KJS::CodeGenerator::CodeGenerator): Add "this" back when re-using a symbol table.
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::execute): Don't assert that "this" is in the symbol table.
11:04 PM Changeset in webkit [33347] by mrowe@apple.com
  • 12 edits in branches/squirrelfish/WebCore

Bug 18866: SQUIRRELFISH: JS/ObjC bridge is broken <https://bugs.webkit.org/show_bug.cgi?id=18866>
Bug 18867: SQUIRRELFISH: JS/NPRuntime bridge is broken <https://bugs.webkit.org/show_bug.cgi?id=18867>

Reviewed by Maciej

This fixes function binding logic for the ObjC and NPRuntime by
replacing incorrect implementations of implementsCall (which is
no longer virtual) with implementations of getCallData.

11:04 PM Changeset in webkit [33346] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-05-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Trivial support for function.arguments: Currently, we only support
function.arguments from within the scope of function.

This fixes the remaining Mozilla JS test failures.

SunSpider reports no change.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Separated scope chain deref from activation register copying: since it is now possible for client code to create an activation on behalf of a function that otherwise wouldn't need one, having an activation no longer necessarily means that you need to deref the scope chain.

(KJS::Machine::getCallFrame): For now, this function only examines the
current scope. Walking parent scopes requires some refactoring in the
way we track execution stacks.

  • kjs/ExecState.cpp: (KJS::ExecState::ExecState): We use a negative call frame offset to indicate that a given scope is not a function call scope.
11:04 PM Changeset in webkit [33345] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Fix call frame set up for native -> JS function calls.

Review by Geoff

11:04 PM Changeset in webkit [33344] by mrowe@apple.com
  • 8 edits
    2 adds in branches/squirrelfish

JavaScriptCore:

2008-05-05 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed ecma_3/Object/8.6.2.6-001.js, and similar bugs.

SunSpider reports a .4% speedup. Not sure what that's about.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Check for exception return from equal, since toPrimitive can throw.
  • kjs/operations.cpp: (KJS::strictEqual): In response to an error I made in an earlier version of this patch, I changed strictEqual to make clear the fact that it performs no conversions and can't throw, making it slightly more efficient in the process.

LayoutTests:

2008-05-05 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Layout test for exceptions thrown from equality comparisons.

  • fast/js/exception-thrown-from-equal-expected.txt: Added.
  • fast/js/exception-thrown-from-equal.html: Added.
11:04 PM Changeset in webkit [33343] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-05-05 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix some dumb mistakes in my last patch
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitPushScope): (KJS::CodeGenerator::emitGetPropertyNames):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:04 PM Changeset in webkit [33342] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-05-05 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • document opcodes relating to jumps, scopes, and property name iteration

Documented jmp, jtrue, false, push_scope, pop_scope, get_pnames,
next_pname and jmp_scopes.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitJump): (KJS::CodeGenerator::emitJumpIfTrue): (KJS::CodeGenerator::emitJumpIfFalse): (KJS::CodeGenerator::emitPushScope): (KJS::CodeGenerator::emitNextPropertyName): (KJS::CodeGenerator::emitGetPropertyNames):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/nodes.cpp: (KJS::LogicalAndNode::emitCode): (KJS::LogicalOrNode::emitCode): (KJS::ConditionalNode::emitCode): (KJS::IfNode::emitCode): (KJS::IfElseNode::emitCode): (KJS::DoWhileNode::emitCode): (KJS::WhileNode::emitCode): (KJS::ForNode::emitCode): (KJS::ForInNode::emitCode): (KJS::WithNode::emitCode):
11:04 PM Changeset in webkit [33341] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

Bug 18749: SQUIRRELFISH: const support is broken
<https://bugs.webkit.org/show_bug.cgi?id=18749>

Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver.

Adds support for const during code generation.

Fixes 2 layout tests.

11:04 PM Changeset in webkit [33340] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-05-04 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • document some more opcodes (and fix argument names)

Added docs for eq, neq, stricteq, nstriceq, less and lesseq.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitEqual): (KJS::CodeGenerator::emitNotEqual): (KJS::CodeGenerator::emitStrictEqual): (KJS::CodeGenerator::emitNotStrictEqual): (KJS::CodeGenerator::emitLess): (KJS::CodeGenerator::emitLessEq):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/nodes.cpp: (KJS::LessNode::emitCode): (KJS::GreaterNode::emitCode): (KJS::LessEqNode::emitCode): (KJS::GreaterEqNode::emitCode): (KJS::EqualNode::emitCode): (KJS::NotEqualNode::emitCode): (KJS::StrictEqualNode::emitCode): (KJS::NotStrictEqualNode::emitCode): (KJS::CaseBlockNode::emitCodeForBlock):
11:04 PM Changeset in webkit [33339] by mrowe@apple.com
  • 10 edits in branches/squirrelfish/JavaScriptCore

2008-05-04 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

More scaffolding for f.arguments.

Track the offset of the last call frame in the ExecState, so we can
produce a backtrace at any time.

Also, record numLocals, the sum of numVars + numParameters, in each code
block, to make updates to the ExecState a little cheaper than they
would be otherwise.

We now use numLocals in a bunch of places where we used to calculate
numVars + numParameters or -numVars - numParameters.

Reports are mixed, but all in all, this seems to be a wash on SunSpider.

11:04 PM Changeset in webkit [33338] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Whoops, correctly handle properties that don't exist in the
symbol table.

Reviewed by Geoff

11:03 PM Changeset in webkit [33337] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Add attribute information to SymbolTable as ground work for
various DontEnum and ReadOnly issues.

Reviewed by Geoff

11:03 PM Changeset in webkit [33336] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-05-04 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

More scaffolding for f.arguments.

Store the register file associated with an ExecState in the ExecState.

SunSpider reports no change.

  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Moved registerFileStack above globalExec, so it gets initialized first. Removed remnants of old activation scheme.
11:03 PM Changeset in webkit [33335] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-05-04 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Oliver.

  • renamed a few opcodes and fixed assembly formatting to accomodate the longest opcode

equal --> eq
nequal --> neq
resolve_base_and_property --> resolve_with_base
resolve_base_and_func --> resolve_func
get_prop_id --> get_by_id
put_prop_id --> put_by_id
delete_prop_id --> del_by_id
get_prop_val --> get_by_val
put_prop_val --> put_by_val
delete_prop_val --> del_by_val
put_prop_index --> put_by_index

  • VM/CodeBlock.cpp: (KJS::printUnaryOp): (KJS::printBinaryOp): (KJS::printConditionalJump): (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitEqual): (KJS::CodeGenerator::emitNotEqual): (KJS::CodeGenerator::emitResolveWithBase): (KJS::CodeGenerator::emitResolveFunction): (KJS::CodeGenerator::emitGetById): (KJS::CodeGenerator::emitPutById): (KJS::CodeGenerator::emitDeleteById): (KJS::CodeGenerator::emitGetByVal): (KJS::CodeGenerator::emitPutByVal): (KJS::CodeGenerator::emitDeleteByVal): (KJS::CodeGenerator::emitPutByIndex):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::ArrayNode::emitCode): (KJS::PropertyListNode::emitCode): (KJS::BracketAccessorNode::emitCode): (KJS::DotAccessorNode::emitCode): (KJS::EvalFunctionCallNode::emitCode): (KJS::FunctionCallResolveNode::emitCode): (KJS::FunctionCallBracketNode::emitCode): (KJS::FunctionCallDotNode::emitCode): (KJS::PostIncResolveNode::emitCode): (KJS::PostDecResolveNode::emitCode): (KJS::PostIncBracketNode::emitCode): (KJS::PostDecBracketNode::emitCode): (KJS::PostIncDotNode::emitCode): (KJS::PostDecDotNode::emitCode): (KJS::DeleteResolveNode::emitCode): (KJS::DeleteBracketNode::emitCode): (KJS::DeleteDotNode::emitCode): (KJS::TypeOfResolveNode::emitCode): (KJS::PreIncResolveNode::emitCode): (KJS::PreDecResolveNode::emitCode): (KJS::PreIncBracketNode::emitCode): (KJS::PreDecBracketNode::emitCode): (KJS::PreIncDotNode::emitCode): (KJS::PreDecDotNode::emitCode): (KJS::ReadModifyResolveNode::emitCode): (KJS::AssignResolveNode::emitCode): (KJS::AssignDotNode::emitCode): (KJS::ReadModifyDotNode::emitCode): (KJS::AssignBracketNode::emitCode): (KJS::ReadModifyBracketNode::emitCode): (KJS::ConstDeclNode::emitCodeSingle): (KJS::ForInNode::emitCode): (KJS::TryNode::emitCode):
11:03 PM Changeset in webkit [33334] by mrowe@apple.com
  • 3 edits
    3 adds in branches/squirrelfish

Fix assertion when accessing arguments object with too many arguments provided

Reviewed by Maciej

The arguments constructor was assuming that the register offset given for argv
was an absolute offset into the registerfile, rather than the offset from the
frame. This patches corrects that issue.

11:03 PM Changeset in webkit [33333] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-04 Geoffrey Garen <ggaren@apple.com>

Rubber stamped by Sam Weinig.

Cleaned up Machine.cpp according to our style guidelines: moved static
data to the top of the file; moved stand-alone functions below that;
moved the Machine constructor above other Machine member functions.

11:03 PM Changeset in webkit [33332] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-03 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • fix accidental breakage from last patch
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:03 PM Changeset in webkit [33331] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-05-03 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • a bunch more opcode documentation and corresponding parameter name fixes

I renamed a few opcodes:

type_of --> typeof (that's what the JS operator is named)
instance_of --> instanceof (ditto)
create_error --> new_error (for consistency with other new_* opcodes)

I documented the following opcodes:

  • load
  • new_object
  • new_array
  • new_regexp
  • mov
  • pre_inc
  • pre_dec
  • post_inc
  • post_dec
  • to_jsnumber
  • negate
  • bitnot
  • not
  • instanceof
  • typeof
  • in
  • new_func
  • new_funcexp
  • new_error

I also fixed formatting on some existing opcode docs.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitMove): (KJS::CodeGenerator::emitNot): (KJS::CodeGenerator::emitPreInc): (KJS::CodeGenerator::emitPreDec): (KJS::CodeGenerator::emitPostInc): (KJS::CodeGenerator::emitPostDec): (KJS::CodeGenerator::emitToJSNumber): (KJS::CodeGenerator::emitNegate): (KJS::CodeGenerator::emitBitNot): (KJS::CodeGenerator::emitInstanceOf): (KJS::CodeGenerator::emitTypeOf): (KJS::CodeGenerator::emitIn): (KJS::CodeGenerator::emitLoad): (KJS::CodeGenerator::emitNewObject): (KJS::CodeGenerator::emitNewArray): (KJS::CodeGenerator::emitNewRegExp): (KJS::CodeGenerator::emitNewError):
  • VM/CodeGenerator.h: (KJS::CodeGenerator::scopeDepth): (KJS::CodeGenerator::addVar):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::Node::emitThrowError): (KJS::RegExpNode::emitCode): (KJS::TypeOfValueNode::emitCode): (KJS::UnaryPlusNode::emitCode): (KJS::NegateNode::emitCode): (KJS::BitwiseNotNode::emitCode): (KJS::LogicalNotNode::emitCode): (KJS::InstanceOfNode::emitCode): (KJS::InNode::emitCode):
11:03 PM Changeset in webkit [33330] by mrowe@apple.com
  • 2 edits
    2 adds in branches/squirrelfish/JavaScriptCore

2008-05-03 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff and Sam.

  • generate HTML bytecode docs at build time
  • DerivedSources.make:
  • docs: Added.
  • docs/make-bytecode-docs.pl: Added.
11:03 PM Changeset in webkit [33329] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-05-03 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Update ExecState::m_scopeChain when switching scope chains inside the
machine.

This fixes uses of lexicalGlobalObject, such as, in a subframe

alert(top.makeArray() instanceof Array ? "FAIL" : "PASS");

and a bunch of the security failures listed in
https://bugs.webkit.org/show_bug.cgi?id=18870. (Those tests still fail,
seemingly because of regressions in exception messages).

SunSpider reports no change.

  • VM/Machine.cpp: Factored out scope chain updating into a common function that takes care to update ExecState::m_scopeChain, too.
  • kjs/ExecState.h: I made Machine a friend of ExecState so that Machine could update ExecState::m_scopeChain, even though that value is read-only for everyone else.
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Changed this client to be a little friendlier to ExecState's internal storage type for scope chain data.
11:03 PM Changeset in webkit [33328] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-03 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Fixed https://bugs.webkit.org/show_bug.cgi?id=18876
Squirrelfish: ScopeChainNode leak in op_jmp_scopes.

SunSpider reports no change.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Don't construct a ScopeChain object, since the direct threaded interpreter will goto across its destructor.
11:03 PM Changeset in webkit [33327] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-05-03 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

A bit more efficient fix than r32832: Don't copy globals into function
register files; instead, have the RegisterFileStack track only the base
of the last *global* register file, so the global object's register
references stay good.

SunSpider reports a .3% speedup. Not sure what that's about.

11:03 PM Changeset in webkit [33326] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

Bug 18864: SquirrelFish: Support getter and setter definition in object literals
<https://bugs.webkit.org/show_bug.cgi?id=18864>

Reviewed by Maciej

Add new opcodes to allow us to add getters and setters to an object. These are
only used by the codegen for object literals.

11:03 PM Changeset in webkit [33325] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-02 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • properly copy globals into and out of implicit call register files, otherwise they will fail at global lookup

Fixes fast/js/array-tostring-and-join.html layout test.

  • VM/RegisterFileStack.cpp: (KJS::RegisterFileStack::pushGlobalRegisterFile): (KJS::RegisterFileStack::popGlobalRegisterFile): (KJS::RegisterFileStack::pushFunctionRegisterFile): (KJS::RegisterFileStack::popFunctionRegisterFile):
11:03 PM Changeset in webkit [33324] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-05-02 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed https://bugs.webkit.org/show_bug.cgi?id=18822
SQUIRRELFISH: incorrect eval used in some cases

Changed all code inside the machine to fetch the lexical global object
directly from the scope chain, instead of from the ExecState.

Clients who fetch the lexical global object through the ExecState
still don't work.

SunSpider reports no change.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Fetch the lexical global object from the scope chain.
  • kjs/ExecState.h: (KJS::ExecState::ExecState::lexicalGlobalObject): Moved the logic for this function into ScopeChainNode, but kept this function around to support existing clients.
11:03 PM Changeset in webkit [33323] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-05-02 Geoffrey Garen <ggaren@apple.com>

Rubber stamped by Oliver Hunt.

Removed ExecState.cpp from AllInOneFile.cpp, for a .2% speedup.

11:03 PM Changeset in webkit [33322] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/LayoutTests

2008-05-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • bump up the numbers in this test to account for our now much higher recursion capability.
  • fast/js/deep-recursion-test.html:
11:03 PM Changeset in webkit [33321] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
<https://bugs.webkit.org/show_bug.cgi?id=18827>

Reviewed by Maciej and Geoff

Remove safe/unsafe RegisterFile concept, and instead just add additional
logic to ensure we always push/pop RegisterFiles when executing getters
and setters, similar to the logic for valueOf and toString.

11:03 PM Changeset in webkit [33320] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

Rename unsafeForReentry to safeForReentry to avoid double negatives.

RS=Geoff

11:03 PM Changeset in webkit [33319] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

Bug 18827: SquirrelFish: Prevent getters and setters from destroying the current RegisterFile
<https://bugs.webkit.org/show_bug.cgi?id=18827>

Reviewed by Maciej

This patch makes getters and setters work. It does this by
tracking whether the RegisterFile is "safe", that is whether
the interpreter is in a state that in which it can handle
the RegisterFile being reallocated.

11:03 PM Changeset in webkit [33318] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Release build fix: Always compile in "isGlobalObject", since it's
listed in our .exp file.

  • kjs/ExecState.cpp: (KJS::ExecState::isGlobalObject):
  • kjs/ExecState.h:
11:03 PM Changeset in webkit [33317] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Minor code restructuring to prepare for getters and setters,
also helps exception semantics a bit.

Reviewed by Maciej

11:03 PM Changeset in webkit [33316] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Fixed tyop.

  • kjs/ExecState.h:
11:02 PM Changeset in webkit [33315] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Debug build fix: export a missing symbol.

11:02 PM Changeset in webkit [33314] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

A little more ExecState refactoring: Now, only the global object creates
an ExecState.

Also inlined ExecState::lexicalGlobalObject().

SunSpider reports no change.

11:02 PM Changeset in webkit [33313] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/WebKit/mac

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Build fix: #ifdef'd out some code that doesn't work anymore.

11:02 PM Changeset in webkit [33312] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/WebCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Build fix: supply a parameter that used to be implicit to
Interpreter::evaluate.

11:02 PM Changeset in webkit [33311] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

WebCore build fix: forward-declare ScopeChain.

  • kjs/interpreter.h:
11:02 PM Changeset in webkit [33310] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/WebCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Build fix: #ifdef'd out some code that doesn't work anymore.

  • bindings/objc/WebScriptObject.mm: (+[WebScriptObject throwException:]): (-[WebScriptObject setException:]):
11:02 PM Changeset in webkit [33309] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptGlue

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Build fix: supply missing parameter that used to be implicit.

  • JSRun.cpp: (JSRun::Evaluate):
11:02 PM Changeset in webkit [33308] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Build fix for JavaScriptGlue: export a missing symbol.

11:02 PM Changeset in webkit [33307] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/WebKit/mac

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

#ifdef'd out some debugger code that doesn't work anymore.

  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]):
11:02 PM Changeset in webkit [33306] by mrowe@apple.com
  • 24 edits
    2 deletes in branches/squirrelfish/JavaScriptCore

2008-04-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Removed a lot of unused bits from ExecState, moving them into
OldInterpreterExecState, the fake scaffolding class.

The clutter was making it hard to see the forest from the trees.

.4% SunSpider speedup, probably because ExecState::lexicalGlobalObject()
is faster now.

11:02 PM Changeset in webkit [33305] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
<https://bugs.webkit.org/show_bug.cgi?id=18643>

Reviewed by Maciej

Prevent static slot optimisation for new variables and functions in
globally re-entrant code called from an an implicit function call.

This is necessary to prevent us from needing to resize the global
slot portion of the root RegisterFile during an implicit (and hence
unguarded) function call.

11:02 PM Changeset in webkit [33304] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-29 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

In nested program code, don't propogate "this" back to the parent
register file. ("this" should remain constant in the parent register
file, regardless of the scripts it invokes.)

  • VM/RegisterFile.cpp: (KJS::RegisterFile::copyGlobals):
11:02 PM Changeset in webkit [33303] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Restore base pointer when popping a global RegisterFile

Reviewed by Geoff

11:02 PM Changeset in webkit [33302] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

Bug 18643: SQUIRRELFISH: need to support implicit function calls (valueOf, toString, getters/setters)
<https://bugs.webkit.org/show_bug.cgi?id=18643>

Reviewed by Geoff

Partial fix. This results in all implicit calls to toString or valueOf
executing in a separate RegisterFile, so ensuring that the the pointers
in the triggering interpreter don't get trashed. This still leaves the
task of preventing new global re-entry from toString and valueOf from
clobbering the RegisterFile.

11:02 PM Changeset in webkit [33301] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-28 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Simplified activation object a bit: No need to store the callee
in the activation object -- we can pull it out of the call frame
when needed, instead.

SunSpider reports no change.

11:02 PM Changeset in webkit [33300] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-28 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

RS by Oliver Hunt on moving JSArguments.cpp out of AllInOneFile.cpp.

Substantially more handling of "arguments": "arguments" works fully
now, but "f.arguments" still doesn't work.

Fixes 10 regression tests.

SunSpider reports no regression.

  • kjs/JSActivation.cpp: (KJS::JSActivation::createArgumentsObject): Reconstruct an arguments List to pass to the arguments object constructor.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/AllInOneFile.cpp: Removed JSActivation.cpp from AllInOneFile.cpp because that seems to make GCC happy. (Previously, I had added JSActivation.cpp to AllInOneFile.cpp because *that* seemed to make GCC happy. So it goes.)
11:02 PM Changeset in webkit [33299] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-28 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Groundwork for more handling of "arguments". I'm not checking in the
actual handling of "arguments" yet, because it still needs a little
fiddling to avoid a performance regression.

SunSpider reports no change.

  • VM/Machine.cpp: (KJS::initializeCallFrame): Put argc in the register file, so the arguments object can find it later, to determine arguments.length.
  • kjs/nodes.h: (KJS::FunctionBodyNode::): Added a special code accessor for when you know the code has already been generated, and you don't have a scopeChain to supply for potential code generation. (This is the case when the activation object creates the arguments object.)
11:02 PM Changeset in webkit [33298] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

Replace unsafe use of auto_ptr in Vector with manual memory
management.

Reviewed by Geoff

11:02 PM Changeset in webkit [33297] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-27 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Bug 18746: SQUIRRELFISH: indirect eval used when direct eval should be used
<https://bugs.webkit.org/show_bug.cgi?id=18746>

Change the base to the correct value of the 'this' object after the direct
eval test instead of before.

Fixes 5 layout tests.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/nodes.cpp: (KJS::EvalFunctionCallNode::emitCode):
11:02 PM Changeset in webkit [33296] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-26 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • document all property getting, setting and deleting opcodes

(And fix function parameter names to match corresponding opcode parameter names.)

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitResolve): (KJS::CodeGenerator::emitResolveBase): (KJS::CodeGenerator::emitResolveBaseAndProperty): (KJS::CodeGenerator::emitResolveBaseAndFunc): (KJS::CodeGenerator::emitGetPropId): (KJS::CodeGenerator::emitPutPropId): (KJS::CodeGenerator::emitDeletePropId): (KJS::CodeGenerator::emitPutPropVal):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::resolve): (KJS::resolveBase): (KJS::resolveBaseAndProperty): (KJS::resolveBaseAndFunc): (KJS::Machine::privateExecute):
  • kjs/nodes.cpp: (KJS::ResolveNode::emitCode): (KJS::ArrayNode::emitCode): (KJS::PropertyListNode::emitCode): (KJS::BracketAccessorNode::emitCode): (KJS::EvalFunctionCallNode::emitCode): (KJS::FunctionCallResolveNode::emitCode): (KJS::FunctionCallBracketNode::emitCode): (KJS::PostIncResolveNode::emitCode): (KJS::PostDecResolveNode::emitCode): (KJS::PostIncBracketNode::emitCode): (KJS::PostDecBracketNode::emitCode): (KJS::PostIncDotNode::emitCode): (KJS::PostDecDotNode::emitCode): (KJS::DeleteResolveNode::emitCode): (KJS::TypeOfResolveNode::emitCode): (KJS::PreIncResolveNode::emitCode): (KJS::PreDecResolveNode::emitCode): (KJS::PreIncBracketNode::emitCode): (KJS::PreDecBracketNode::emitCode): (KJS::AssignResolveNode::emitCode): (KJS::AssignDotNode::emitCode): (KJS::ReadModifyDotNode::emitCode): (KJS::AssignBracketNode::emitCode): (KJS::ReadModifyBracketNode::emitCode): (KJS::ConstDeclNode::emitCodeSingle):
11:01 PM Changeset in webkit [33295] by mrowe@apple.com
  • 9 edits
    2 adds in branches/squirrelfish

Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>

Reviewed by Maciej.

Basically completes recursion limiting. There is still some
tuning we may want to do to make things better in the face of
very bad code, but certainly nothing worse than anything already
possible in trunk.

Also fixes a WebKit test by fixing the exception text :D

11:01 PM Changeset in webkit [33294] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fix the changelog

11:01 PM Changeset in webkit [33293] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

Bug 18736: SQUIRRELFISH: switch statements with no default have incorrect codegen
<https://bugs.webkit.org/show_bug.cgi?id=18736>

Reviewed by Geoff

Put a limit on the level of reentry recursion. 128 levels of re-entrant recursion
seems reasonable as it is greater than the old eval limit, and a long way short of
the reentry depth needed to overflow the stack.

11:01 PM Changeset in webkit [33292] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-25 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

A tiny bit of cleanup to the regexp code.

Removed some static_cast.

Removed createRegExpImp because it's no longer used.

11:01 PM Changeset in webkit [33291] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Bug 18736: SQUIRRELFISH: switch statements with no default have incorrect codegen
<https://bugs.webkit.org/show_bug.cgi?id=18736>

Reviewed by Maciej

Ensure the "default" target is correct in the absence of an explicit default handler.

11:01 PM Changeset in webkit [33290] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fixing the ChangeLog

11:01 PM Changeset in webkit [33289] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

Bug 18732: SQUIRRELFISH: exceptions thrown by native constructors are ignored
<https://bugs.webkit.org/show_bug.cgi?id=18732>

Reviewed by Maciej

More bounds checking.

11:01 PM Changeset in webkit [33288] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-25 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix signal catching magic

The signal handlers are restored to _exit but are only set when
running under run-javascriptcore-tests. fprintf from a signal
handler is not safe.

  • kjs/testkjs.cpp: (main): (parseArguments):
  • tests/mozilla/jsDriver.pl:
11:01 PM Changeset in webkit [33287] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Bug 18732: SQUIRRELFISH: exceptions thrown by native constructors are ignored
<https://bugs.webkit.org/show_bug.cgi?id=18732>

Fixes another regression test.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:01 PM Changeset in webkit [33286] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Bug 18728: SQUIRRELFISH: invalid regular expression constants should throw exceptions
<https://bugs.webkit.org/show_bug.cgi?id=18728>

Fixes another regression test.

  • kjs/nodes.cpp: (KJS::RegExpNode::emitCode):
11:01 PM Changeset in webkit [33285] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoffrey Garen.

Bug 18735: SQUIRRELFISH: closures are sometimes given an incorrect 'this' value when called
<https://bugs.webkit.org/show_bug.cgi?id=18735>

The overloaded toThisObject method was not copied over to JSActivation.

Fixes two regression tests.

  • kjs/JSActivation.cpp: (KJS::JSActivation::toThisObject):
  • kjs/JSActivation.h:
11:01 PM Changeset in webkit [33284] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Added support for arguments.callee.

11:01 PM Changeset in webkit [33283] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

Bug 18628: SQUIRRELFISH: need to support recursion limit
<https://bugs.webkit.org/show_bug.cgi?id=18628>

Reviewed by Maciej

Partial fix -- this gets us some of the required bounds checking, but not
complete coverage. But it does manage to do them without regressing :D

11:01 PM Changeset in webkit [33282] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fixed up ChangeLog

11:01 PM Changeset in webkit [33281] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Bug 18717: SQUIRRELFISH: eval returns the wrong value for a variable declaration statement
<https://bugs.webkit.org/show_bug.cgi?id=18717>

Fixes a regression test, but exposes the failure of another due to the
lack of getters and setters.

  • kjs/nodes.cpp: (KJS::ConstDeclNode::emitCodeSingle): (KJS::ConstDeclNode::emitCode): (KJS::ConstStatementNode::emitCode): (KJS::VarStatementNode::emitCode):
  • kjs/nodes.h:
11:01 PM Changeset in webkit [33280] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Bug 18717: SQUIRRELFISH: eval returns the wrong value for a variable declaration statement
<https://bugs.webkit.org/show_bug.cgi?id=18717>

Fixes a regression test, but exposes the failure of another due to the
lack of getters and setters.

11:01 PM Changeset in webkit [33279] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Print a CRASH statement when crashing, so test failures are not a
mystery.

  • kjs/testkjs.cpp: (handleCrash): (main):
11:01 PM Changeset in webkit [33278] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoffrey Garen.

Bug 18716: SQUIRRELFISH: typeof should return undefined for an undefined variable reference
<https://bugs.webkit.org/show_bug.cgi?id=18716>

This fixes 2 more regression tests.

  • kjs/nodes.cpp: (KJS::TypeOfResolveNode::emitCode):
11:01 PM Changeset in webkit [33277] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-24 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Put the callee in the call frame.

Necessary in order to support "arguments" and "arguments.callee".

Also fixes a latent GC bug, where an executing function could be
subject to GC if the register holding it were overwritten. Here's
an example that would have caused problems:

function f()
{

Flood the machine stack to eliminate any old pointers to f.
g.call({});

Overwrite f in the register file.
f = 1;

Force a GC.
for (var i = 0; i < 5000; ++i) {

({});

}

Welcome to crash-ville.

}

function g()
{
}

f();

  • VM/Machine.h: Changed the order of arguments to execute(FunctionBodyNode*...) to match the other execute functions.
  • kjs/function.cpp: Updated to match new argument requirements from execute(FunctionBodyNode*...). Renamed newObj to thisObj to match the rest of JavaScriptCore.

SunSpider reports no change.

11:01 PM Changeset in webkit [33276] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Bug 18707: SQUIRRELFISH: eval always performs toString() on its argument
<https://bugs.webkit.org/show_bug.cgi?id=18707>

This fixes 4 more regression tests.

  • VM/Machine.cpp: (KJS::eval):
11:01 PM Changeset in webkit [33275] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix logic bug in SegmentedVector::grow which would sometimes fail to resize a segment when needed

Fixes 3 JSC tests.

  • VM/SegmentedVector.h: (KJS::SegmentedVector::grow):
11:01 PM Changeset in webkit [33274] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Degenerate handling of "arguments" as a property of the activation
object. Currently, we just return a vanilla object.

SunSpider reports no change.

Fixes:

ecma_3/Function/regress-94506.js.

Reveals to have been secretly broken:

ecma_3/Function/15.3.4.3-1.js
ecma_3/Function/15.3.4.4-1.js

These tests were passing incorrectly. testkjs creates a global array
named "arguments" to hold command-line arguments. That array was
tricking these tests into thinking that an arguments object with length
0 had been created. Since our new vanilla object shadows the global
property named arguments, that object no longer fools these tests into
passing.

Net change: +1 failing test.

  • kjs/AllInOneFile.cpp: Had to put JSActivation.cpp into AllInOneFile.cpp to solve a surprising 8.6% regression in bitops-3bit-bits-in-byte.
11:01 PM Changeset in webkit [33273] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • save and restore callFrame
  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • kjs/testkjs.cpp: (main):
11:00 PM Changeset in webkit [33272] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed scopes for named function expressions.

Fixes one regression test.

Two changes here:

(1) The function's name is supposed to have attributes DontDelete,
ReadOnly, regardless of the type of code executing.

(2) Push the name object on the function's scope chain, rather than
the ExecState's scope chain because, well, that's where it belongs.

11:00 PM Changeset in webkit [33271] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Inlined JSObject::putDirect, for a .4% SunSpider speedup.

I did this as a first step toward removing nodes.cpp from
AllInOneFile.cpp, but I'm putting that larger project aside for now.

11:00 PM Changeset in webkit [33270] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Geoff.

  • add OldInterpreterExecState class and use it in dead code

This will allow removing things from the real ExecState class
without having to figure out how to remove all this code without
getting a perf regression.

  • kjs/nodes.cpp: (KJS::ExpressionNode::evaluateToNumber): (KJS::ExpressionNode::evaluateToBoolean): (KJS::ExpressionNode::evaluateToInt32): (KJS::ExpressionNode::evaluateToUInt32): (KJS::Node::setErrorCompletion): (KJS::Node::throwError): (KJS::Node::throwUndefinedVariableError): (KJS::Node::handleException): (KJS::Node::rethrowException): (KJS::BreakpointCheckStatement::execute): (KJS::BreakpointCheckStatement::optimizeVariableAccess): (KJS::NullNode::evaluate): (KJS::FalseNode::evaluate): (KJS::TrueNode::evaluate): (KJS::NumberNode::evaluate): (KJS::NumberNode::evaluateToNumber): (KJS::NumberNode::evaluateToBoolean): (KJS::NumberNode::evaluateToInt32): (KJS::NumberNode::evaluateToUInt32): (KJS::ImmediateNumberNode::evaluate): (KJS::ImmediateNumberNode::evaluateToInt32): (KJS::ImmediateNumberNode::evaluateToUInt32): (KJS::StringNode::evaluate): (KJS::StringNode::evaluateToNumber): (KJS::StringNode::evaluateToBoolean): (KJS::RegExpNode::evaluate): (KJS::ThisNode::evaluate): (KJS::ResolveNode::inlineEvaluate): (KJS::ResolveNode::evaluate): (KJS::ResolveNode::evaluateToNumber): (KJS::ResolveNode::evaluateToBoolean): (KJS::ResolveNode::evaluateToInt32): (KJS::ResolveNode::evaluateToUInt32): (KJS::getSymbolTableEntry): (KJS::ResolveNode::optimizeVariableAccess): (KJS::LocalVarAccessNode::inlineEvaluate): (KJS::LocalVarAccessNode::evaluate): (KJS::LocalVarAccessNode::evaluateToNumber): (KJS::LocalVarAccessNode::evaluateToBoolean): (KJS::LocalVarAccessNode::evaluateToInt32): (KJS::LocalVarAccessNode::evaluateToUInt32): (KJS::getNonLocalSymbol): (KJS::ScopedVarAccessNode::inlineEvaluate): (KJS::ScopedVarAccessNode::evaluate): (KJS::ScopedVarAccessNode::evaluateToNumber): (KJS::ScopedVarAccessNode::evaluateToBoolean): (KJS::ScopedVarAccessNode::evaluateToInt32): (KJS::ScopedVarAccessNode::evaluateToUInt32): (KJS::NonLocalVarAccessNode::inlineEvaluate): (KJS::NonLocalVarAccessNode::evaluate): (KJS::NonLocalVarAccessNode::evaluateToNumber): (KJS::NonLocalVarAccessNode::evaluateToBoolean): (KJS::NonLocalVarAccessNode::evaluateToInt32): (KJS::NonLocalVarAccessNode::evaluateToUInt32): (KJS::ElementNode::optimizeVariableAccess): (KJS::ElementNode::evaluate): (KJS::ArrayNode::optimizeVariableAccess): (KJS::ArrayNode::evaluate): (KJS::ObjectLiteralNode::optimizeVariableAccess): (KJS::ObjectLiteralNode::evaluate): (KJS::PropertyListNode::optimizeVariableAccess): (KJS::PropertyListNode::evaluate): (KJS::PropertyNode::optimizeVariableAccess): (KJS::PropertyNode::evaluate): (KJS::BracketAccessorNode::optimizeVariableAccess): (KJS::BracketAccessorNode::inlineEvaluate): (KJS::BracketAccessorNode::evaluate): (KJS::BracketAccessorNode::evaluateToNumber): (KJS::BracketAccessorNode::evaluateToBoolean): (KJS::BracketAccessorNode::evaluateToInt32): (KJS::BracketAccessorNode::evaluateToUInt32): (KJS::DotAccessorNode::optimizeVariableAccess): (KJS::DotAccessorNode::inlineEvaluate): (KJS::DotAccessorNode::evaluate): (KJS::DotAccessorNode::evaluateToNumber): (KJS::DotAccessorNode::evaluateToBoolean): (KJS::DotAccessorNode::evaluateToInt32): (KJS::DotAccessorNode::evaluateToUInt32): (KJS::ArgumentListNode::optimizeVariableAccess): (KJS::ArgumentListNode::evaluateList): (KJS::ArgumentsNode::optimizeVariableAccess): (KJS::NewExprNode::optimizeVariableAccess): (KJS::NewExprNode::inlineEvaluate): (KJS::NewExprNode::evaluate): (KJS::NewExprNode::evaluateToNumber): (KJS::NewExprNode::evaluateToBoolean): (KJS::NewExprNode::evaluateToInt32): (KJS::NewExprNode::evaluateToUInt32): (KJS::ExpressionNode::resolveAndCall): (KJS::EvalFunctionCallNode::optimizeVariableAccess): (KJS::EvalFunctionCallNode::evaluate): (KJS::FunctionCallValueNode::optimizeVariableAccess): (KJS::FunctionCallValueNode::evaluate): (KJS::FunctionCallResolveNode::optimizeVariableAccess): (KJS::FunctionCallResolveNode::inlineEvaluate): (KJS::FunctionCallResolveNode::evaluate): (KJS::FunctionCallResolveNode::evaluateToNumber): (KJS::FunctionCallResolveNode::evaluateToBoolean): (KJS::FunctionCallResolveNode::evaluateToInt32): (KJS::FunctionCallResolveNode::evaluateToUInt32): (KJS::LocalVarFunctionCallNode::inlineEvaluate): (KJS::LocalVarFunctionCallNode::evaluate): (KJS::LocalVarFunctionCallNode::evaluateToNumber): (KJS::LocalVarFunctionCallNode::evaluateToBoolean): (KJS::LocalVarFunctionCallNode::evaluateToInt32): (KJS::LocalVarFunctionCallNode::evaluateToUInt32): (KJS::ScopedVarFunctionCallNode::inlineEvaluate): (KJS::ScopedVarFunctionCallNode::evaluate): (KJS::ScopedVarFunctionCallNode::evaluateToNumber): (KJS::ScopedVarFunctionCallNode::evaluateToBoolean): (KJS::ScopedVarFunctionCallNode::evaluateToInt32): (KJS::ScopedVarFunctionCallNode::evaluateToUInt32): (KJS::NonLocalVarFunctionCallNode::inlineEvaluate): (KJS::NonLocalVarFunctionCallNode::evaluate): (KJS::NonLocalVarFunctionCallNode::evaluateToNumber): (KJS::NonLocalVarFunctionCallNode::evaluateToBoolean): (KJS::NonLocalVarFunctionCallNode::evaluateToInt32): (KJS::NonLocalVarFunctionCallNode::evaluateToUInt32): (KJS::FunctionCallBracketNode::optimizeVariableAccess): (KJS::FunctionCallBracketNode::evaluate): (KJS::FunctionCallDotNode::optimizeVariableAccess): (KJS::FunctionCallDotNode::inlineEvaluate): (KJS::FunctionCallDotNode::evaluate): (KJS::FunctionCallDotNode::evaluateToNumber): (KJS::FunctionCallDotNode::evaluateToBoolean): (KJS::FunctionCallDotNode::evaluateToInt32): (KJS::FunctionCallDotNode::evaluateToUInt32): (KJS::PostIncResolveNode::optimizeVariableAccess): (KJS::PostIncResolveNode::evaluate): (KJS::PostIncLocalVarNode::evaluate): (KJS::PostDecResolveNode::optimizeVariableAccess): (KJS::PostDecResolveNode::evaluate): (KJS::PostDecLocalVarNode::evaluate): (KJS::PostDecLocalVarNode::inlineEvaluateToNumber): (KJS::PostDecLocalVarNode::evaluateToNumber): (KJS::PostDecLocalVarNode::evaluateToBoolean): (KJS::PostDecLocalVarNode::evaluateToInt32): (KJS::PostDecLocalVarNode::evaluateToUInt32): (KJS::PostfixBracketNode::optimizeVariableAccess): (KJS::PostIncBracketNode::evaluate): (KJS::PostDecBracketNode::evaluate): (KJS::PostfixDotNode::optimizeVariableAccess): (KJS::PostIncDotNode::evaluate): (KJS::PostDecDotNode::evaluate): (KJS::PostfixErrorNode::evaluate): (KJS::DeleteResolveNode::optimizeVariableAccess): (KJS::DeleteResolveNode::evaluate): (KJS::LocalVarDeleteNode::evaluate): (KJS::DeleteBracketNode::optimizeVariableAccess): (KJS::DeleteBracketNode::evaluate): (KJS::DeleteDotNode::optimizeVariableAccess): (KJS::DeleteDotNode::evaluate): (KJS::DeleteValueNode::optimizeVariableAccess): (KJS::DeleteValueNode::evaluate): (KJS::VoidNode::optimizeVariableAccess): (KJS::VoidNode::evaluate): (KJS::TypeOfValueNode::optimizeVariableAccess): (KJS::TypeOfResolveNode::optimizeVariableAccess): (KJS::LocalVarTypeOfNode::evaluate): (KJS::TypeOfResolveNode::evaluate): (KJS::TypeOfValueNode::evaluate): (KJS::PreIncResolveNode::optimizeVariableAccess): (KJS::PreIncLocalVarNode::evaluate): (KJS::PreIncResolveNode::evaluate): (KJS::PreDecResolveNode::optimizeVariableAccess): (KJS::PreDecLocalVarNode::evaluate): (KJS::PreDecResolveNode::evaluate): (KJS::PreIncConstNode::evaluate): (KJS::PreDecConstNode::evaluate): (KJS::PostIncConstNode::evaluate): (KJS::PostDecConstNode::evaluate): (KJS::PrefixBracketNode::optimizeVariableAccess): (KJS::PreIncBracketNode::evaluate): (KJS::PreDecBracketNode::evaluate): (KJS::PrefixDotNode::optimizeVariableAccess): (KJS::PreIncDotNode::evaluate): (KJS::PreDecDotNode::evaluate): (KJS::PrefixErrorNode::evaluate): (KJS::UnaryPlusNode::optimizeVariableAccess): (KJS::UnaryPlusNode::evaluate): (KJS::UnaryPlusNode::evaluateToBoolean): (KJS::UnaryPlusNode::evaluateToNumber): (KJS::UnaryPlusNode::evaluateToInt32): (KJS::UnaryPlusNode::evaluateToUInt32): (KJS::NegateNode::optimizeVariableAccess): (KJS::NegateNode::evaluate): (KJS::NegateNode::evaluateToNumber): (KJS::BitwiseNotNode::optimizeVariableAccess): (KJS::BitwiseNotNode::inlineEvaluateToInt32): (KJS::BitwiseNotNode::evaluate): (KJS::BitwiseNotNode::evaluateToNumber): (KJS::BitwiseNotNode::evaluateToBoolean): (KJS::BitwiseNotNode::evaluateToInt32): (KJS::BitwiseNotNode::evaluateToUInt32): (KJS::LogicalNotNode::optimizeVariableAccess): (KJS::LogicalNotNode::evaluate): (KJS::LogicalNotNode::evaluateToBoolean): (KJS::MultNode::optimizeVariableAccess): (KJS::MultNode::inlineEvaluateToNumber): (KJS::MultNode::evaluate): (KJS::MultNode::evaluateToNumber): (KJS::MultNode::evaluateToBoolean): (KJS::MultNode::evaluateToInt32): (KJS::MultNode::evaluateToUInt32): (KJS::DivNode::optimizeVariableAccess): (KJS::DivNode::inlineEvaluateToNumber): (KJS::DivNode::evaluate): (KJS::DivNode::evaluateToNumber): (KJS::DivNode::evaluateToInt32): (KJS::DivNode::evaluateToUInt32): (KJS::ModNode::optimizeVariableAccess): (KJS::ModNode::inlineEvaluateToNumber): (KJS::ModNode::evaluate): (KJS::ModNode::evaluateToNumber): (KJS::ModNode::evaluateToBoolean): (KJS::ModNode::evaluateToInt32): (KJS::ModNode::evaluateToUInt32): (KJS::throwOutOfMemoryErrorToNumber): (KJS::addSlowCase): (KJS::addSlowCaseToNumber): (KJS::add): (KJS::addToNumber): (KJS::AddNode::optimizeVariableAccess): (KJS::AddNode::evaluate): (KJS::AddNode::inlineEvaluateToNumber): (KJS::AddNode::evaluateToNumber): (KJS::AddNode::evaluateToInt32): (KJS::AddNode::evaluateToUInt32): (KJS::AddNumbersNode::inlineEvaluateToNumber): (KJS::AddNumbersNode::evaluate): (KJS::AddNumbersNode::evaluateToNumber): (KJS::AddNumbersNode::evaluateToInt32): (KJS::AddNumbersNode::evaluateToUInt32): (KJS::AddStringsNode::evaluate): (KJS::AddStringLeftNode::evaluate): (KJS::AddStringRightNode::evaluate): (KJS::SubNode::optimizeVariableAccess): (KJS::SubNode::inlineEvaluateToNumber): (KJS::SubNode::evaluate): (KJS::SubNode::evaluateToNumber): (KJS::SubNode::evaluateToInt32): (KJS::SubNode::evaluateToUInt32): (KJS::LeftShiftNode::optimizeVariableAccess): (KJS::LeftShiftNode::inlineEvaluateToInt32): (KJS::LeftShiftNode::evaluate): (KJS::LeftShiftNode::evaluateToNumber): (KJS::LeftShiftNode::evaluateToInt32): (KJS::LeftShiftNode::evaluateToUInt32): (KJS::RightShiftNode::optimizeVariableAccess): (KJS::RightShiftNode::inlineEvaluateToInt32): (KJS::RightShiftNode::evaluate): (KJS::RightShiftNode::evaluateToNumber): (KJS::RightShiftNode::evaluateToInt32): (KJS::RightShiftNode::evaluateToUInt32): (KJS::UnsignedRightShiftNode::optimizeVariableAccess): (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32): (KJS::UnsignedRightShiftNode::evaluate): (KJS::UnsignedRightShiftNode::evaluateToNumber): (KJS::UnsignedRightShiftNode::evaluateToInt32): (KJS::UnsignedRightShiftNode::evaluateToUInt32): (KJS::lessThan): (KJS::lessThanEq): (KJS::LessNode::optimizeVariableAccess): (KJS::LessNode::inlineEvaluateToBoolean): (KJS::LessNode::evaluate): (KJS::LessNode::evaluateToBoolean): (KJS::LessNumbersNode::inlineEvaluateToBoolean): (KJS::LessNumbersNode::evaluate): (KJS::LessNumbersNode::evaluateToBoolean): (KJS::LessStringsNode::inlineEvaluateToBoolean): (KJS::LessStringsNode::evaluate): (KJS::LessStringsNode::evaluateToBoolean): (KJS::GreaterNode::optimizeVariableAccess): (KJS::GreaterNode::inlineEvaluateToBoolean): (KJS::GreaterNode::evaluate): (KJS::GreaterNode::evaluateToBoolean): (KJS::LessEqNode::optimizeVariableAccess): (KJS::LessEqNode::inlineEvaluateToBoolean): (KJS::LessEqNode::evaluate): (KJS::LessEqNode::evaluateToBoolean): (KJS::GreaterEqNode::optimizeVariableAccess): (KJS::GreaterEqNode::inlineEvaluateToBoolean): (KJS::GreaterEqNode::evaluate): (KJS::GreaterEqNode::evaluateToBoolean): (KJS::InstanceOfNode::optimizeVariableAccess): (KJS::InstanceOfNode::evaluate): (KJS::InstanceOfNode::evaluateToBoolean): (KJS::InNode::optimizeVariableAccess): (KJS::InNode::evaluate): (KJS::InNode::evaluateToBoolean): (KJS::EqualNode::optimizeVariableAccess): (KJS::EqualNode::inlineEvaluateToBoolean): (KJS::EqualNode::evaluate): (KJS::EqualNode::evaluateToBoolean): (KJS::NotEqualNode::optimizeVariableAccess): (KJS::NotEqualNode::inlineEvaluateToBoolean): (KJS::NotEqualNode::evaluate): (KJS::NotEqualNode::evaluateToBoolean): (KJS::StrictEqualNode::optimizeVariableAccess): (KJS::StrictEqualNode::inlineEvaluateToBoolean): (KJS::StrictEqualNode::evaluate): (KJS::StrictEqualNode::evaluateToBoolean): (KJS::NotStrictEqualNode::optimizeVariableAccess): (KJS::NotStrictEqualNode::inlineEvaluateToBoolean): (KJS::NotStrictEqualNode::evaluate): (KJS::NotStrictEqualNode::evaluateToBoolean): (KJS::BitAndNode::optimizeVariableAccess): (KJS::BitAndNode::evaluate): (KJS::BitAndNode::inlineEvaluateToInt32): (KJS::BitAndNode::evaluateToNumber): (KJS::BitAndNode::evaluateToBoolean): (KJS::BitAndNode::evaluateToInt32): (KJS::BitAndNode::evaluateToUInt32): (KJS::BitXOrNode::optimizeVariableAccess): (KJS::BitXOrNode::inlineEvaluateToInt32): (KJS::BitXOrNode::evaluate): (KJS::BitXOrNode::evaluateToNumber): (KJS::BitXOrNode::evaluateToBoolean): (KJS::BitXOrNode::evaluateToInt32): (KJS::BitXOrNode::evaluateToUInt32): (KJS::BitOrNode::optimizeVariableAccess): (KJS::BitOrNode::inlineEvaluateToInt32): (KJS::BitOrNode::evaluate): (KJS::BitOrNode::evaluateToNumber): (KJS::BitOrNode::evaluateToBoolean): (KJS::BitOrNode::evaluateToInt32): (KJS::BitOrNode::evaluateToUInt32): (KJS::LogicalAndNode::optimizeVariableAccess): (KJS::LogicalAndNode::evaluate): (KJS::LogicalAndNode::evaluateToBoolean): (KJS::LogicalOrNode::optimizeVariableAccess): (KJS::LogicalOrNode::evaluate): (KJS::LogicalOrNode::evaluateToBoolean): (KJS::ConditionalNode::optimizeVariableAccess): (KJS::ConditionalNode::evaluate): (KJS::ConditionalNode::evaluateToBoolean): (KJS::ConditionalNode::evaluateToNumber): (KJS::ConditionalNode::evaluateToInt32): (KJS::ConditionalNode::evaluateToUInt32): (KJS::valueForReadModifyAssignment): (KJS::ReadModifyResolveNode::optimizeVariableAccess): (KJS::AssignResolveNode::optimizeVariableAccess): (KJS::ReadModifyLocalVarNode::evaluate): (KJS::AssignLocalVarNode::evaluate): (KJS::ReadModifyConstNode::evaluate): (KJS::AssignConstNode::evaluate): (KJS::ReadModifyResolveNode::evaluate): (KJS::AssignResolveNode::evaluate): (KJS::AssignDotNode::optimizeVariableAccess): (KJS::AssignDotNode::evaluate): (KJS::ReadModifyDotNode::optimizeVariableAccess): (KJS::ReadModifyDotNode::evaluate): (KJS::AssignErrorNode::evaluate): (KJS::AssignBracketNode::optimizeVariableAccess): (KJS::AssignBracketNode::evaluate): (KJS::ReadModifyBracketNode::optimizeVariableAccess): (KJS::ReadModifyBracketNode::evaluate): (KJS::CommaNode::optimizeVariableAccess): (KJS::CommaNode::evaluate): (KJS::ConstDeclNode::optimizeVariableAccess): (KJS::ConstDeclNode::handleSlowCase): (KJS::ConstDeclNode::evaluateSingle): (KJS::ConstDeclNode::evaluate): (KJS::ConstStatementNode::optimizeVariableAccess): (KJS::ConstStatementNode::execute): (KJS::statementListExecute): (KJS::BlockNode::optimizeVariableAccess): (KJS::BlockNode::execute): (KJS::EmptyStatementNode::execute): (KJS::ExprStatementNode::optimizeVariableAccess): (KJS::ExprStatementNode::execute): (KJS::VarStatementNode::optimizeVariableAccess): (KJS::VarStatementNode::execute): (KJS::IfNode::optimizeVariableAccess): (KJS::IfNode::execute): (KJS::IfElseNode::optimizeVariableAccess): (KJS::IfElseNode::execute): (KJS::DoWhileNode::optimizeVariableAccess): (KJS::DoWhileNode::execute): (KJS::WhileNode::optimizeVariableAccess): (KJS::WhileNode::execute): (KJS::ForNode::optimizeVariableAccess): (KJS::ForNode::execute): (KJS::ForInNode::optimizeVariableAccess): (KJS::ForInNode::execute): (KJS::ContinueNode::execute): (KJS::BreakNode::execute): (KJS::ReturnNode::optimizeVariableAccess): (KJS::ReturnNode::execute): (KJS::WithNode::optimizeVariableAccess): (KJS::WithNode::execute): (KJS::CaseClauseNode::optimizeVariableAccess): (KJS::CaseClauseNode::evaluate): (KJS::CaseClauseNode::executeStatements): (KJS::ClauseListNode::optimizeVariableAccess): (KJS::CaseBlockNode::optimizeVariableAccess): (KJS::CaseBlockNode::executeBlock): (KJS::SwitchNode::optimizeVariableAccess): (KJS::SwitchNode::execute): (KJS::LabelNode::optimizeVariableAccess): (KJS::LabelNode::execute): (KJS::ThrowNode::optimizeVariableAccess): (KJS::ThrowNode::execute): (KJS::TryNode::optimizeVariableAccess): (KJS::TryNode::execute): (KJS::ProgramNode::initializeSymbolTable): (KJS::ScopeNode::optimizeVariableAccess): (KJS::ProgramNode::processDeclarations): (KJS::EvalNode::processDeclarations): (KJS::ProgramNode::execute): (KJS::EvalNode::execute): (KJS::FunctionBodyNodeWithDebuggerHooks::execute): (KJS::FuncDeclNode::execute): (KJS::FuncExprNode::evaluate):
  • kjs/nodes.h: (KJS::Node::): (KJS::FalseNode::): (KJS::TrueNode::): (KJS::ArgumentsNode::):
11:00 PM Changeset in webkit [33269] by mrowe@apple.com
  • 4 edits
    1 add in branches/squirrelfish/JavaScriptCore

Bug 18672: SQUIRRELFISH: codegen fails with a large number of temporaries
<https://bugs.webkit.org/show_bug.cgi?id=18672>

Reviewed by Geoff

Add a SegmentedVector type, which provides a Vector<T> which maintains
existing memory locations during resize. This allows dynamically sizing
local, temporary and label "vectors" in CodeGenerator.

11:00 PM Changeset in webkit [33268] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-23 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

A little refactoring in preparation for supporting 'arguments'.

Fixes 2 regression tests.

SunSpider reports no change.

We now check the activation register, instead of the codeBlock, to
determine whether we need to tear off the activation. This is to support
"f.arguments", which will create an activation/arguments pair for f,
even though the needsFullScopeChain flag is false for f's codeBlock.

The test fixes resulted from calling initializeCallFrame for re-entrant
function code, instead of initializing (not enough) parts of the call
frame by hand.

11:00 PM Changeset in webkit [33267] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • propagate the "this" value properly to local eval

(fixes a measly one regression test)

  • VM/CodeBlock.h: (KJS::CodeBlock::CodeBlock): (KJS::ProgramCodeBlock::ProgramCodeBlock): (KJS::EvalCodeBlock::EvalCodeBlock):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:00 PM Changeset in webkit [33266] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Add support for function declarations in eval code.

(this fixes 12 more regression tests)

  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::CodeGenerator):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::execute):
  • kjs/nodes.cpp: (KJS::EvalNode::generateCode):
11:00 PM Changeset in webkit [33265] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Implement LabelNode.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::pushJumpContext): (KJS::CodeGenerator::jumpContextForContinue): (KJS::CodeGenerator::jumpContextForBreak):
  • VM/CodeGenerator.h:
  • kjs/nodes.cpp: (KJS::DoWhileNode::emitCode): (KJS::WhileNode::emitCode): (KJS::ForNode::emitCode): (KJS::ForInNode::emitCode): (KJS::ContinueNode::emitCode): (KJS::BreakNode::emitCode): (KJS::SwitchNode::emitCode): (KJS::LabelNode::emitCode):
11:00 PM Changeset in webkit [33264] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed crash when unwinding from exceptions inside eval.

  • VM/Machine.cpp: (KJS::Machine::unwindCallFrame): Don't assume that the top of the current call frame's scope chain is an activation: it can be the global object, instead.
11:00 PM Changeset in webkit [33263] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • kjs/testkjs.cpp: (main): Convert signals to exit codes, so that crashing tests are detected as regression test failures.
11:00 PM Changeset in webkit [33262] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt and Maciej Stachowiak.

Renamed "needsActivation" to "needsFullScopeChain" because lying will
make hair grow on the backs of your hands.

11:00 PM Changeset in webkit [33261] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fixed ChangeLog

11:00 PM Changeset in webkit [33260] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed ScopeChainNode lifetime problems:

(1) In "with" and "catch" scopes, we would construct a ScopeChain
object and then jump across its destructor, leaking the ScopeChainNode
we had pushed.

(2) In global and eval scopes, we would fail to initially ref
"scopeChain", causing us to overrelease it later. Now that we ref
"scopeChain" properly, we also need to deref it when the script
terminates.

SunSpider reports no change.

11:00 PM Changeset in webkit [33259] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Maciej Stachowiak <mjs@apple.com>

Reviewed by Alexey.

  • use global object instead of null for "this" on unqualified calls

This fixes 10 more JSC test regressions.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:00 PM Changeset in webkit [33258] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-22 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • throw proper exceptions for objects that don't implement call or construct

This fixes 21 more JSC test regressions. It is also seemingly an
0.5% progression.

  • VM/ExceptionHelpers.cpp: (KJS::createNotAnObjectError): (KJS::createNotAConstructorError): (KJS::createNotAFunctionError):
  • VM/ExceptionHelpers.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
11:00 PM Changeset in webkit [33257] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

Implement emitCode for ConstDeclNode.

Reviewed by Geoff

This fixes the crash (assertion) in js1_5/Scope/scope-001.js

11:00 PM Changeset in webkit [33256] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • add some support for the split window object

This fixes many layout tests.

  • VM/Machine.cpp: (KJS::resolveBaseAndFunc): Use toThisObject() to ensure we get the wrapper global, if one exists, as the "this" object.
  • kjs/function.cpp: (KJS::globalFuncEval): Use toGlobalObject() to handle the wrapper case properly.
11:00 PM Changeset in webkit [33255] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • restore ScopeChain::operator= to avoid crash on many layout tests

Otherwise, FunctionImp::setScope would cause a reference
underflow. I implemented using the copy construct and swap idiom.

  • kjs/scope_chain.h: (KJS::ScopeChain::swap): (KJS::ScopeChain::operator=):
11:00 PM Changeset in webkit [33254] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code
<https://bugs.webkit.org/show_bug.cgi?id=18649>

Reviewed by Geoff

Allocate a callframe for eval() and initialise with a null codeBlock to
indicate native code. This prevents the unwinder from clobbering the
register stack.

11:00 PM Changeset in webkit [33253] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/WebKit/mac

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Build fix.

  • ChangeLog:
  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]):
11:00 PM Changeset in webkit [33252] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Removed ScopeChain::push(ScopeChain&) because it was unused. Moved
ScopeChain::print to ScopeChainNode.

ScopeChain is now nothing more than a resource-handling wrapper around
ScopeChainNode.

10:59 PM Changeset in webkit [33251] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Bug 18671: SquirrelFish: continue inside switch fails
<https://bugs.webkit.org/show_bug.cgi?id=18671>

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::jumpContextForLabel):
  • VM/CodeGenerator.h:
  • kjs/nodes.cpp: (KJS::ContinueNode::emitCode):
10:59 PM Changeset in webkit [33250] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Moved push(JSObject*) and pop() from ScopeChain to ScopeChainNode,
rearranging scope_chain.h a bit.

SunSpider reports no change.

10:59 PM Changeset in webkit [33249] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Moved bottom() from ScopeChain to ScopeChainNode, simplifying it based
on the knowledge that the ScopeChain is never empty.

SunSpider reports no change.

10:59 PM Changeset in webkit [33248] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Moved begin() and end() from ScopeChain to ScopeChainNode.

Also marked a few methods "const".

SunSpider reports no change.

10:59 PM Changeset in webkit [33247] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Turned ScopeChain::depth into a stand-alone function, and simplified it
a bit.

I also moved ScopeChain::depth to Machine.cpp because it doesn't report
the true depth of the ScopeChain -- just the Machine's perspective of
its depth within a given call frame.

SunSpider reports no change.

10:59 PM Changeset in webkit [33246] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Removed indirection in ScopeChain::ref / ScopeChain::deref.

SunSpider reports no change.

  • kjs/scope_chain.h: (KJS::ScopeChain::ScopeChain): (KJS::ScopeChain::~ScopeChain): (KJS::ScopeChain::clear):
10:59 PM Changeset in webkit [33245] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Fix debug build

10:59 PM Changeset in webkit [33244] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Bug 18664: SQUIRRELFISH: correctly throw a SyntaxError when parsing of eval code fails
<https://bugs.webkit.org/show_bug.cgi?id=18664>

Patch from Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver

Correctly throw a SyntaxError when parsing of eval code fails.

10:59 PM Changeset in webkit [33243] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Partial fix for Bug 18649: SQUIRRELFISH: correctly handle exceptions in eval code

Reviewed by Geoff

Make sure we correct the register state before jumping to vm_throw.

10:59 PM Changeset in webkit [33242] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fixed reviewer named in old commit message

10:59 PM Changeset in webkit [33241] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Simplified ScopeChain ref/deref.

SunSpider reports a .4% speedup.

  • kjs/scope_chain.h: (KJS::ScopeChainNode::ref): Removed this function because it was nonsense. ScopeChainNodes are initialized with a refCount of 1, so the loop was guaranteed to iterate exactly once.
10:59 PM Changeset in webkit [33240] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Removed support for empty ScopeChains.

SunSpider reports no change.

10:59 PM Changeset in webkit [33239] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Removed some completely unused ScopeChain member functions.

SunSpider reports no change.

10:59 PM Changeset in webkit [33238] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Avoid creating unnecessary ScopeChain objects, to reduce refcount churn.

SunSpider reports no change.

10:59 PM Changeset in webkit [33237] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Alexey.

Add some braces.x

  • kjs/testkjs.cpp: (runWithScripts):
10:59 PM Changeset in webkit [33236] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • only print "End:" output when -d flag is passed.

This fixes half of our failing JSC regression tests.

  • kjs/testkjs.cpp: (runWithScripts):
10:59 PM Changeset in webkit [33235] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-04-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Add support for variable declarations in eval code.

  • VM/CodeBlock.h: (KJS::EvalCodeBlock::EvalCodeBlock):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::CodeGenerator):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::execute):
  • VM/Machine.h:
  • kjs/function.cpp: (KJS::globalFuncEval):
  • kjs/nodes.cpp: (KJS::EvalNode::generateCode):
  • kjs/nodes.h: (KJS::EvalNode::):
10:58 PM Changeset in webkit [33234] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Throw exceptions for invalid continue, break, and return statements.

Reviewed by Maciej

Simple refactoring and extension of Cameron's AssignErrorNode, etc patch

10:58 PM Changeset in webkit [33233] by mrowe@apple.com
  • 15 edits in branches/squirrelfish/JavaScriptCore

2008-04-20 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Removed Machine.cpp from AllInOneFile.cpp, and manually inlined a few
things that used to be inlined automatically.

1.9% speedup on SunSpider.

My hope is that we'll face fewer surprises in Machine.cpp codegen, now
that GCC is making fewer decisions. The speedup seems to confirm that.

10:58 PM Changeset in webkit [33232] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Bug 18642: Iterator context may get placed into the return register, leading to much badness
<https://bugs.webkit.org/show_bug.cgi?id=18642>

Reviewed by Maciej

To prevent incorrectly reusing what will become the result register for
eval and global code execution, we need to request and ref the destination
in advance of codegen. Unfortunately this may lead to unnecessary copying,
although in future we can probably limit this. Curiously SunSpider shows
a progression in a number of tests, although it comes out as a wash overall.

This also fixes one of the regressions in run-javascriptcore-tests.

10:58 PM Changeset in webkit [33231] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-20 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Add support for AssignErrorNode, PrefixErrorNode, and PostfixErrorNode.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitCreateError):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::PostfixErrorNode::emitCode): (KJS::PrefixErrorNode::emitCode): (KJS::AssignErrorNode::emitCode):
  • kjs/nodes.h:
10:58 PM Changeset in webkit [33230] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

Provide line number information in exceptions

Reviewed by Geoff and Mark

Simple patch, adds line number information metadata to CodeBlock
and a simple method to get the line number responsible for a given
Instruction*.

10:58 PM Changeset in webkit [33229] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

Provide "sourceURL" in exceptions

Reviewed by Maciej

10:58 PM Changeset in webkit [33228] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Don't call emitCode directly on subnodes, instead use CodeGenerator::emitNode

Reviewed by Maciej

This patch just a preparation for tracking line numbers.

10:58 PM Changeset in webkit [33227] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Bug 18619: Support continue, break, and return in try .. finally blocks
<https://bugs.webkit.org/show_bug.cgi?id=18619>

Reviewed by Maciej

This patch replaces the current partial finally support (which uses code
duplication to achieve what it does) with a subroutine based approach.
This has a number of advantages over code duplication:

  • Reduced code size
  • Simplified exception handling as the finaliser code only exists in one place, so no "magic" is needed to get the correct handler for a finaliser.
  • When we support instruction to line number mapping we won't need to worry about the dramatic code movement caused by duplication

On the downside it is necessary to add two new opcodes, op_jsr and op_sret
to enter and exit the finaliser subroutines, happily SunSpider reports
a performance progression (gcc amazes me) and ubench reports a wash.

While jsr and sret provide a mechanism that allows us to enter and exit
any arbitrary finaliser we need to, it was still necessary to increase
the amount of information tracked when entering and exiting both finaliser
scopes and dynamic scopes ("with"). This means "scopeDepth" is now
the combination of "finaliserDepth" and "dynamicScopeDepth". We also
now use a scopeContextStack to ensure that we pop scopes and execute
finalisers in the correct order. This increases the cost of "with" nodes
during codegen, but it should not be significant enough to effect real
world performance and greatly simplifies codegen for return, break and
continue when interacting with finalisers.

10:58 PM Changeset in webkit [33226] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Remove unnecessary files from testkjs, testapi and minidom targets.

Rubber-stamped by Oliver Hunt.

10:58 PM Changeset in webkit [33225] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-17 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed ASSERT seen during run-sunspider of a debug build.

  • VM/CodeGenerator.h: Made the default codegen buffers bigger. SunSpider runs all tests in one global environment, so you end up with more than 128 locals. This is just a stop-gap until we code up a real solution to arbitrary symbol and label limits.
10:58 PM Changeset in webkit [33224] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-17 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed a bug in exception unwinding, where we wouldn't deref the scope
chain in global scope, so we would leak ScopeChainNodes when exceptions
were thrown inside "with" and "catch" scopes.

Also did some cleanup of the unwinding code along the way.

Scope chain reference counting is still wrong in a few ways. I thought
I would fix this portion of it first.

run-sunspider shows no change.

  • VM/Machine.cpp: (KJS::Machine::unwindCallFrame): (KJS::Machine::throwException): (KJS::Machine::privateExecute):
  • VM/Machine.h:
10:58 PM Changeset in webkit [33223] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Add more exception checking to toNumber conversions

Reviewed by Maciej

This corrects op_pre_dec, op_negate, op_mod and op_sub.

10:58 PM Changeset in webkit [33222] by mrowe@apple.com
  • 11 edits in branches/squirrelfish/JavaScriptCore

2008-04-17 Geoffrey Garen <ggaren@apple.com> and Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver Hunt.

Behold: eval.

Introduced a new opcode: op_call_eval. In the normal case, it performs
an eval. In the case where eval has been overridden in some way, it
performs a function call.

  • VM/CodeGenerator.h: Added a feature so the code generator knows not to optimized locals in eval code.
10:58 PM Changeset in webkit [33221] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-17 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Added some ASSERTs to document codegen failures in
run-javascriptcore-tests.

For all tests, program-level codegen now either succeeds, or fails with
an ASSERT.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::addVar): (KJS::CodeGenerator::CodeGenerator): (KJS::CodeGenerator::newTemporary): (KJS::CodeGenerator::newLabel):
10:58 PM Changeset in webkit [33220] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-17 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed another case of a dst register being an unreferenced temporary
(caused an ASSERT when running the full sunspider suite).

  • kjs/nodes.cpp: (KJS::CaseBlockNode::emitCodeForBlock):
10:58 PM Changeset in webkit [33219] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-04-16 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • add documentation (and meaningful parameter names) for arithmetic and bitwise binary ops
  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitMul): (KJS::CodeGenerator::emitDiv): (KJS::CodeGenerator::emitMod): (KJS::CodeGenerator::emitSub): (KJS::CodeGenerator::emitLeftShift): (KJS::CodeGenerator::emitRightShift): (KJS::CodeGenerator::emitUnsignedRightShift): (KJS::CodeGenerator::emitBitAnd): (KJS::CodeGenerator::emitBitXOr): (KJS::CodeGenerator::emitBitOr):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::MultNode::emitCode): (KJS::DivNode::emitCode): (KJS::ModNode::emitCode): (KJS::SubNode::emitCode): (KJS::LeftShiftNode::emitCode): (KJS::RightShiftNode::emitCode): (KJS::UnsignedRightShiftNode::emitCode): (KJS::BitAndNode::emitCode): (KJS::BitXOrNode::emitCode): (KJS::BitOrNode::emitCode): (KJS::emitReadModifyAssignment): (KJS::ReadModifyResolveNode::emitCode):
10:58 PM Changeset in webkit [33218] by mrowe@apple.com
  • 18 edits in branches/squirrelfish/JavaScriptCore

Exception checks for toNumber in op_pre_inc

Reviewed by Geoff

This is somewhat more convoluted than the simple hadException checks
we currently use. Instead we use special toNumber conversions that
select between the exception and ordinary vPC. This allows us to
remove any branches in the common case (incrementing a number).

10:58 PM Changeset in webkit [33217] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-16 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • ensure that activations are kept in a register to protect them from GC

Also renamed OptionalCalleeScopeChain constant to OptionalCalleeActivation, since
that is what is now kept there, and there is no more need to keep the scope chain in
the register file.

  • VM/Machine.cpp: (KJS::initializeCallFrame): (KJS::scopeChainForCall):
  • VM/Machine.h: (KJS::Machine::):
10:57 PM Changeset in webkit [33216] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-16 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Made "this" work in program code / global scope.

The machine can initialize "this" prior to execution because it knows
that, for program code, "this" is always stored in lr1.

  • VM/Machine.cpp: (KJS::Machine::execute):
  • VM/Machine.h: (KJS::Machine::):
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):
10:57 PM Changeset in webkit [33215] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-16 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed a codegen bug when returning from inside a dynamic scope (a with
or catch block): we need to pop any dynamic scope(s) that have been
added so op_ret can find the activation object at the top of the scope
chain.

  • kjs/nodes.cpp: (KJS::ReturnNode::emitCode): If we're returning from inside a dynamic scope, emit a jmp_scopes to take care of popping any dynamic scope(s) and then branching to the return instruction.
10:57 PM Changeset in webkit [33214] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-16 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • document the add and get_prop_id opcodes

In addition to adding documentation in comments, I changed
references to register IDs or indices relating to these opcodes to
have meaningful names instead of r0 r1 r2.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitAdd):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/nodes.cpp: (KJS::DotAccessorNode::emitCode): (KJS::FunctionCallDotNode::emitCode): (KJS::PostIncDotNode::emitCode): (KJS::PostDecDotNode::emitCode): (KJS::PreIncDotNode::emitCode): (KJS::PreDecDotNode::emitCode): (KJS::AddNode::emitCode): (KJS::ReadModifyDotNode::emitCode):
10:57 PM Changeset in webkit [33213] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt and Maciej Stachowiak.

Fixed a codegen bug in with and switch, and added an ASSERT to
make sure it doesn't happen again.

emitCode() assumes that dst, if non-zero, is either referenced or
non-temporary (i.e., it assumes that newTemporary() will return a
register not equal to dst). Certain callers to emitCode() weren't
guaranteeing that to be so, so temporary register values were being
overwritten.

  • VM/CodeGenerator.h: (KJS::CodeGenerator::emitNode): ASSERT that dst is referenced or non-temporary.
  • kjs/nodes.cpp: (KJS::CommaNode::emitCode): Reference the dst we pass.

(KJS::WithNode::emitCode): No need to pass an explicit dst register.

(KJS::CaseBlockNode::emitCodeForBlock): No need to pass an explicit dst register.
(KJS::SwitchNode::emitCode): No need to pass an explicit dst register.

  • kjs/nodes.h: Made dst the last parameter to emitCodeForBlock, to match emitCode.
10:57 PM Changeset in webkit [33212] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Bug 18526: Throw exceptions when resolve fails for op_resolve_base_and_func.
<https://bugs.webkit.org/show_bug.cgi?id=18526>

Reviewed by Maciej

Very simple fix, sunspider shows a 0.7% progression, ubench shows a 0.4% regression.

10:57 PM Changeset in webkit [33211] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/SunSpider

2008-04-15 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Oliver.

  • add newly working tests to squirrelfish list
  • tests/LIST-SQUIRRELFISH: Add 3d-raytrace and string-unpack-code
10:57 PM Changeset in webkit [33210] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix incorrect result on 3d-raytrace test

Oliver found and tracked down this bug, I just typed in the fix.

  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): When setting omitted parameters to undefined, account for the space for local variables.
10:57 PM Changeset in webkit [33209] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix codegen handling of dst registers

1.006x speedup (not sure why).

Most emitCode functions take an optional "dst" parameter that says
where the output of the instruction should be written. I made some
functions for convenient handling of the dst register:

  • VM/CodeGenerator.h: (KJS::CodeGenerator::tempDestination): Takes the dst register. Returns it if it is not null and is a temporary, otherwise allocates a new temporary. This is intended for cases where an intermediate value might be written into the dst

(KJS::CodeGenerator::finalDestination): Takes the dst register and an optional
register that was used as a temp destination. Picks the right thing for the final
output. Intended to be used as the output register for the instruction that generates
the final value of a particular node.

(KJS::CodeGenerator::moveToDestinationIfNeeded): Takes dst and a
RegisterID; moves from the register to dst if dst is defined and
different from the register. This is intended for cases where the
result of a node is already in a specific register (likely a
local), and so no code needs to be generated unless a specific
destination has been requested, in which case a move is needed.

I also applied these methods throughout emitCode functions. In
some cases this was just cleanup, in other cases I fixed actual
codegen bugs. Below I have given specific comments for the cases
where I believe I fixed a codegen bug, or improved quality of codegen.

  • kjs/nodes.cpp: (KJS::NullNode::emitCode): (KJS::FalseNode::emitCode): (KJS::TrueNode::emitCode): (KJS::NumberNode::emitCode): (KJS::StringNode::emitCode): (KJS::RegExpNode::emitCode): (KJS::ThisNode::emitCode): Now avoids emitting a mov when dst is the same as the this register (the unlikely case of "this = this"); (KJS::ResolveNode::emitCode): Now avoids emitting a mov when dst is the same as the local regiester, in the local var case (the unlikely case of "x = x"); (KJS::ArrayNode::emitCode): Fixed a codegen bug where array literal element expressions may have observed an intermediate value of constructing the array. (KJS::ObjectLiteralNode::emitCode): (KJS::PropertyListNode::emitCode): Fixed a codegen bug where object literal property definition expressions may have obesrved an intermediate value of constructing the object. (KJS::BracketAccessorNode::emitCode): (KJS::DotAccessorNode::emitCode): (KJS::NewExprNode::emitCode): (KJS::FunctionCallValueNode::emitCode): (KJS::FunctionCallBracketNode::emitCode): (KJS::FunctionCallDotNode::emitCode): (KJS::PostIncResolveNode::emitCode): (KJS::PostDecResolveNode::emitCode): (KJS::PostIncBracketNode::emitCode): (KJS::PostDecBracketNode::emitCode): (KJS::PostIncDotNode::emitCode): (KJS::PostDecDotNode::emitCode): (KJS::DeleteResolveNode::emitCode): (KJS::DeleteBracketNode::emitCode): (KJS::DeleteDotNode::emitCode): (KJS::DeleteValueNode::emitCode): (KJS::VoidNode::emitCode): (KJS::TypeOfResolveNode::emitCode): (KJS::TypeOfValueNode::emitCode): (KJS::PreIncResolveNode::emitCode): Fixed a codegen bug where the final value would not be output to the dst register in the local var case. (KJS::PreDecResolveNode::emitCode): Fixed a codegen bug where the final value would not be output to the dst register in the local var case. (KJS::PreIncBracketNode::emitCode): (KJS::PreDecBracketNode::emitCode): (KJS::PreIncDotNode::emitCode): (KJS::PreDecDotNode::emitCode): (KJS::UnaryPlusNode::emitCode): (KJS::NegateNode::emitCode): (KJS::BitwiseNotNode::emitCode): (KJS::LogicalNotNode::emitCode): (KJS::MultNode::emitCode): (KJS::DivNode::emitCode): (KJS::ModNode::emitCode): (KJS::AddNode::emitCode): (KJS::SubNode::emitCode): (KJS::LeftShiftNode::emitCode): (KJS::RightShiftNode::emitCode): (KJS::UnsignedRightShiftNode::emitCode): (KJS::LessNode::emitCode): (KJS::GreaterNode::emitCode): (KJS::LessEqNode::emitCode): (KJS::GreaterEqNode::emitCode): (KJS::InstanceOfNode::emitCode): (KJS::InNode::emitCode): (KJS::EqualNode::emitCode): (KJS::NotEqualNode::emitCode): (KJS::StrictEqualNode::emitCode): (KJS::NotStrictEqualNode::emitCode): (KJS::BitAndNode::emitCode): (KJS::BitXOrNode::emitCode): (KJS::BitOrNode::emitCode): (KJS::LogicalAndNode::emitCode): (KJS::LogicalOrNode::emitCode): (KJS::ConditionalNode::emitCode): (KJS::emitReadModifyAssignment): Allow an out argument separate from the operands, needed for fixes below. (KJS::ReadModifyResolveNode::emitCode): Fixed a codegen bug where the right side of the expression may observe an intermediate value. (KJS::AssignResolveNode::emitCode): Fixed a codegen bug where the right side of the expression may observe an intermediate value. (KJS::ReadModifyDotNode::emitCode): Fixed a codegen bug where the right side of the expression may observe an intermediate value. (KJS::ReadModifyBracketNode::emitCode): Fixed a codegen bug where the right side of the expression may observe an intermediate value. (KJS::CommaNode::emitCode): Avoid writing temporary value to dst register. (KJS::ReturnNode::emitCode): Void return should return undefined, not null. (KJS::FuncExprNode::emitCode):
10:57 PM Changeset in webkit [33208] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • fix huge performance regression (from trunk) in string-unpack-code

This restores string-unpack-code performance to parity with
trunk (2.27x speedup relative to previous SquirrelFish)

  • VM/Machine.cpp: (KJS::Machine::execute): Shrink register file after call to avoid growing repeatedly.
10:57 PM Changeset in webkit [33207] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Fixed dumpCallFrame to match our new convention of passing around a
ScopeChainNode* instead of a ScopeChain*.

  • JavaScriptCore.exp:
  • VM/Machine.cpp: (KJS::Machine::dumpCallFrame):
  • VM/Machine.h:
10:57 PM Changeset in webkit [33206] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Bug 18436: Need to throw exception on read/modify/write or similar resolve for nonexistent property
<https://bugs.webkit.org/show_bug.cgi?id=18436>

Reviewed by Maciej.

Add op_resolve_base_and_property for read/modify/write operations,
this adds a "superinstruction" to resolve the base and value of a
property simultaneously. Just using resolveBase and resolve results
in an 5% regression in ubench, 30% in loop-empty-resolve (which is
expected). 1.3% progression in sunspider, 2.1% in ubench, with a
21% gain in loop-empty-resolve. The only outlier is function-missing-args
which gets a 3% regression that I could never resolve.

10:57 PM Changeset in webkit [33205] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-15 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

3d-raytrace and string-unpack-code now run.

The basic approach is to pass around ScopeChainNode* instead of
ScopeChain*, which in addition to not becoming suddenly an invalid
pointer also saves an indirection.

This is an 0.4% speedup on SunSpider --squirrelfish (1.8% on --ubench)

  • VM/Machine.cpp: (KJS::resolve): (KJS::resolveBase): (KJS::resolveBaseAndFunc): (KJS::initializeCallFrame): (KJS::scopeChainForCall): (KJS::Machine::unwindCallFrame): (KJS::Machine::throwException): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/Machine.h:
  • VM/Register.h: (KJS::Register::):
  • kjs/nodes.cpp: (KJS::EvalNode::generateCode): (KJS::FunctionBodyNode::generateCode): (KJS::ProgramNode::generateCode): (KJS::ProgramNode::processDeclarations): (KJS::EvalNode::processDeclarations): (KJS::FuncDeclNode::makeFunction): (KJS::FuncExprNode::makeFunction):
  • kjs/nodes.h: (KJS::ProgramNode::): (KJS::EvalNode::): (KJS::FunctionBodyNode::):
  • kjs/object.h:
  • kjs/scope_chain.h: (KJS::ScopeChainNode::ScopeChainNode): (KJS::ScopeChainNode::deref): (KJS::ScopeChainIterator::ScopeChainIterator): (KJS::ScopeChainIterator::operator*): (KJS::ScopeChainIterator::operator->): (KJS::ScopeChain::ScopeChain): (KJS::ScopeChain::node): (KJS::ScopeChain::deref): (KJS::ScopeChain::ref): (KJS::ScopeChainNode::ref): (KJS::ScopeChainNode::release): (KJS::ScopeChainNode::begin): (KJS::ScopeChainNode::end):
10:57 PM Changeset in webkit [33204] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-14 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed crash when accessing registers in a torn-off activation object.

  • kjs/JSActivation.cpp: (KJS::JSActivation::copyRegisters): Update our registerOffset after copying our registers, since our offset should now be relative to our private register array, not the shared register file.
10:57 PM Changeset in webkit [33203] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix a codegen flaw that makes some tests run way too fast or way too slow

The basic problem was that FunctionCallResolveNode results in
codegen which can incorrectly write an intermediate value into the
dst register even when that is a local. I added convenience
functions to CodeGenerator for getting this right, but for now I
only fixed FunctionCallResolve.

  • VM/CodeGenerator.h: (KJS::CodeGenerator::tempDestination): (KJS::CodeGenerator::):
  • kjs/nodes.cpp: (KJS::FunctionCallResolveNode::emitCode):
10:57 PM Changeset in webkit [33202] by mrowe@apple.com
  • 1 edit
    8 adds in branches/squirrelfish/SunSpider

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Oliver.

  • move ubench tests properly.
  • tests/ubench: Added.
  • tests/ubench/function-closure.js: Added.
  • tests/ubench/function-empty.js: Added.
  • tests/ubench/function-missing-args.js: Added.
  • tests/ubench/function-sum.js: Added.
  • tests/ubench/loop-empty-resolve.js: Added.
  • tests/ubench/loop-empty.js: Added.
  • tests/ubench/loop-sum.js: Added.
10:57 PM Changeset in webkit [33201] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/WebKitTools

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • added support for --ubench mode
  • Scripts/run-sunspider:
10:57 PM Changeset in webkit [33200] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/SunSpider

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Oliver.

  • sunspider: Don't force --runs=1 in squirrelfish mode any more.
10:57 PM Changeset in webkit [33199] by mrowe@apple.com
  • 12 edits in branches/squirrelfish

JavaScriptCore:

2008-04-14 Gabor Loki <loki@inf.u-szeged.hu>

Reviewed and slightly tweaked by Geoffrey Garen.

Bug 18489: Squirrelfish doesn't build on linux
<https://bugs.webkit.org/show_bug.cgi?id=18489>

  • JavaScriptCore.pri: Add VM into include path and its files into source set
  • VM/JSPropertyNameIterator.cpp: Fix include name
  • VM/Machine.cpp: Add UNLIKELY macro for GCC
  • VM/Machine.h: Add missing includes
  • VM/RegisterFile.cpp: Add missing include
  • kjs/testkjs.pro: Add VM into include path

WebCore:

2008-04-14 Gabor Loki <loki@inf.u-szeged.hu>

Reviewed by Geoffrey Garen.

Bug 18489: Squirrelfish doesn't build on linux
<https://bugs.webkit.org/show_bug.cgi?id=18489>

10:57 PM Changeset in webkit [33198] by mrowe@apple.com
  • 3 edits
    1 add
    7 deletes in branches/squirrelfish/SunSpider

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • make --squirrelfish mode use the real harness, but a reduced set of tests

Also add a new ubench mode which runs the older squirrelfish microbenchmarks.

  • sunspider:
  • tests/LIST-SQUIRRELFISH:
  • tests/LIST-UBENCH: Added.
  • tests/squirrelfish: Moved to tests/ubench
10:57 PM Changeset in webkit [33197] by mrowe@apple.com
  • 1 edit
    1 delete in branches/squirrelfish/SunSpider

2008-04-14 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Removed an unused test.

  • tests/squirrelfish/loop-resolve.js: Removed.
10:57 PM Changeset in webkit [33196] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-14 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Restored OwnPtr in some places where I had removed it previously. We
can have an OwnPtr to an undefined class in a header as long as the
class's destructor isn't in the header.

10:57 PM Changeset in webkit [33195] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-14 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Fixed access to "this" inside dynamic scopes.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::registerForLocal): Always return a register for "this", even if we're not optimizing access to other locals. Because "this" is a keyword, it's always in a register and always accessible.
  • VM/CodeGenerator.h: (KJS::CodeGenerator::shouldOptimizeLocals): Factored out a function for determining whether we should optimize access to locals, since eval will need to make this test a little more complicated.
10:57 PM Changeset in webkit [33194] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-14 Maciej Stachowiak <mjs@apple.com>

Reviewed by Adam.

  • fix crash when running SunSpider full harness

When growing the register file's buffer to make space for new globals,
make sure to copy accounting for the fact that the new space is logically
at the beginning of the buffer in this case, instead of at the end as when
growing for a new call frame.

  • VM/RegisterFile.cpp: (KJS::RegisterFile::newBuffer): (KJS::RegisterFile::growBuffer): (KJS::RegisterFile::addGlobalSlots):
  • VM/RegisterFile.h:
10:57 PM Changeset in webkit [33193] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-11 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Mark constant pools for global and eval code (collectively known as
"program code"). (Constant pools for function code are already marked by
their functions.)

The global object is responsible for marking program code constant
pools. Code blocks add themselves to the mark set at creation time, and
remove themselves from the mark set at destruction time.

sunspider --squirrelfish reports a 1% speedup, perhaps because
generateCode() is now non-virtual.

  • kjs/nodes.cpp: I had to use manual init and delete in this file because putting an OwnPtr into the header would have created a circular header dependency.
10:56 PM Changeset in webkit [33192] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Bug 18231: Improve support for function call nodes in SquirrelFish
<https://bugs.webkit.org/show_bug.cgi?id=18231>

Reviewed by Maciej

Use correct value of 'this' for function calls.

10:56 PM Changeset in webkit [33191] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

This time for sure.

  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):
10:56 PM Changeset in webkit [33190] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Fixed Interpreter::execute to honor the new model for returning non-NULL
values when an exception is thrown.

  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):
10:56 PM Changeset in webkit [33189] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Fix SquirrelFish interpreter to pass internal exceptions back to
native code correctly.

Reviewed by Geoff

10:56 PM Changeset in webkit [33188] by mrowe@apple.com
  • 49 edits
    1 copy
    1 add in branches/squirrelfish

JavaScriptCore:

2008-04-10 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Replace the use of getCallData in op_construct with the new
getConstructData function that replaces implementsConstruct.

  • API/JSCallbackConstructor.cpp: (KJS::JSCallbackConstructor::getConstructData):
  • API/JSCallbackConstructor.h:
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h: (KJS::::getConstructData): (KJS::::construct):
  • API/JSObjectRef.cpp: (JSObjectIsConstructor):
  • JavaScriptCore.exp:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/CallData.h:
  • kjs/ConstructData.h: Copied from JavaScriptCore/kjs/CallData.h. (KJS::):
  • kjs/array_object.cpp: (KJS::ArrayObjectImp::getConstructData):
  • kjs/array_object.h:
  • kjs/bool_object.cpp: (KJS::BooleanObjectImp::getConstructData):
  • kjs/bool_object.h:
  • kjs/date_object.cpp: (KJS::DateObjectImp::getConstructData):
  • kjs/date_object.h:
  • kjs/error_object.cpp: (KJS::ErrorObjectImp::getConstructData): (KJS::NativeErrorImp::getConstructData):
  • kjs/error_object.h:
  • kjs/function.cpp: (KJS::FunctionImp::getCallData): (KJS::FunctionImp::getConstructData): (KJS::FunctionImp::construct):
  • kjs/function.h:
  • kjs/function_object.cpp: (KJS::FunctionObjectImp::getConstructData):
  • kjs/function_object.h:
  • kjs/nodes.cpp: (KJS::NewExprNode::inlineEvaluate):
  • kjs/number_object.cpp: (KJS::NumberObjectImp::getConstructData):
  • kjs/number_object.h:
  • kjs/object.cpp:
  • kjs/object.h:
  • kjs/object_object.cpp: (KJS::ObjectObjectImp::getConstructData):
  • kjs/object_object.h:
  • kjs/regexp_object.cpp: (KJS::RegExpObjectImp::getConstructData):
  • kjs/regexp_object.h:
  • kjs/string_object.cpp: (KJS::StringObjectImp::getConstructData):
  • kjs/string_object.h:
  • kjs/value.cpp: (KJS::JSCell::getConstructData):
  • kjs/value.h: (KJS::JSValue::getConstructData):

WebCore:

2008-04-10 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Adjusted WebCore JS functions to the new "getConstructData" calling convention.

10:56 PM Changeset in webkit [33187] by mrowe@apple.com
  • 4 edits
    4 adds in branches/squirrelfish/JavaScriptCore

Bug 18420: SquirrelFish: need to throw Reference and Type errors
when attempting invalid operations on JSValues

Reviewed by Geoff

Add validation and exception checks to SquirrelFish so that the
correct exceptions are thrown for undefined variables, type errors
and toObject failure. Also handle exceptions thrown by native
function calls.

10:56 PM Changeset in webkit [33186] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Pass a function body node its function's scope chain, rather than the
current execution context's scope chain, when compiling it.

This doesn't matter yet, but it will once we start using the scope
chain during compilation.

sunspider --squirrelfish notes a tiny speedup.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:56 PM Changeset in webkit [33185] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fix two bugs when throwing exceptions from re-entrant JS calls:

(1) Don't shrink the register file to 0, since our caller may still
be using it.

(2) In case of exception, return jsNull() instead of 0 because,
surprisingly, some JavaScriptCore clients rely on a function's return
value being safe to operate on even if the function threw an exception.

Also:

  • Changed FunctionImp::callAsFunction to honor the new semantics of exceptions not returning 0.
  • Renamed "handlerPC" to "handlerVPC" to match other uses of "VPC".
  • Renamed "exceptionData" to "exceptionValue", because "data" seemed to imply something more than just a JSValue.
  • Merged prepareException into throwException, since throwException was its only caller, and it seemed weird that throwException didn't take an exception as an argument.

sunspider --squirrelfish does not seem to complain on my machine, but it
complains a little (.6%) on Oliver's.

10:56 PM Changeset in webkit [33184] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed op_construct for CallTypeNative to reacquire "r" before setting
its return value, since registerBase can theoretically change during the
execution of arbitrary code. (Not sure if any native constructors
actually make this possible.)

sunspider --squirrelfish does not seem to complain.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:56 PM Changeset in webkit [33183] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt and Sam Weinig.

Re-entrant execution of function code (global code -> built-in function
-> JS function):

Miraculously, sunspider --squirrelfish does not seem to complain.

A re-entrant function call is the same as a normal function call with
one exception: the re-entrant call leaves everything except for
CallerCodeBlock in the call frame header uninitialized, since the call
doesn't need to return to JS code. (It sets CallerCodeBlock to 0, to
indicate that the call shouldn't return to JS code.)

Also fixed a few issues along the way:

  • Fixed two bugs in the read-write List implementation that caused m_size and m_buffer to go stale.
  • Changed native call code to update "r" *before* setting the return value, since the call may in turn call JS code, which changes the value of "r".
  • Migrated initialization of "r" outside of Machine::privateExecute, because global code and function code initialize "r" differently.
  • Migrated a codegen warning from Machine::privateExecute to the wiki.
  • Removed unnecessary "r" parameter from slideRegisterWindowForCall
  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): (KJS::scopeChainForCall): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/Machine.h:
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction):
  • kjs/list.cpp: (KJS::List::getSlice):
  • kjs/list.h: (KJS::List::clear):
10:56 PM Changeset in webkit [33182] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/SunSpider

2008-04-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

Add newly runnable tests to --squirrelfish mode.

  • tests/LIST-SQUIRRELFISH:
10:56 PM Changeset in webkit [33181] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix problem with code generation for return with no argument

3d-cube now runs

  • kjs/nodes.cpp: (KJS::ReturnNode::emitCode):
10:56 PM Changeset in webkit [33180] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • Implement support for JS constructors

access-binary-trees and access-nbody now run.

Inexplicably a 1% speedup.

  • VM/Machine.cpp: (KJS::initializeCallFrame): (KJS::Machine::privateExecute):
  • VM/Machine.h: (KJS::Machine::):
10:56 PM Changeset in webkit [33179] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • More code cleanup in preparation for JS constructors

Factor the remaining interesting parts of JS function calls into
slideRegisterWindowForCall and scopeChainForCall.

  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): (KJS::scopeChainForCall): (KJS::Machine::privateExecute):
10:56 PM Changeset in webkit [33178] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • Code cleanup in preparation for JS constructors
  • Renamed returnInfo to callFrame.
  • Made an enum which defines what goes where in the call frame.
  • Factored out initializeCallFrame function from op_call
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitCall): (KJS::CodeGenerator::emitConstruct):
  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): (KJS::initializeCallFrame): (KJS::Machine::unwindCallFrame): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/Machine.h: (KJS::Machine::):
10:56 PM Changeset in webkit [33177] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-10 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed two bugs in register allocation for function calls:

(1) op_call used to allocate codeBlock->numVars too many registers for
each call frame, due to duplicated math. Fixing this revealed...

(2) By unconditionally calling resize(), op_call used to truncate the
register file when calling a function whose registers fit wholly within
the register file already allocated by its caller.

sunspider --squirrelfish reports no regression.

I also threw in a little extra formatting to dumpCallFrame, because it
helped me debug these issues.

  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/RegisterFile.h: (KJS::RegisterFile::shrink): (KJS::RegisterFile::grow):
  • VM/RegisterFileStack.cpp: (KJS::RegisterFileStack::popRegisterFile):
10:56 PM Changeset in webkit [33176] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-09 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Next step toward re-entrant execution of function code (global code ->
built-in function -> JS function):

Made op_ret return from Machine::privateExecute if its calling codeBlock
is NULL.

I'm checking this in by itself to demonstrate that a more clever
mechanism is not necessary for performance.

sunspider --squirrelfish reports no regression.

  • ChangeLog:
  • VM/Machine.cpp: (KJS::Machine::execute): (KJS::Machine::privateExecute):
10:56 PM Changeset in webkit [33175] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-09 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Next step toward re-entrant execution of function code (global code ->
built-in function -> JS function):

Made Machine::execute return a value.

Sketched out some code for Machine::execute for functions -- still
doesn't work yet, though.

sunspider --squirrelfish reports no regression.

  • VM/Machine.cpp: (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/Machine.h:
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):
  • kjs/testkjs.cpp: (runWithScripts):
10:56 PM Changeset in webkit [33174] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-09 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

First step toward re-entrant execution of function code (global code ->
built-in function -> JS function):

Tiny bit of refactoring in the Machine class.

sunspider --squirrelfish reports no regression.

  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): (KJS::Machine::unwindCallFrame): (KJS::Machine::execute): (KJS::Machine::privateExecute):
  • VM/Machine.h: (KJS::Machine::isGlobalCallFrame):
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate):
10:56 PM Changeset in webkit [33173] by mrowe@apple.com
  • 11 edits
    2 copies in branches/squirrelfish/JavaScriptCore

2008-04-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Support for re-entrant execution of global code (global code -> built-in
function -> global code).

Keep a stack of register files instead of just one. Globals propogate
between register files as the register files enter and exit the stack.

An activation still uses its own register file's base as its
registerBase, but the global object uses the register file *stack*'s
registerBase, which updates dynamically to match the register file at
the top of the stack.

sunspider --squirrelfish reports no regression.

10:56 PM Changeset in webkit [33172] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • initial preparatory work for JS constructors

1) Allocate registers for the returnInfo block and "this" value when generating code for
op_construct. These are not used yet, but the JS branch of op_construct will use them.

2) Adjust argc and argv appropriately for native constructor calls.

3) Assign return value in a more straightforward way in op_ret since this is actually
a bit faster (and makes up for the allocation of extra registers above).

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitConstruct):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:55 PM Changeset in webkit [33171] by mrowe@apple.com
  • 3 edits
    1 add in branches/squirrelfish/SunSpider

2008-04-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

A little more love for --squirrelfish mode:

Fixed a misplaced sort. Results properly sort now.

Added a test list just for squirrelfish, and updated it to include
all currently passing SunSpider tests.

Fixed the pruning regexp to match 3d-morph.js.

  • sunspider:
10:55 PM Changeset in webkit [33170] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

fix changelog, bokay?

10:55 PM Changeset in webkit [33169] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Fixed crasing SunSpider tests.

Let's just pretend this never happened, bokay?

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::CodeGenerator):
  • VM/CodeGenerator.h:
  • VM/RegisterFile.cpp: (KJS::RegisterFile::addGlobals):
10:55 PM Changeset in webkit [33168] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Restored dumping of generated code as a command-line switch:
run-testkjs -d will do it.

10:55 PM Changeset in webkit [33167] by mrowe@apple.com
  • 12 edits
    2 adds in branches/squirrelfish/JavaScriptCore

2008-04-07 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Next step toward supporting re-entrant evaluation: Moved register file
maintenance code into a proper "RegisterFile" class.

There's a subtle change to the register file's internal layout: for
global code / the global object, registerOffset is always 0 now. In
other words, all register counting starts at 0, not 0 + (number of
global variables). The helps simplify accounting when the number of
global variables changes.

10:55 PM Changeset in webkit [33166] by mrowe@apple.com
  • 13 edits in branches/squirrelfish/JavaScriptCore

Bug 18338: Support exceptions in SquirrelFish <http://bugs.webkit.org/show_bug.cgi?id=18338>

Reviewed by Geoff

Initial support for exceptions in SquirrelFish, only supports finalisers in the
simple cases (eg. exceptions and non-goto/return across finaliser boundaries).
This doesn't add the required exception checks to existing code, it merely adds
support for throw, catch, and the required stack unwinding.

10:55 PM Changeset in webkit [33165] by mrowe@apple.com
  • 12 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

First step toward supporting re-entrant evaluation: Switch register
clients from using "registers", a pointer to a register vector, to
"registerBase", an indirect pointer to the logical first entry in the
register file. (The logical first entry is the first entry that is not
a global variable).

With a vector, offsets into the register file remain good when the
underlying buffer reallocates, but they go bad when the logical
first entry moves. (The logical first entry moves when new global
variables get added to the beginning of the register file.) With an
indirect pointer to the logical first entry, offsets will remain good
regardless.

1.4% speedup on sunspider --squirrelfish. I suspect this is due to
reduced allocation when creating closures, and reduced indirection
through the register vector.

  • wtf/Vector.h: Added an accessor for an indirect pointer to the vector's buffer, which we currently use (incorrectly) for registerBase. This is temporary scaffolding to allow us to change client code without changing behavior.
10:55 PM Changeset in webkit [33164] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

Implement codegen for ReadModifyDotNode.

  • kjs/nodes.cpp: (KJS::ReadModifyDotNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33163] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

Fix codegen for PostIncDotNode and implement codegen for PostIncBracketNode,
PostDecBracketNode and PostDecDotNode.

  • kjs/nodes.cpp: (KJS::PostIncBracketNode::emitCode): (KJS::PostDecBracketNode::emitCode): (KJS::PostIncDotNode::emitCode): (KJS::PostDecDotNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33162] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Implement codegen for PreDecResolveNode, PreIncBracketNode, PreDecBracketNode,
PreIncDotNode and PreDecDotNode. This required adding one new op code, op_pre_dec.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitPreDec):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::PreDecResolveNode::emitCode): (KJS::PreIncBracketNode::emitCode): (KJS::PreDecBracketNode::emitCode): (KJS::PreIncDotNode::emitCode): (KJS::PreDecDotNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33161] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Improved register dumping, plus a liberal smattering of "const". Here's
what the new format looks like:

(gdb) call (void)dumpCallFrame(codeBlock, scopeChain, registers->begin(), r)
4 instructions; 48 bytes at 0x509210; 3 locals (2 parameters); 1 temporaries

[ 0] load lr1, undefined(@k0)
[ 3] load lr1, 2(@k1)
[ 6] add tr0, lr2, lr1
[ 10] ret tr0

Constants:

k0 = undefined
k1 = 2

Register frame:

----------------------------------------

use | address | value

----------------------------------------
[return info] | 0x80ac08 | 0x5081c0
[return info] | 0x80ac0c | 0x508e90
[return info] | 0x80ac10 | 0x504acc
[return info] | 0x80ac14 | 0x2
[return info] | 0x80ac18 | 0x0
[return info] | 0x80ac1c | 0x7
[return info] | 0x80ac20 | 0x0
----------------------------------------
[param] | 0x80ac24 | 0x1
[param] | 0x80ac28 | 0x7
[var] | 0x80ac2c | 0xb
[temp] | 0x80ac30 | 0xf

10:55 PM Changeset in webkit [33160] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-04-06 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Support for evaluating multiple scripts in the same global environment.
(Still don't support re-entrant evaluation yet.)

The main changes here are:

(1) Obey the ECMA 10.1.3 rules regarding how to resolve collisions when
a given symbol is declared more than once. (This patch fixes the same
issue for function code, too.)

(2) In the case of var and/or function collisions, reuse the existing
storage slot. For global code, this is required for previously
generated instructions to continue to work. For function code, it's
more of a "nice to have": it makes register layout in the case of
collisions easier to understand, and has the added benefit of saving
memory.

(3) Allocate slots in the CodeGenerator's m_locals vector in parallel
to register indexes in the symbol table. This ensures that, given an
index in the symbol table, we can find the corresponding RegisterID
without hashing, which speeds up codegen.

I moved responsibility for emitting var and function initialization
instructions into the CodeGenerator, because bookkeeping in cases where
var, function, and/or parameter names collide requires a lot of
internal knowledge about the CodeGenerator.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::addVar): Removed responsibility for checking whether a var declaration overwrites "arguments", because the check is inappropriate for global code, which may not have a pre-existing "arguments" symbol in scope. Also changed this function to return a boolean indicating whether addVar actually created a new RegisterID, or just reused an old one.

(KJS::CodeGenerator::CodeGenerator): Split out the constructors for
function code and global code, since they're quite different now.

(KJS::CodeGenerator::registerForLocal): This function does its job
without any hashing now.

  • VM/Machine.cpp: Move old globals and update "r" before executing a new script. That way, old globals stay at a constant offset from "r", and previously optimized code still works.
  • VM/RegisterID.h: Added the ability to allocate a RegisterID before initializing its index field. We use this for parameters now.
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::symbolTableGet): Changed the ungettable getter ASSERT to account for the fact that symbol indexes are all negative.
10:55 PM Changeset in webkit [33159] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

Fix ChangeLog

10:55 PM Changeset in webkit [33158] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-05 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Implement codegen for ForInNode.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitIn):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::InNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33157] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-05 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

  • Implement codegen for DeleteResolveNode, DeleteBracketNode, DeleteDotNode and DeleteValueNode.
  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitGetPropId): (KJS::CodeGenerator::emitPutPropId): (KJS::CodeGenerator::emitDeletePropId): (KJS::CodeGenerator::emitDeletePropVal): (KJS::CodeGenerator::emitPutPropIndex):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::DeleteResolveNode::emitCode): (KJS::DeleteBracketNode::emitCode): (KJS::DeleteDotNode::emitCode): (KJS::DeleteValueNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33156] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

2008-04-04 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

  • Implement codegen for Switch statements.
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::pushJumpContext): (KJS::CodeGenerator::popJumpContext): (KJS::CodeGenerator::jumpContextForLabel):
  • VM/CodeGenerator.h: Rename LoopContext to JumpContext now that it used of Switch statements in addition to loops.
  • kjs/nodes.cpp: (KJS::DoWhileNode::emitCode): (KJS::WhileNode::emitCode): (KJS::ForNode::emitCode): (KJS::ForInNode::emitCode): (KJS::ContinueNode::emitCode): (KJS::BreakNode::emitCode): (KJS::CaseBlockNode::emitCodeForBlock): (KJS::SwitchNode::emitCode):
  • kjs/nodes.h: (KJS::CaseClauseNode::expr): (KJS::CaseClauseNode::children): (KJS::CaseBlockNode::):
10:55 PM Changeset in webkit [33155] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-03 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • fix crash in codegen from new nodes
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitConstruct):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33154] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/kjs/nodes.h

File I forgot in my last commit.

10:55 PM Changeset in webkit [33153] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-03 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • kjs/nodes.cpp: (KJS::ReadModifyResolveNode::emitCode): (KJS::ReadModifyBracketNode::emitCode):
  • kjs/nodes.h:
10:55 PM Changeset in webkit [33152] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-02 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • take a shot at marking constant pools for global and eval code

Geoff says this won't really work in all cases but is an ok stopgap.

  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::mark):
10:55 PM Changeset in webkit [33151] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-02 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • fix 2x perf regression in 3d-morph
  • VM/Machine.cpp: (KJS::Machine::privateExecute): If we subbed in null for the global object, don't toObject it, since that will throw an exception (very slowly).
10:55 PM Changeset in webkit [33150] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-02 Maciej Stachowiak <mjs@apple.com>

Rubber stamped by Geoff

  • fix Release build
  • kjs/nodes.cpp: (KJS::getNonLocalSymbol):
10:55 PM Changeset in webkit [33149] by mrowe@apple.com
  • 10 edits in branches/squirrelfish/JavaScriptCore

2008-04-02 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Removed the last vestiges of LocalStorage from JSVariableObject and
JSGlobalObject.

  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::saveLocalStorage): Save and restore from/to registers. Use stub isReadOnly and isDontEnum methods for now, until we really implement attributes in the symbol table. (KJS::JSGlobalObject::restoreLocalStorage): (KJS::JSGlobalObject::reset):
  • kjs/JSVariableObject.cpp: (KJS::JSVariableObject::getPropertyNames): Use stub isDontEnum method for now, as above. (KJS::JSVariableObject::getPropertyAttributes): ditto
  • kjs/JSVariableObject.h: Removed LocalStorage from JSVariableObjectData. Removed mark method, because subclasses implement different strategies for marking registers. (KJS::JSVariableObject::isReadOnly): Stub method (KJS::JSVariableObject::isDontEnum): ditto

Changed the code below to ASSERT_NOT_REACHED() and return 0, since it
can no longer retrieve LocalStorage from the ExecState. (Eventually,
we'll just remove this code and all its friends, but that's a task for
later.)

  • kjs/ExecState.cpp: (KJS::ExecState::ExecState):
  • kjs/function.cpp: (KJS::ActivationImp::markChildren):
  • kjs/function.h:
  • kjs/nodes.cpp: (KJS::getNonLocalSymbol): (KJS::ScopeNode::optimizeVariableAccess): (KJS::ProgramNode::processDeclarations):
10:54 PM Changeset in webkit [33148] by mrowe@apple.com
  • 1 edit in branches/squirrelfish/JavaScriptCore/ChangeLog

reverse order of last two ChangeLog entries (oops)

10:54 PM Changeset in webkit [33147] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • mark the constant pool (at least for function code blocks)
  • VM/CodeBlock.cpp: (KJS::CodeBlock::mark):
  • VM/CodeBlock.h:
  • kjs/function.cpp: (KJS::FunctionImp::mark):
  • kjs/nodes.cpp: (KJS::ScopeNode::mark):
  • kjs/nodes.h: (KJS::FuncExprNode::body): (KJS::FuncDeclNode::body):
10:54 PM Changeset in webkit [33146] by mrowe@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • mark the constant pool (at least for function code blocks)
  • VM/CodeBlock.cpp: (KJS::CodeBlock::mark):
  • VM/CodeBlock.h:
  • kjs/function.cpp: (KJS::FunctionImp::mark):
  • kjs/nodes.cpp: (KJS::ScopeNode::mark):
  • kjs/nodes.h: (KJS::FuncExprNode::body): (KJS::FuncDeclNode::body):
10:54 PM Changeset in webkit [33145] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Geoffrey Garen <ggaren@apple.com>

Reviewed by Beth Dakin.

Cleaned up a few loose ends.

  • JavaScriptCore.exp: Export dumpRegisters, so it's visible to gdb even if we don't explicitly call it in the source text.
  • VM/Machine.cpp: (KJS::Machine::privateExecute): No need to call dumpRegisters anymore, since that was just a hack for gdb's sake.
  • kjs/JSActivation.h: Removed obsolete comment.
  • VM/CodeGenerator.cpp: Added ASSERTs to verify that the localCount we're given matches the number of locals actually allocated.
  • VM/CodeGenerator.h: (KJS::CodeGenerator::CodeGenerator): Changed "localCount" to include the parameter count, since we're using the word "local" to mean parameter, var, function, or "this". Renamed "m_nextLocal" to "m_nextVar", since "m_nextLocal" doesn't contrast well with "m_nextParameter".

Also moved tracking of implicit "this" parameter from here...

  • kjs/nodes.cpp: (KJS::FunctionBodyNode::generateCode): ... to here (KJS::ProgramNode::generateCode): ... and here
  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump): Added missing "\n".
10:54 PM Changeset in webkit [33144] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Bug 18274: ResolveNode::emitCode() doesn't make a new temporary when dst

is 0, leading to incorrect codegen

<http://bugs.webkit.org/show_bug.cgi?id=18274>

10:54 PM Changeset in webkit [33143] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • fix bug in for..in codegen (gotta use ident, not m_ident)
  • kjs/nodes.cpp: (KJS::ForInNode::emitCode):
10:54 PM Changeset in webkit [33142] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • Add suport for regexp literals
  • VM/CodeBlock.cpp: (KJS::regexpToSourceString): (KJS::regexpName): (KJS::CodeBlock::dump):
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::addRegExp): (KJS::CodeGenerator::emitNewRegExp):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::RegExpNode::emitCode):
  • kjs/nodes.h:
10:54 PM Changeset in webkit [33141] by mrowe@apple.com
  • 12 edits
    1 copy
    1 add in branches/squirrelfish/JavaScriptCore

Add support for for..in nodes

Reviewed by Geoff

Added two new opcodes to get_pnames and next_pname to handle iterating
over the set of properties on an object. This iterator is explicitly
invalidated and the property name array is released on standard exit
from the loop, otherwise we rely on GC to do the clean up for us.

10:54 PM Changeset in webkit [33140] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Change CodeGenerator::emitCall() so it increments the reference count of
registers passed to it, and change its callers so they don't needlessly
increment the reference count of the registers they are passing.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitCall):
  • kjs/nodes.cpp: (KJS::FunctionCallResolveNode::emitCode): (KJS::FunctionCallDotNode::emitCode):
10:54 PM Changeset in webkit [33139] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • generate call for PostIncDotNode
  • kjs/nodes.cpp: (KJS::PostIncDotNode::emitCode):
  • kjs/nodes.h:
10:54 PM Changeset in webkit [33138] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Build fix.

  • fix build (not sure how this ever worked?)
  • kjs/nodes.cpp: (KJS::FunctionCallBracketNode::emitCode):
10:54 PM Changeset in webkit [33137] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • generate code for FunctionCallBracketNode
  • kjs/nodes.cpp: (KJS::FunctionCallBracketNode::emitCode):
  • kjs/nodes.h:
10:54 PM Changeset in webkit [33136] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.

  • Fix two crashing SunSpider tests
  • VM/Machine.cpp: (KJS::Machine::privateExecute): set up 'this' properly for native calls.
  • kjs/list.h: (KJS::List::List): Fix intialization of buffer and size from vector, the initialization order was wrong.
10:54 PM Changeset in webkit [33135] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Geoffrey Garen <ggaren@apple.com>

Build fix: marked ASSERT-only variables as UNUSED_PARAMs.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::symbolTableInitializeVariable):
10:54 PM Changeset in webkit [33134] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Next step toward global code: Moved get, put, and initializeVariable
functionality up into JSVariableObject, and changed JSActivation to
rely on it.

  • kjs/JSActivation.cpp: (KJS::JSActivation::JSActivation): (KJS::JSActivation::getOwnPropertySlot): (KJS::JSActivation::put): (KJS::JSActivation::initializeVariable):
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::valueAt): (KJS::JSVariableObject::isReadOnly): (KJS::JSVariableObject::symbolTableGet): (KJS::JSVariableObject::symbolTablePut): (KJS::JSVariableObject::symbolTableInitializeVariable):
10:54 PM Changeset in webkit [33133] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • fix HashTable assertion on some SunSpider tests

Don't use -1 as the deleted value for JSValue*-keyed hashtables,
since it is a valid value (it's the immediate for -1).

  • VM/CodeGenerator.h: (KJS::CodeGenerator::JSValueHashTraits::emptyValue): (KJS::CodeGenerator::JSValueHashTraits::deletedValue):
  • kjs/JSImmediate.h: (KJS::JSImmediate::impossibleValue):
10:54 PM Changeset in webkit [33132] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Sam Weinig <sam@webkit.org>

Reviewed by Maciej Stachowiak.

Add support for calling Native constructors like new Array().

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitConstruct):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::NewExprNode::emitCode):
  • kjs/nodes.h:
10:54 PM Changeset in webkit [33131] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

  • add some missing toOpbject calls to avoid crashing when calling methods on primitives
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:54 PM Changeset in webkit [33130] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-04-01 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Changed Machine::dumpRegisters to take a pointer instead of a reference,
so gdb understands how to call it.

  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): (KJS::Machine::privateExecute):
  • VM/Machine.h:
10:54 PM Changeset in webkit [33129] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Fix CodeGenerator::addConstant() so it uses the functionExpressions
counter for function expressions, not the functions counter.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::addConstant):
10:54 PM Changeset in webkit [33128] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Add emitCode support for TypeOfResolveNode and TypeOfValueNode.
Added new opcode op_type_of to handle them.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitNot): (KJS::CodeGenerator::emitInstanceOf): (KJS::CodeGenerator::emitTypeOf):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::jsTypeStringForValue): (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::TypeOfResolveNode::emitCode): (KJS::TypeOfValueNode::emitCode):
  • kjs/nodes.h:
10:54 PM Changeset in webkit [33127] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

Fix non-computed goto version of isOpcode. op_end is a valid opcode.

  • VM/Machine.cpp: (KJS::Machine::isOpcode):
10:53 PM Changeset in webkit [33126] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Added op_post_dec.

10:53 PM Changeset in webkit [33125] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoffrey Garen.

Add support for FunctionCallDotNode.

  • kjs/nodes.cpp: (KJS::FunctionCallDotNode::emitCode):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33124] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Beth Dakin.

Next step toward global code: Removed more obsolete API, moved
saveLocalStorage and restoreLocalStorage to JSGlobalObject subclass,
since it's only intended for use there.

  • ChangeLog:
  • JavaScriptCore.exp:
  • kjs/Activation.h:
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::saveLocalStorage): (KJS::JSGlobalObject::restoreLocalStorage):
  • kjs/JSGlobalObject.h:
  • kjs/JSVariableObject.cpp:
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
  • kjs/function.cpp: (KJS::ActivationImp::ActivationImp):
10:53 PM Changeset in webkit [33123] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Beth Dakin.

Next step toward global code: subclass JSActivation + JSActivationData
from JSVariableObject + JSVariableObjectData.

JSActivation now relies on JSVariableObject for access to registers and
symbol table, and for some delete functionality, but not for anything
else yet.

(KJS::JSActivation::mark): Cleaned up the style here a little bit.

10:53 PM Changeset in webkit [33122] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Beth Dakin.

Next step toward global code: store "rOffset" in JSVariableObjectData.

  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
10:53 PM Changeset in webkit [33121] by mrowe@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Next steps toward global code:

  • Moved access to the register file into JSVariableObject.
  • Added more ASSERTs to indicate obsolete APIs there are just hanging around to stave off build failures.
  • kjs/JSGlobalObject.h: (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
  • kjs/JSVariableObject.h: (KJS::JSVariableObject::registers): (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData): (KJS::JSVariableObject::JSVariableObject):
10:53 PM Changeset in webkit [33120] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Sam Weinig <sam@webkit.org>

Reviewed by Oliver. Tweaked somewhat by Maciej.

  • implement codegen for ReadModifyResolveNode
  • kjs/nodes.cpp: (KJS::emitReadModifyAssignment): (KJS::ReadModifyResolveNode::emitCode):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33119] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoff.

Fix the build -- r31492 removed activation tear-off, but r31493 used it.

  • kjs/nodes.cpp: (KJS::FuncExprNode::makeFunction):
10:53 PM Changeset in webkit [33118] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Add support for FuncExprNode to SquirrelFish.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::addConstant): (KJS::CodeGenerator::emitNewFunctionExpression):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::FuncExprNode::emitCode): (KJS::FuncExprNode::makeFunction):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33117] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

First step toward global code: removed some obsolete JSGlobalObject
APIs, changing clients to ASSERT_NOT_REACHED.

Activation tear-off and scope chain pushing is obsolete because we
statically detect whether an activation + scope node is required.

The variableObject() and activationObject() accessors are obsolete
because they haven't been maintained, and they're mostly used by
node evaluation code, anyway.

The localStorage() accessor is obsolete because everything is in
registers now, and it's mostly used by node evaluation code, anyway.

10:53 PM Changeset in webkit [33116] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Maciej Stachowiak <mjs@apple.com>

Reviewed by Darin.

  • implement codegen for bracket accessor and bracket assign
  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitGetPropVal): (KJS::CodeGenerator::emitPutPropVal):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::BracketAccessorNode::emitCode): (KJS::AssignBracketNode::emitCode):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33115] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Not reviewed.

Removed FIXME that I just fixed.

Added ASSERT to cover an error previously only covered by a FIXME.

  • kjs/JSActivation.cpp: (KJS::JSActivation::getOwnPropertySlot):
10:53 PM Changeset in webkit [33114] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Not reviewed.

Fixed indentation inside op_call. (I had left this code badly indented
to make the behavior-changing diff clearer.)

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:53 PM Changeset in webkit [33113] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Fixed up logging of jump instructions to follow the following style:

jump offset(->absoluteTarget)

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
10:53 PM Changeset in webkit [33112] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.

Changed the SymbolTable API to use int instead of size_t. It has been
using int internally for a while now (since squirrelfish symbols can
have negative indices).

10:53 PM Changeset in webkit [33111] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Add support for FunctionCallValueNode.

  • kjs/nodes.cpp: (KJS::FunctionCallValueNode::emitCode):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33110] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-31 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

1) Implemented array literals

2) Renamed op_object_get and op_object_put to op_get_prop_id and
op_put_prop_id in preparation for new variants.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitNewArray): (KJS::CodeGenerator::emitGetPropId): (KJS::CodeGenerator::emitPutPropId): (KJS::CodeGenerator::emitPutPropIndex):
  • VM/CodeGenerator.h: (KJS::CodeGenerator::CodeGenerator): (KJS::CodeGenerator::propertyNames):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::ArrayNode::emitCode): (KJS::PropertyListNode::emitCode): (KJS::DotAccessorNode::emitCode): (KJS::PostIncResolveNode::emitCode): (KJS::PreIncResolveNode::emitCode): (KJS::AssignResolveNode::emitCode): (KJS::AssignDotNode::emitCode):
  • kjs/nodes.h:
10:53 PM Changeset in webkit [33109] by mrowe@apple.com
  • 27 edits
    6 adds in branches/squirrelfish

JavaScriptCore:

2008-03-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Implemented native function calls. (Re-entering from native code back
to JS doesn't work yet, though.)

0.2% speedup overall, due to some inlining tweaks. 3.6% regression on
function-empty.js, since we're making a new virtual call and taking a
new branch inside every op_call.

I adjusted the JavaScriptCore calling convention to minimize overhead,
like so:

The machine calls a single virtual function, "getCallData", to get all
the data it needs for a function call. Native code still uses the old
"isObject()" check followed by an "implementsCall()" check, which
aliases to "getCallData". (We can optimize native code to use getCallData
at our leisure.)

To supply a list of arguments, the machine calls a new List constructor
that just takes a pointer and a length, without copying. Native code
still appends to the list one argument at a time. (We can optimize
native code to use the new List constructor at our leisure.)

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Changed resize() call to grow() call, to encourage the compiler to inline the Vector code.
  • kjs/CallData.h: Added. (KJS::): CallData is a union because eventually native calls will stuff a function pointer into it, to eliminate the callAsFunction virtual call.
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): Changed this to an ASSERT since it's not implemented yet.
  • kjs/list.h: Made the List class two-faced, to support the old way and the new way during this transition phase: lists can be made read-only with just a pointer and a legnth, or you can append to them one item at a time.
  • kjs/value.h: (KJS::jsUndefined): Marked this function ALWAYS_INLINE for the benefit of a certain compiler that doesn't know what's best for it.

JavaScriptGlue:

2008-03-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Build fix.

  • ForwardingHeaders/wtf/UnusedParam.h: Copied from ForwardingHeaders/wtf/OwnPtr.h.

WebCore:

2008-03-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Adjusted WebCore JS functions to the new "getCallData" calling convention.

WebKit/mac:

2008-03-30 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Build fix.

10:53 PM Changeset in webkit [33108] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-30 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

Dump code that codegen can't handle yet, so it's easier to prioritize missing nodes.

  • kjs/nodes.h: (KJS::Node::emitCode):
10:53 PM Changeset in webkit [33107] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-30 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

Improve dumping of bytecode and fix coding style accordingly.

Registers are printed as lr1 for locals, tr1 for temp registers. Identifiers print as
foobar(@id0) and constants print as "foo"(@k1) or 312.4(@k2) or the like. Constant and
identifier tables are dumped for reference.

  • VM/CodeBlock.cpp: (KJS::escapeQuotes): (KJS::valueToSourceString): (KJS::registerName): (KJS::constantName): (KJS::idName): (KJS::printUnaryOp): (KJS::printBinaryOp): (KJS::CodeBlock::dump):
  • VM/Machine.cpp: (KJS::resolve): (KJS::resolveBase): (KJS::Machine::privateExecute):
10:53 PM Changeset in webkit [33106] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-30 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

Implement StringNode and VoidNode (both pretty trivial).

  • kjs/nodes.cpp: (KJS::StringNode::emitCode): (KJS::VoidNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33105] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-30 Maciej Stachowiak <mjs@apple.com>

Reviewed by Sam.

Implement CommaNode.

  • kjs/nodes.cpp: (KJS::CommaNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33104] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej.

Adds support for dot notation and object literals.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitNewObject):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::ObjectLiteralNode::emitCode): (KJS::PropertyListNode::emitCode): (KJS::DotAccessorNode::emitCode): (KJS::AssignDotNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33103] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-03-29 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.

Mark the register file.

It's a conservative mark for now, but once registers are typed, we can
do an exact mark.

1.4% regression regardless of whether we actually do the marking.
GCC is is worth every penny.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Most of the changes here are just for the fact that "registers" is a pointer now.
  • kjs/JSGlobalObject.cpp: The global object owns the register file now.
10:52 PM Changeset in webkit [33102] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

Bug 18204: SquirrelFish: continue/break do not correctly handle scope popping
<http://bugs.webkit.org/show_bug.cgi?id=18204>

Reviewed by Maciej.

We now track the scope depth as part of a loop context, and add an
extra instruction op_jump_scopes that is used to perform a jump across
dynamic scope boundaries.

10:52 PM Changeset in webkit [33101] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-28 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Add emitCode support for ConditionalNode.

  • kjs/nodes.cpp: (KJS::ConditionalNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33100] by mrowe@apple.com
  • 7 edits in branches/squirrelfish/JavaScriptCore

2008-03-28 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Responding to feedback, added some comments, fixed up a few names, and
clarified that "locals" always means all local variables, functions,
and parameters.

10:52 PM Changeset in webkit [33099] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-03-28 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Added support for "this".

Supply an implicit "this" value as the first argument to every function.
Alias the "this" keyword to that argument.

1% regression overall, 2.5% regression on empty function calls. Seems
like a reasonable cost for now, since we're doing more work.
(Eventually, we might decide to create a version of op_call specialized
for a known null "this" value.)

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitCall):
  • VM/CodeGenerator.h: (KJS::CodeGenerator::CodeGenerator):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • kjs/CommonIdentifiers.cpp: (KJS::CommonIdentifiers::CommonIdentifiers):
  • kjs/CommonIdentifiers.h:
  • kjs/nodes.cpp: (KJS::ThisNode::emitCode): (KJS::FunctionCallResolveNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33098] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

Bug 18192: Squirrelfish needs support for break and continue
<http://bugs.webkit.org/show_bug.cgi?id=18192>

Reviewed by Geoff

Added a loop context stack to the code generator to provide the
correct jump labels for continue and goto. Added logic to the
currently implemented loop constructs to manage entry and exit
from the loop contexts. Finally, implemented codegen for break
and continue (and a pass through for LabelNode)

10:52 PM Changeset in webkit [33097] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Add emitCode support for UnaryPlusNode, NegateNode, BitwiseNotNode and LogicalNotNode.

  • VM/CodeBlock.cpp: (KJS::printUnaryOp): (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitToJSNumber): (KJS::CodeGenerator::emitNegate): (KJS::CodeGenerator::emitBitNot): (KJS::CodeGenerator::emitNot):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::UnaryPlusNode::emitCode): (KJS::NegateNode::emitCode): (KJS::BitwiseNotNode::emitCode): (KJS::LogicalNotNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33096] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Maciej Stachowiak.

Add support for LogicalAndNode and LogicalOrNode.

  • kjs/nodes.cpp: (KJS::LogicalAndNode::emitCode): (KJS::LogicalOrNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33095] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Sam Weinig <sam@webkit.org>

Clean up code and debug output.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:52 PM Changeset in webkit [33094] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Geoffrey Garen <ggaren@apple.com>

Moved an ASSERT to a more logical place.

  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:52 PM Changeset in webkit [33093] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Sam Weinig <sam@webkit.org>

Reviewed by Oliver Hunt.

Add emitCode support for InstanceOfNode.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitInstanceOf):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::InstanceOfNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33092] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

Bug 18142: squirrelfish needs to support dynamic scoping/with
<http://bugs.webkit.org/show_bug.cgi?id=18142>

Reviewed by Maciej

Add support for dynamic scoping and add code to handle 'with'
statements.

10:52 PM Changeset in webkit [33091] by mrowe@apple.com
  • 8 edits in branches/squirrelfish/JavaScriptCore

2008-03-27 Sam Weinig <sam@webkit.org>

Reviewed by Geoffrey Garen.

Add emitCode support for NullNode, FalseNode, TrueNode, IfNode, IfElseNode, DoWhileNode and WhileNode

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump): Dump op_jfalse opcode.
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitJumpIfFalse): Identical to emitJumpIfTrue except it emits the op_jfalse opcode. (KJS::CodeGenerator::emitLoad): Add and emitLoad override for booleans.
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::Machine::privateExecute): Adds execution of op_jfalse. It is identical to op_jtrue, except the the condition is reversed.
  • VM/Opcode.h: Add op_jfalse.
  • kjs/nodes.cpp: (KJS::NullNode::emitCode): Added. (KJS::FalseNode::emitCode): Added. (KJS::TrueNode::emitCode): Added. (KJS::IfNode::emitCode): Added. (KJS::IfElseNode::emitCode): Added. (KJS::DoWhileNode::emitCode): Added. (KJS::WhileNode::emitCode): Added.
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33090] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Nixed an unused List.

The calm before my stormy war against the List class.

  • kjs/function_object.cpp: (KJS::FunctionObjectImp::construct):
10:52 PM Changeset in webkit [33089] by mrowe@apple.com
  • 5 edits
    9 adds in branches/squirrelfish

SunSpider:

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

--squirrelfish mode: pared down tests for squirrelfish to chew on.

  • sunspider:
  • tests/LIST:
  • tests/squirrelfish: Added.
  • tests/squirrelfish/function-closure.js: Added.
  • tests/squirrelfish/function-empty.js: Added.
  • tests/squirrelfish/function-missing-args.js: Added.
  • tests/squirrelfish/function-sum.js: Added.
  • tests/squirrelfish/loop-empty-resolve.js: Added.
  • tests/squirrelfish/loop-empty.js: Added.
  • tests/squirrelfish/loop-resolve.js: Added.
  • tests/squirrelfish/loop-sum.js: Added.

WebKitTools:

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

--squirrelfish mode: pared down tests for squirrelfish to chew on.

  • Scripts/run-sunspider:
10:52 PM Changeset in webkit [33088] by mrowe@apple.com
  • 9 edits in branches/squirrelfish/JavaScriptCore

2008-03-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoffrey Garen.

Adds support for EqualNode, NotEqualNode, StrictEqualNode, NotStrictEqualNode,
LessEqNode, GreaterNode, GreaterEqNode, MultNode, DivNode, ModNode, SubNode,
LeftShiftNode, RightShiftNode, UnsignedRightShiftNode, BitAndNode, BitXOrNode,
and BitOrNode.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::emitEqual): (KJS::CodeGenerator::emitNotEqual): (KJS::CodeGenerator::emitStrictEqual): (KJS::CodeGenerator::emitNotStrictEqual): (KJS::CodeGenerator::emitLessEq): (KJS::CodeGenerator::emitMult): (KJS::CodeGenerator::emitDiv): (KJS::CodeGenerator::emitMod): (KJS::CodeGenerator::emitSub): (KJS::CodeGenerator::emitLeftShift): (KJS::CodeGenerator::emitRightShift): (KJS::CodeGenerator::emitUnsignedRightShift): (KJS::CodeGenerator::emitBitAnd): (KJS::CodeGenerator::emitBitXOr): (KJS::CodeGenerator::emitBitOr):
  • VM/CodeGenerator.h:
  • VM/Machine.cpp: (KJS::jsLessEq): (KJS::Machine::privateExecute):
  • VM/Opcode.h:
  • kjs/nodes.cpp: (KJS::MultNode::emitCode): (KJS::DivNode::emitCode): (KJS::ModNode::emitCode): (KJS::SubNode::emitCode): (KJS::LeftShiftNode::emitCode): (KJS::RightShiftNode::emitCode): (KJS::UnsignedRightShiftNode::emitCode): (KJS::GreaterNode::emitCode): (KJS::LessEqNode::emitCode): (KJS::GreaterEqNode::emitCode): (KJS::EqualNode::emitCode): (KJS::NotEqualNode::emitCode): (KJS::StrictEqualNode::emitCode): (KJS::NotStrictEqualNode::emitCode): (KJS::BitAndNode::emitCode): (KJS::BitXOrNode::emitCode): (KJS::BitOrNode::emitCode):
  • kjs/nodes.h:
10:52 PM Changeset in webkit [33087] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Only print debug dumps in debug builds.

  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::generate):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
10:52 PM Changeset in webkit [33086] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Moved a few files around in the XCode project.

10:52 PM Changeset in webkit [33085] by mrowe@apple.com
  • 11 edits
    2 adds in branches/squirrelfish/JavaScriptCore

2008-03-26 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Made closures work.

An activation object aliases to the register file until its associated
function returns, at which point it copies the registers for locals and
parameters into an independent storage buffer.

10:51 PM Changeset in webkit [33084] by mrowe@apple.com
  • 3 edits in branches/squirrelfish/JavaScriptCore

2008-03-24 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed recent 25% regression on simple for loop test. GCC seems to be
very finicky about the code that gets inlined into
Machine::privateExecute.

Everything in this patch is simply the result of experiment.

The resolve and resolve_base opcodes do not seem to have gotten slower
from this change.

  • VM/Machine.cpp: (KJS::resolve): (KJS::resolveBase): (KJS::Machine::privateExecute):
  • kjs/nodes.h:
10:51 PM Changeset in webkit [33083] by mrowe@apple.com
  • 5 edits in branches/squirrelfish/JavaScriptCore

Bug 18059: squirrelfish needs to compile on platforms without computed goto
<http://bugs.webkit.org/show_bug.cgi?id=18059>

Reviewed by Geoff Garen

"Standard" macro style support for conditionalising the use of computed goto.

10:51 PM Changeset in webkit [33082] by mrowe@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-03-24 Geoffrey Garen <ggaren@apple.com>

Moved my notes from nodes.h to the wiki.

  • kjs/nodes.h:
10:51 PM Changeset in webkit [33081] by mrowe@apple.com
  • 9 edits
    10 copies
    7 adds in branches/squirrelfish/JavaScriptCore

2008-03-24 Geoffrey Garen <ggaren@apple.com>

Reviewed by NOBODY.

SquirrelFish lives.

Initial check-in of the code I've been carrying around. Lots of stuff
doesn't work. Plus a bunch of empty files.

10:37 PM Changeset in webkit [33080] by mrowe@apple.com
  • 1 copy in branches/squirrelfish

Re-create squirrelfish branch.

10:36 PM Changeset in webkit [33079] by mrowe@apple.com
  • 1 move in branches/old/squirrelfish-2008-05-12

Move aside squirrelfish branch in prepration for rebasing it on trunk.

7:04 PM Changeset in webkit [33078] by mitz@apple.com
  • 2 edits in trunk/WebKit/win
  • build fix
  • Interfaces/WebKit.idl: Touched.
6:11 PM Changeset in webkit [33077] by Adam Roben
  • 2 edits in trunk/WebCore

Turn on warnings as errors in WebCore.vcproj

Rubberstamped by Anders Carlsson.

  • WebCore.vcproj/WebCore.vcproj: Also let VS reformat the file as it saw fit. The important part is the removal of the WarnAsError="false" lines.
6:10 PM Changeset in webkit [33076] by Adam Roben
  • 6 edits
    3 adds in trunk

Fix a MSVC warning in PluginViewWin

WebCore:

Fix a MSVC warning in PluginViewWin

Reviewed by Anders Carlsson.

Test: http/tests/plugins/post-url-file.html

  • plugins/win/PluginViewWin.cpp: (WebCore::PluginView::handlePostReadFile): Added a missing return statement.

WebKitTools:

Support for testing NPN_PostURL

Reviewed by Anders Carlsson.

  • DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (toCString): Added this helper function. (testPostURLFile): Added. Writes the passed-in content to the passed-in file and calls NPN_PostURL with the passed-in URL and target. (pluginInvoke): Added a case for testPostURLFile.
  • DumpRenderTree/win/LayoutTestControllerWin.cpp: (followShortcuts): Changed to allow paths that don't yet exist.

LayoutTests:

Test that NPN_PostURL works correctly

Reviewed by Anders Carlsson.

  • http/tests/plugins/post-url-file-expected.txt: Added.
  • http/tests/plugins/post-url-file.html: Added.
  • http/tests/plugins/resources/dump-post.pl: Added.
6:10 PM Changeset in webkit [33075] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in GetEOTHeader

Reviewed by Dan Bernstein.

  • platform/graphics/win/GetEOTHeader.cpp: (WebCore::getEOTHeader): MSVC complains that having a 0-sized array in a struct is a non-standard extension. I've replaced the 0-sized arrays with arrays of 1 element, and replaced sizeof(structType) with offsetof(structType, arrayMember).
6:09 PM Changeset in webkit [33074] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in TextCodecICU

Reviewed by John Sullivan and Dan Bernstein.

  • platform/text/TextCodecICU.cpp: (WebCore::ErrorCallbackSetter::~ErrorCallbackSetter): UCNV_SUB_STOP_ON_ILLEGAL is a string literal, so using == with it doesn't really do what we want. Use strcmp instead. It's OK to pass an unknown value to strcmp here since 1) UCNV_SUB_STOP_ON_ILLEGAL is only a single character long so we're not going to ready more than 2 bytes from oldContext, and 2) we're inside an ASSERT which will cause a crash anyway if it fails.
6:09 PM Changeset in webkit [33073] by Adam Roben
  • 2 edits in trunk/WebKitLibraries

Disable a MSVC warning

Reviewed by Darin Adler.

  • win/tools/vsprops/common.vsprops: Add warning 4503 to the list of disabled warnings. It's a warning about decorated names being longer than MSVC's limit of 4096 characters. This warning doesn't indicate a correctness problem, but these truncated decorated names will be harder to recognize during debugging or when they appear in linker errors.
6:08 PM Changeset in webkit [33072] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in CSSComputedStyleDeclaration

Reviewed by Geoff Garen.

  • css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForRepeatRule): Removed some unreachable code.
6:08 PM Changeset in webkit [33071] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in InlineTextBox

Reviewed by Dan Bernstein.

  • rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Initialize some variables that MSVC isn't smart enough to figure out will always be initialized in the cases where they are used.
6:07 PM Changeset in webkit [33070] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in Position

Reviewed by Darin Adler.

  • dom/Position.cpp: (WebCore::Position::getInlineBoxAndOffset): Use parentheses to make the precedence of our expressions explicit.
6:07 PM Changeset in webkit [33069] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in String

Reviewed by Geoff Garen.

  • platform/text/String.cpp: (WebCore::toIntegralType): Disable a bogus warning about using unary - on an unsigned value. MSVC isn't smart enough to figure out that isNegative will always be false when value is unsigned.
6:06 PM Changeset in webkit [33068] by Adam Roben
  • 2 edits in trunk/WebCore

Fix a MSVC warning in XMLHttpRequest

Reviewed by Geoff Garen.

  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): Added static_cast<unsigned long>.
5:28 PM Changeset in webkit [33067] by andersca@apple.com
  • 3 edits
    3 adds in trunk

WebCore:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Handle the case when a resource with the same URL as the manifest is listed in the manifest.

  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::addEntry):

LayoutTests:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Add test with a manifest file that lists itself.


  • http/tests/appcache/manifest-containing-itself-expected.txt: Added.
  • http/tests/appcache/manifest-containing-itself.html: Added.
  • http/tests/appcache/resources/manifest-containing-itself.manifest: Added.
5:23 PM Changeset in webkit [33066] by oliver@apple.com
  • 5 edits
    3 adds in branches/squirrelfish

Bug 18934: SQUIRRELFISH: ASSERT @ nytimes.com due to RegisterFile being clobbered
<https://bugs.webkit.org/show_bug.cgi?id=18934>

Reviewed by Geoff

Unfortunately we cannot create new statically optimised globals if there are any
tainted RegisterFiles on the RegisterFileStack. To handle this we re-introduce
(in a slightly cleaner form) the inImplicitCall concept to the RegisterFileStack.

5:14 PM Changeset in webkit [33065] by weinig@apple.com
  • 7 edits in trunk/WebCore

2008-05-12 Sam Weinig <sam@webkit.org>

Reviewed by Dan Bernstein.

Add parsing of AccessControlHeader and AccessItemRule.

  • xml/AccessControlList.cpp: (WebCore::AccessControlList::parseAccessControlHeader): When multiple http headers are sent in the response, the engine will concatenate them with commas separating the rules. This simply reverses that process by splitting on the commas. (WebCore::AccessControlList::show):
  • xml/AccessControlList.h:
  • xml/AccessItem.cpp: (WebCore::AccessItem::AccessItem): (WebCore::AccessItem::show):
  • xml/AccessItem.h: (WebCore::AccessItem::isValid):
  • xml/AccessItemRule.cpp: (WebCore::skipLWS): (WebCore::AccessItemRule::parseAccessItemRule): Parse the rule according to the BNF provided by the Access Control spec. (WebCore::AccessItemRule::parsePatternList): (WebCore::AccessItemRule::invalidate): (WebCore::AccessItemRule::show):
  • xml/AccessItemRule.h:
4:34 PM Changeset in webkit [33064] by ggaren@apple.com
  • 5 edits
    2 adds in branches/squirrelfish

JavaScriptCore:

2008-05-12 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.


Introduced support for function.caller.


Improved support for walking interesting scopes for function introspection.


This fixes all remaining layout tests not blocked by rebasing to trunk.


SunSpider reports no change.

  • VM/Machine.cpp: (KJS::Machine::dumpRegisters): Fixed a spacing issue.

LayoutTests:

2008-05-12 Geoffrey Garen <ggaren@apple.com>

Reviewed by Maciej Stachowiak.


Layout test for function.arguments and function.caller in interesting
scopes.

  • fast/js/function-dot-arguments-and-caller-expected.txt: Added.
  • fast/js/function-dot-arguments-and-caller.html: Added.
4:06 PM Changeset in webkit [33063] by ddkilzer@apple.com
  • 2 edits in trunk/WebCore

Fix logic error in DocLoader::clearPreloads()

Reviewed by Antti.

  • loader/DocLoader.cpp: (WebCore::DocLoader::clearPreloads): Be sure to decrease the preload count for the cached resource before trying to remove it from the cache. A non-zero preload count can prevent the resource from being removed from the cache.
3:51 PM Changeset in webkit [33062] by mrowe@apple.com
  • 2 edits in trunk/WebKitTools

Minor cleanup of the DRT Xcode project.

Reviewed by Sam Weinig.

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Use GCC_OPTIMIZATION_LEVEL rather than

OPTIMIZATION_CFLAGS. Don't include Info.plist in the "Copy Bundle Resources" build phase as it does
not need to be there.

3:48 PM Changeset in webkit [33061] by andersca@apple.com
  • 3 edits
    3 adds in trunk

WebCore:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Handle empty manifest files without crashing.


  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::startLoadingEntry):

LayoutTests:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

  • http/tests/appcache/empty-manifest-expected.txt: Added.
  • http/tests/appcache/empty-manifest.html: Added.
  • http/tests/appcache/resources/empty.manifest: Added.
3:23 PM Changeset in webkit [33060] by alp@webkit.org
  • 2 edits in trunk/WebCore

2008-05-12 Alp Toker <alp@nuanti.com>

GTK+ build fix for breakage in r33056. Include limits.h for INT_MAX.

  • platform/graphics/FontCache.h:
3:22 PM Changeset in webkit [33059] by andersca@apple.com
  • 2 edits in trunk/LayoutTests

2008-05-12 Anders Carlsson <andersca@apple.com>

Update the expected result.


  • http/tests/appcache/simple-expected.txt:
3:11 PM Changeset in webkit [33058] by andersca@apple.com
  • 3 edits in trunk/WebCore

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Add user agent to requests when loading/updating the cache.


  • loader/FrameLoader.h:
  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::update): (WebCore::ApplicationCacheGroup::startLoadingEntry):
2:11 PM Changeset in webkit [33057] by andersca@apple.com
  • 11 edits
    7 adds in trunk

WebCore:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Make it possible to perform synchronous loads from the application cache.


  • loader/DocumentLoader.cpp: (WebCore::DocumentLoader::shouldLoadResourceFromApplicationCache): Factor out code from scheduleApplicationCacheLoad in its own method.


(WebCore::DocumentLoader::scheduleApplicationCacheLoad):
Call shouldLoadResourceFromApplicationCache here instead.


  • loader/DocumentLoader.h:


  • loader/FrameLoader.cpp: (WebCore::FrameLoader::loadResourceSynchronously): Call shouldLoadResourceFromApplicationCache.

WebKitTools:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Add support for testing application caches.


  • DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): Empty the cache.


(resetWebViewToConsistentStateBeforeTesting):
Turn on support for the application cache.

LayoutTests:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Adam.

Add simple appcache test.

  • http/conf/mime.types:
  • http/tests/appcache: Added.
  • http/tests/appcache/resources: Added.
  • http/tests/appcache/resources/not-in-cache.txt: Added.
  • http/tests/appcache/resources/simple.manifest: Added.
  • http/tests/appcache/resources/simple.txt: Added.
  • http/tests/appcache/simple-expected.txt: Added.
  • http/tests/appcache/simple.html: Added.
  • platform/gtk/Skipped:
  • platform/qt/Skipped:
  • platform/win/Skipped:
2:02 PM Changeset in webkit [33056] by mitz@apple.com
  • 18 edits in trunk

WebCore:

Reviewed by Ada Chan and Sam Weinig.

Added a way for clients to let the cache know that they no longer need
font data, which lets the cache release it. Changed clients to track
most of the font data they get from the cache so that they can later
release it. Some instances of font data -- namely, those used for system
font fallback -- are still not tracked and will therefore remain in the
cache indefinitely.

  • WebCore.base.exp: Added exports for WebCoreStatistics in WebKit.
  • platform/graphics/Font.cpp: (WebCore::Font::Font): Changed to use FontFallbackList::create(). (WebCore::Font::update): Ditto.
  • platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontData): Added code to track the number of times a SimpleFontData instance has been requested from the cache, remove requested instances from the inactive list, and purge inactive font data if the inactive list has grown above its maximum allowed size. (WebCore::FontCache::releaseFontData): Added. Called by clients to let the cache know that they no longer need the font data. Adds the font data to the inactive list if the last client has released it. (WebCore::FontCache::purgeInactiveFontData): Added. Removes inactive font data from the cache (and the inactive list). (WebCore::FontCache::fontDataCount): Added to provide statistics. (WebCore::FontCache::inactiveFontDataCount): Ditto.
  • platform/graphics/FontCache.h:
  • platform/graphics/FontData.h: (WebCore::FontData::FontData): Added a member variable to store the highest glyph page tree level in which there is a node for this FontData. This is used to limit the depth of the search when pruning glyph page trees. (WebCore::FontData::setMaxGlyphPageTreeLevel): Added this accessor. (WebCore::FontData::maxGlyphPageTreeLevel): Ditto.
  • platform/graphics/FontFallbackList.cpp: (WebCore::FontFallbackList::FontFallbackList): Changed to start with a refcount of 1. (WebCore::FontFallbackList::invalidate): Added a call to releaseFontData(). (WebCore::FontFallbackList::releaseFontData): Added. Lets the font cache know that we no longer need the FontData in our font list. (WebCore::FontFallbackList::fontDataAt): Changed to record in the font list whether the font data is a custom font data or not. (WebCore::FontFallbackList::setPlatformFont): Ditto.
  • platform/graphics/FontFallbackList.h: (WebCore::FontFallbackList::create): Added and made the constructor private. (WebCore::FontFallbackList::~FontFallbackList): Added a call to releaseFontData().
  • platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::treeGlyphPageCount): Added to provide statistics. (WebCore::GlyphPageTreeNode::pageCount): Ditto.

(WebCore::GlyphPageTreeNode::pruneTreeFontData): Added.
(WebCore::GlyphPageTreeNode::getChild): Added code to update the font
data's maximum glyph page tree level.
(WebCore::GlyphPageTreeNode::pruneFontData): Added.

  • platform/graphics/GlyphPageTreeNode.h:
  • platform/graphics/SimpleFontData.cpp: (WebCore::SimpleFontData::~SimpleFontData): Added code to let the font cache know that we no longer need the small caps font data and to prune the glyph page trees.

WebKit/mac:

Reviewed by Ada Chan.

Added font cache statistics and a function to purge inactive font data.

  • Misc/WebCoreStatistics.h:
  • Misc/WebCoreStatistics.mm: (+[WebCoreStatistics cachedFontDataCount]): (+[WebCoreStatistics cachedFontDataInactiveCount]): (+[WebCoreStatistics purgeInactiveFontData]): (+[WebCoreStatistics glyphPageCount]):

WebKit/win:

Reviewed by Ada Chan.

Added font cache statistics and a function to purge inactive font data.

  • Interfaces/IWebCoreStatistics.idl:
  • WebCoreStatistics.cpp: (WebCoreStatistics::cachedFontDataCount): (WebCoreStatistics::cachedFontDataInactiveCount): (WebCoreStatistics::purgeInactiveFontData): (WebCoreStatistics::glyphPageCount):
  • WebCoreStatistics.h:
2:01 PM Changeset in webkit [33055] by mrowe@apple.com
  • 3 edits in trunk/WebKit/mac

Decorate some deprecated delegate methods with the availability macros.

The compiler doesn't appear to warn if a delegate implements these methods, but using the availability
macros is good for consistency and documentation.

Reviewed by Tim Hatcher.

  • WebView/WebFrameLoadDelegate.h:
  • WebView/WebUIDelegate.h:
2:01 PM Changeset in webkit [33054] by mrowe@apple.com
  • 3 edits in trunk/WebKit/mac

<rdar://problem/5835604> Deprecate HIWebView

Use of HIWebView is deprecated in favor of embedding a WebView in a HICocoaView.

Reviewed by Tim Hatcher.

  • Carbon/CarbonUtils.h: Include the availability macro header and decorate the functions appropriately.
  • Carbon/HIWebView.h: Ditto.
2:01 PM Changeset in webkit [33053] by mrowe@apple.com
  • 2 edits
    1 add in trunk/JavaScriptCore

<rdar://problem/4859666> WebKit needs availability macros in order to deprecate APIs

Create WebKit availability macros that key off the Mac OS X version being targeted to
determine the WebKit version being targeted. Applications can define
WEBKIT_VERSION_MIN_REQUIRED before including WebKit headers in order to target a specific
version of WebKit.

The availability header is being added to JavaScriptCore rather than WebKit as JavaScriptCore
is the lowest-level portion of the public WebKit API.

Reviewed by Tim Hatcher.

  • API/WebKitAvailability.h: Added.
  • JavaScriptCore.xcodeproj/project.pbxproj:
1:50 PM Changeset in webkit [33052] by kdecker@apple.com
  • 7 edits in trunk/WebKit/mac

Reviewed by Anders.

Fixed: <rdar://problem/5840884>_recursive_resumeNullEventsForAllNetscapePlugins and _pauseNullEvents not defined


Re-added these SPI methods because they are needed by some clients. They were accidentally removed
in changeset <http://trac.webkit.org/changeset/31028>


  • Plugins/WebBaseNetscapePluginView.h: Added stopTimers, restartTimers to the header.
  • WebView/WebFrame.mm: (-[WebFrame _recursive_resumeNullEventsForAllNetscapePlugins]): Re-addd. (-[WebFrame _recursive_pauseNullEventsForAllNetscapePlugins]): Ditto.
  • WebView/WebFrameInternal.h: Ditto.
  • WebView/WebHTMLView.mm: Ditto. (-[WebHTMLView _pauseNullEventsForAllNetscapePlugins]): Ditto. (-[WebHTMLView _resumeNullEventsForAllNetscapePlugins]): Ditto.
  • WebView/WebHTMLViewInternal.h: Ditto.
  • WebView/WebHTMLViewPrivate.h: Ditto.
1:13 PM Changeset in webkit [33051] by andersca@apple.com
  • 11 edits in trunk

WebCore:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Alexey.

Add ApplicationCacheStorage::empty() method which will empty
the application cache database.


  • WebCore.base.exp:
  • loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::clearStorageID):
  • loader/appcache/ApplicationCache.h:
  • loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::clearStorageID):
  • loader/appcache/ApplicationCacheGroup.h:
  • loader/appcache/ApplicationCacheResource.h: (WebCore::ApplicationCacheResource::clearStorageID):
  • loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::empty):
  • loader/appcache/ApplicationCacheStorage.h:

WebKit/mac:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Alexey.

Empty the application cache when changing the cache model.


  • WebView/WebView.mm: (+[WebView _setCacheModel:]):
11:34 AM Changeset in webkit [33050] by andersca@apple.com
  • 1 edit
    8 adds in trunk/WebKitExamplePlugins

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Alexey.

Add input method test plug-in.


  • NetscapeInputMethodPlugin: Added.
  • NetscapeInputMethodPlugin/English.lproj: Added.
  • NetscapeInputMethodPlugin/English.lproj/InfoPlist.strings: Added.
  • NetscapeInputMethodPlugin/Info.plist: Added.
  • NetscapeInputMethodPlugin/NetscapeInputMethodPlugin.xcodeproj: Added.
  • NetscapeInputMethodPlugin/NetscapeInputMethodPlugin.xcodeproj/project.pbxproj: Added.
  • NetscapeInputMethodPlugin/main.m: Added. (NP_Initialize): (NP_GetEntryPoints): (NP_Shutdown): (NPP_New): (NPP_Destroy): (NPP_SetWindow): (NPP_NewStream): (NPP_DestroyStream): (NPP_WriteReady): (NPP_Write): (NPP_StreamAsFile): (NPP_Print): (handleDraw): (invalidatePlugin): (handleFocusChanged): (handleMouseMoved): (handleMouseDown): (NPP_HandleEvent): (NPP_URLNotify): (selectionRange): (NPP_InsertText): (NPP_DoCommandBySelector): (markedTextAttributes): (NPP_SetMarkedText): (NPP_UnmarkText): (NPP_HasMarkedText): (NPP_AttributedSubstringFromRange): (NPP_MarkedRange): (NPP_SelectedRange): (NPP_FirstRectForCharacterRange): (pluginTextInputFuncs): (NPP_GetValue): (NPP_SetValue):
  • NetscapeInputMethodPlugin/test.html: Added.
10:41 AM Changeset in webkit [33049] by andersca@apple.com
  • 8 edits
    1 copy in trunk/WebKit

WebKit:

2008-05-09 Anders Carlsson <andersca@apple.com>

Reviewed by Oliver.

<rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins


Add nptextinput.h as a public header.


  • WebKit.xcodeproj/project.pbxproj:

WebKit/mac:

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Oliver.

<rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins


  • Plugins/WebBaseNetscapePluginView.h:
  • Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): Get the plug-in text input vtable pointer.


(-[WebBaseNetscapePluginView stop]):
Set the plug-in text input vtable pointer to 0.


(-[WebBaseNetscapePluginView inputContext]):
Return 0 for Carbon plug-ins since we don't want Cocoa to handle text input for them.


(-[WebBaseNetscapePluginView hasMarkedText]):
(-[WebBaseNetscapePluginView insertText:]):
(-[WebBaseNetscapePluginView markedRange]):
(-[WebBaseNetscapePluginView selectedRange]):
(-[WebBaseNetscapePluginView setMarkedText:selectedRange:]):
(-[WebBaseNetscapePluginView unmarkText]):
(-[WebBaseNetscapePluginView validAttributesForMarkedText]):
(-[WebBaseNetscapePluginView attributedSubstringFromRange:]):
(-[WebBaseNetscapePluginView characterIndexForPoint:]):
(-[WebBaseNetscapePluginView doCommandBySelector:]):
(-[WebBaseNetscapePluginView firstRectForCharacterRange:]):
(-[WebBaseNetscapePluginView conversationIdentifier]):
Implement NSTextInput and call into the plug-in text input vtable.


(browserTextInputFuncs):
New method which returns the browser input vtable.


(-[WebBaseNetscapePluginView getVariable:value:]):
Support getting the browser input vtable pointer.


  • Plugins/WebNetscapePluginEventHandlerCocoa.h:
  • Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::keyDown): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): If the plug-in returns 0 when a NPCocoaEventKeyDown is passed to NPP_HandleEvent, it means that the event should be passed on to the input manager.


  • Plugins/npapi.mm: (NPN_MarkedTextAbandoned): (NPN_MarkedTextSelectionChanged): Add implementations of browser input method methods.


  • Plugins/nptextinput.h: Added. Add file with new text input API.
10:29 AM Changeset in webkit [33048] by andersca@apple.com
  • 2 edits in trunk/WebCore

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by John.

Don't throw an exception if the string passed in is an invalid URL.


  • loader/appcache/DOMApplicationCache.cpp: (WebCore::DOMApplicationCache::remove):
10:11 AM Changeset in webkit [33047] by andersca@apple.com
  • 2 edits in trunk/WebCore

2008-05-12 Anders Carlsson <andersca@apple.com>

Reviewed by Mitz.

Add the variable enums for getting the input vtables.


  • bridge/npapi.h:
9:35 AM Changeset in webkit [33046] by Adam Roben
  • 2 edits in trunk/WebKit/win

Build fix

  • WebKitPrefix.cpp: Touch this so that it will rebuild after ENABLE_CROSS_DOCUMENT_MESSAGING was removed.
9:31 AM Changeset in webkit [33045] by Adam Roben
  • 2 edits in trunk/WebCore

Windows build fix

  • WebCorePrefix.cpp: Touched this so that it will rebuild now that ENABLE_CROSS_DOCUMENT_MESSAGING has been removed.
2:53 AM Changeset in webkit [33044] by mjs@apple.com
  • 2 edits in trunk/WebKitSite

2008-05-12 Maciej Stachowiak <mjs@apple.com>

Ooops, I made some mistakes trying to fix the validation errors. This time for sure.

  • demos/transitions-and-transforms/index.html:
2:45 AM Changeset in webkit [33043] by mjs@apple.com
  • 2 edits in trunk/WebKitSite

2008-05-12 Maciej Stachowiak <mjs@apple.com>

Make the demo valid HTML5 (according to validator.nu) and add alt text to the images.

  • demos/transitions-and-transforms/index.html:
2:10 AM Changeset in webkit [33042] by mjs@apple.com
  • 2 edits in trunk/WebKitSite

2008-05-12 Maciej Stachowiak <mjs@apple.com>

Tweaked demo visuals slightly.

  • demos/transitions-and-transforms/leopard.css:
12:43 AM Changeset in webkit [33041] by mjs@apple.com
  • 2 edits in trunk/WebKitSite

2008-05-12 Maciej Stachowiak <mjs@apple.com>

Tweak CSS to look a little better while loading.

  • demos/transitions-and-transforms/leopard.css:
12:39 AM Changeset in webkit [33040] by mjs@apple.com
  • 1 edit
    11 adds in trunk/WebKitSite

2008-05-12 Maciej Stachowiak <mjs@apple.com>

Not reviewed - new demo.


Added a demo of CSS Transforms and Transitions.

  • demos/transitions-and-transforms: Added.
  • demos/transitions-and-transforms/Finder Coverflow.png: Added.
  • demos/transitions-and-transforms/Horsehead.png: Added.
  • demos/transitions-and-transforms/Mail Stationery.png: Added.
  • demos/transitions-and-transforms/Quick Look.png: Added.
  • demos/transitions-and-transforms/Spaces.png: Added.
  • demos/transitions-and-transforms/Stacks.png: Added.
  • demos/transitions-and-transforms/Time Machine.png: Added.
  • demos/transitions-and-transforms/index.html: Added.
  • demos/transitions-and-transforms/leopard.css: Added.
  • demos/transitions-and-transforms/no-style.html: Added.
12:36 AM Changeset in webkit [33039] by ap@webkit.org
  • 2 edits in trunk/JavaScriptCore

Reviewed by Maciej.

https://bugs.webkit.org/show_bug.cgi?id=18828
Reproducible crash with PAC file

Naively moving JavaScriptCore into thread-specific data was inappropriate in the face of
exiting JavaScriptCore API clients, which expect a different therading model. Temporarily
disabling ThreadSpecific implementation until this can be sorted out.

  • wtf/ThreadSpecific.h:
12:12 AM Changeset in webkit [33038] by ap@webkit.org
  • 133 edits in trunk

Roll out recent threading changes (r32807, r32810, r32819, r32822) to simplify
SquirrelFish merging.

May 11, 2008:

10:14 PM Changeset in webkit [33037] by kevino@webkit.org
  • 2 edits in trunk/WebKit/wx

Previous commit made bdash sad. Restore happiness state by fixing missed style issue.

10:06 PM Changeset in webkit [33036] by kevino@webkit.org
  • 5 edits in trunk/WebKit/wx

Reviewed by Kevin Ollivier.

Fix scrolling issues by implementing transitionToCommittedNewPage() so the scroll positions are reset when a new page is loaded, and also maintained so that back and next restore the scroll positions as well. This also simplifies the logic for initializing and managing wxWebView.

https://bugs.webkit.org/show_bug.cgi?id=18992

9:58 PM Changeset in webkit [33035] by kevino@webkit.org
  • 2 edits in trunk/WebCore

Reviewed by Kevin Ollivier.

Since wx popup menus dismiss themselves when an item is selected we need to call hidePopup so webkit's internal state is correct.

https://bugs.webkit.org/show_bug.cgi?id=19000

5:34 PM Changeset in webkit [33034] by weinig@apple.com
  • 4 edits
    1 add in trunk/WebCore

2008-05-11 Sam Weinig <sam@webkit.org>

Reviewed by Mark Rowe.

Move some generic parsing functions into a new ParserUtilities header so that
they can be used for non-SVG builds too.

  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/text/ParserUtilities.h: Added. (WebCore::skipString):
  • svg/SVGParserUtilities.h: (WebCore::isWhitespace): (WebCore::skipOptionalSpaces): (WebCore::skipOptionalSpacesOrDelimiter):
1:26 PM Changeset in webkit [33033] by weinig@apple.com
  • 6 edits
    6 adds in trunk/WebCore

2008-05-11 Sam Weinig <sam@webkit.org>

Reviewed by Dan Bernstein.

Add scaffolding for the implementation of Access Control for Cross-site Requests.

  • GNUmakefile.am:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • WebCoreSources.bkl:
  • xml/AccessControlList.cpp: Added. (WebCore::AccessControlList::AccessControlList): (WebCore::AccessControlList::~AccessControlList): (WebCore::AccessControlList::parseAccessControlHeader): (WebCore::AccessControlList::checkOrigin):
  • xml/AccessControlList.h: Added.
  • xml/AccessItem.cpp: Added. (WebCore::AccessItem::AccessItem): (WebCore::AccessItem::parseAccessItem): (WebCore::AccessItem::matches):
  • xml/AccessItem.h: Added.
  • xml/AccessItemRule.cpp: Added. (WebCore::AccessItemRule::AccessItemRule): (WebCore::AccessItemRule::parseAccessItemRule):
  • xml/AccessItemRule.h: Added.
9:36 AM Changeset in webkit [33032] by jchaffraix@webkit.org
  • 2 edits in trunk/WebCore

2008-05-11 Julien Chaffraix <jchaffraix@webkit.org>

Debug build fix.

  • loader/appcache/ApplicationCache.cpp: Include stdio.h as we are using printf in ApplicationCache::dump().
4:15 AM Changeset in webkit [33031] by cwzwarich@webkit.org
  • 3 edits
    3 adds in branches/squirrelfish

2008-05-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Oliver.

Bug 18961: SQUIRRELFISH: Gmail doesn't load
<https://bugs.webkit.org/show_bug.cgi?id=18961>

Fix codegen for logical nodes so that they don't use their destination
as a temporary.

  • kjs/nodes.cpp: (KJS::LogicalAndNode::emitCode): (KJS::LogicalOrNode::emitCode):
  • fast/js/codegen-temporaries-expected.txt: Added.
  • fast/js/codegen-temporaries.html: Added.
  • fast/js/resources/codegen-temporaries.js: Added.

May 10, 2008:

7:28 PM Changeset in webkit [33030] by mitz@apple.com
  • 3 edits in trunk/WebCore

Reviewed by Jessica Kahn.

  • add a copy assignment operator to FontPlatformData on Mac to properly retain the m_font data member.
  • platform/graphics/mac/FontPlatformData.h:
  • platform/graphics/mac/FontPlatformDataMac.mm: (WebCore::FontPlatformData::FontPlatformData): (WebCore::~FontPlatformData): (WebCore::FontPlatformData::operator=): (WebCore::FontPlatformData::setFont):
3:01 PM Changeset in webkit [33029] by adele@apple.com
  • 2 edits in trunk/WebCore

2008-05-10 Adele Peterson <adele@apple.com>

Reviewed by Tim Hatcher.

Fix crash for WebKit clients that don't set a group name for the WebView/Page.

  • page/PageGroup.cpp: (WebCore::PageGroup::PageGroup): Instead of adding the Page directly to the group, call the addPage method, since it does extra work initializing m_localStorage.
2:18 PM Changeset in webkit [33028] by mjs@apple.com
  • 1 edit
    1 add in branches/squirrelfish/WebCore

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Build fix.


  • add missing forwarding header
  • ForwardingHeaders/kjs/SourceProvider.h: Added.
1:36 PM Changeset in webkit [33027] by mjs@apple.com
  • 38 edits
    3 adds in branches/squirrelfish

JavaScriptCore:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


Three layout tests are fixed:

fast/js/toString-elision-trailing-comma.html
fast/js/toString-prefix-postfix-preserve-parens.html
fast/js/kde/lval-exceptions.html


Functions now save a shared subrange of the original source used
to make them (so in the common case this adds no storage above the
memory cache).


  • kjs/SourceProvider.h: Added. (KJS::SourceProvider): New abstract base class for classes that provide on-demand access to the source for a JavaScript program. This allows function objects to have access to their original source without copying. (KJS::UStringSourceProvider): SourceProvider subclass backed by a KJS::UString. (KJS::UStringSourceProvider::create): (KJS::UStringSourceProvider::getRange): (KJS::UStringSourceProvider::data): (KJS::UStringSourceProvider::length): (KJS::UStringSourceProvider::UStringSourceProvider):
  • kjs/SourceRange.h: Added. (KJS::SourceRange::SourceRange): Class that holds a SourceProvider and a character range into the source, to encapsulate on-demand access to the source of a function. (KJS::SourceRange::toString):
  • VM/Machine.cpp: (KJS::eval): Pass a UStringSourceProvider to the parser.
  • kjs/Parser.cpp: (KJS::Parser::parse): Take a SourceProvider and pass it on to the lexer.
  • kjs/Parser.h: (KJS::Parser::parse): Take a SourceProvider.
  • kjs/lexer.cpp: (KJS::Lexer::setCode): Take a SourceProvider; keep it around, and use it to get the raw buffer and length.
  • kjs/lexer.h: (KJS::Lexer::sourceRange): Convenience function to get a source range based on the lexer's source provieder, and char offsets right before and after the desired range.
  • kjs/function.cpp: (KJS::globalFuncEval): Pass a UStringSourceProvider to the parser.
  • kjs/function_object.cpp: (KJS::functionProtoFuncToString): Use toSourceString to get the source. (KJS::FunctionObjectImp::construct): Give the parser a UStringSourceProvider.
  • kjs/grammar.y: When parsing a function declaration, function expression, or getter or setter, tell the function body about its SourceRange.
  • kjs/interpreter.cpp: (KJS::Interpreter::checkSyntax): Pass a SourceProvider to the parser. (KJS::Interpreter::evaluate): Pass a SourceProvider to the parser.
  • kjs/interpreter.h:
  • kjs/nodes.h: (KJS::FunctionBodyNode::setSource): Establish a SourceRange for this function. (KJS::FunctionBodyNode::toSourceString): Get the source string out of the SourceRange. (KJS::FuncExprNode::): Take a SourceRange and set it on the body. (KJS::FuncDeclNode::): ditto
  • kjs/testkjs.cpp: (prettyPrintScript): Use a SourceProvider appropriately.
  • JavaScriptCore.exp: Export new symbols.
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add new files.
  • JavaScriptCore.xcodeproj/project.pbxproj: Add new files.

JavaScriptGlue:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


  • JSRun.cpp: (JSRun::Evaluate): Use UString version of eveluate() instead of the now departed UChar*/length variant; use of the lower-level version was gratuitous in any case. (JSRun::CheckSyntax): Ditto for checkSyntax().

WebCore:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

  • bindings/js/StringSourceProvider.h: Added. SourceProvider subclass backed by a WebCore::String. (WebCore::StringSourceProvider::create): (WebCore::StringSourceProvider::getRange): (WebCore::StringSourceProvider::data): (WebCore::StringSourceProvider::length): (WebCore::StringSourceProvider::StringSourceProvider):
  • bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate): Pass a StringSourceProvider to evaluate() instead of UChar* / length.
  • html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::text): Modified to return the original string as-is when the script element contains only a single text node, to avoid excess memory use.


  • WebCore.vcproj/WebCore.vcproj: Add new file to build.
  • WebCore.xcodeproj/project.pbxproj: ditto

LayoutTests:

2008-05-10 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.

All of these tests expected function.toString to somewhat change
things from the raw original source. They are now prepared for the
fact that this does not happen.


  • fast/js/function-decompilation-operators.html:
  • fast/js/function-names-expected.txt:
  • fast/js/function-prototype-expected.txt:
  • fast/js/function-prototype.html:
  • fast/js/function-toString-object-literals-expected.txt:
  • fast/js/function-toString-parentheses-expected.txt:
  • fast/js/kde/lval-exceptions-expected.txt:
  • fast/js/modify-non-references-expected.txt:
  • fast/js/resources/function-names.js:
  • fast/js/resources/function-toString-object-literals.js:
  • fast/js/resources/function-toString-parentheses.js:
  • fast/js/resources/modify-non-references.js:
  • fast/js/resources/toString-prefix-postfix-preserve-parens.js:
  • fast/js/toString-prefix-postfix-preserve-parens-expected.txt:
6:09 AM Changeset in webkit [33026] by jchaffraix@webkit.org
  • 3 edits in trunk/JavaScriptCore

2008-05-10 Julien Chaffraix <jchaffraix@webkit.org>

Qt & wx build fix.

  • JavaScriptCore.pri: Add profiler/Profile.cpp.
  • JavaScriptCoreSources.bkl: Ditto.
2:43 AM Changeset in webkit [33025] by rwlbuis@webkit.org
  • 2 edits in trunk/JavaScriptCore

Reviewed by Maciej.

Gtk+ build fix

1:15 AM Changeset in webkit [33024] by oliver@apple.com
  • 6 edits in branches/squirrelfish/JavaScriptCore

Bring back RegisterFile tainting in order to correctly handle
natively implemented getters and setters that re-enter JavaScript

Reviewed by Maciej

May 9, 2008:

9:44 PM Changeset in webkit [33023] by weinig@apple.com
  • 3 edits
    2 adds in trunk

WebCore:

2008-05-09 Sam Weinig <sam@webkit.org>

Reviewed by Mark Rowe.

Fix for https://bugs.webkit.org/show_bug.cgi?id=18958
NULL pointer dereference in NamedAttrMap::setNamedItem

Test: fast/dom/NamedNodeMap-setNamedItem-crash.html

  • dom/NamedAttrMap.cpp: (WebCore::NamedAttrMap::setNamedItem): Null check the argument.

LayoutTests:

2008-05-09 Sam Weinig <sam@webkit.org>

Reviewed by Mark Rowe.

Test for https://bugs.webkit.org/show_bug.cgi?id=18958
NULL pointer dereference in NamedAttrMap::setNamedItem

  • fast/dom/NamedNodeMap-setNamedItem-crash-expected.txt: Added.
  • fast/dom/NamedNodeMap-setNamedItem-crash.html: Added.
8:44 PM Changeset in webkit [33022] by mrowe@apple.com
  • 8 edits
    1 delete in trunk/WebKit

Roll out r33018 as it broke the builds.

8:37 PM Changeset in webkit [33021] by mjs@apple.com
  • 4 edits in branches/squirrelfish/JavaScriptCore

2008-05-09 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


  • track character offsets of open and close braces, in preparation for saving function source


I verified that there is no performance regression from this change.

  • kjs/grammar.y:
  • kjs/lexer.cpp: (KJS::Lexer::lex): (KJS::Lexer::matchPunctuator):
  • kjs/lexer.h:
5:46 PM Changeset in webkit [33020] by andersca@apple.com
  • 2 edits in trunk

2008-05-09 Anders Carlsson <andersca@apple.com>

Reviewed by Mark.

Add x86_64 rule.


  • Makefile:
5:44 PM Changeset in webkit [33019] by mrowe@apple.com
  • 3 edits in trunk/WebKitTools

Update TestNetscapePlugIn to build 64-bit using the Cocoa event model.

It currently does not attempt to print events which means that plugins/mouse-events.html
will fail when run 64-bit. All other tests that use this plugin pass.

Reviewed by Anders Carlsson.

  • DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:

(testGetIntIdentifier):

  • DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:

(NPP_New):
(NPP_HandleEvent):

5:40 PM Changeset in webkit [33018] by andersca@apple.com
  • 8 edits
    1 add in trunk/WebKit

WebKit:

2008-05-09 Anders Carlsson <andersca@apple.com>

Reviewed by Oliver.

<rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins


Add nptextinput.h as a public header.


  • WebKit.xcodeproj/project.pbxproj:

WebKit/mac:

2008-05-09 Anders Carlsson <andersca@apple.com>

Reviewed by Oliver.

<rdar://problem/5774495> Make Unicode text input possible in Netscape-style plug-ins


  • Plugins/WebBaseNetscapePluginView.h:
  • Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView start]): Get the plug-in text input vtable pointer.


(-[WebBaseNetscapePluginView stop]):
Set the plug-in text input vtable pointer to 0.


(-[WebBaseNetscapePluginView inputContext]):
Return 0 for Carbon plug-ins since we don't want Cocoa to handle text input for them.


(-[WebBaseNetscapePluginView hasMarkedText]):
(-[WebBaseNetscapePluginView insertText:]):
(-[WebBaseNetscapePluginView markedRange]):
(-[WebBaseNetscapePluginView selectedRange]):
(-[WebBaseNetscapePluginView setMarkedText:selectedRange:]):
(-[WebBaseNetscapePluginView unmarkText]):
(-[WebBaseNetscapePluginView validAttributesForMarkedText]):
(-[WebBaseNetscapePluginView attributedSubstringFromRange:]):
(-[WebBaseNetscapePluginView characterIndexForPoint:]):
(-[WebBaseNetscapePluginView doCommandBySelector:]):
(-[WebBaseNetscapePluginView firstRectForCharacterRange:]):
(-[WebBaseNetscapePluginView conversationIdentifier]):
Implement NSTextInput and call into the plug-in text input vtable.


(browserTextInputFuncs):
New method which returns the browser input vtable.


(-[WebBaseNetscapePluginView getVariable:value:]):
Support getting the browser input vtable pointer.


  • Plugins/WebNetscapePluginEventHandlerCocoa.h:
  • Plugins/WebNetscapePluginEventHandlerCocoa.mm: (WebNetscapePluginEventHandlerCocoa::keyDown): (WebNetscapePluginEventHandlerCocoa::sendKeyEvent): If the plug-in returns 0 when a NPCocoaEventKeyDown is passed to NPP_HandleEvent, it means that the event should be passed on to the input manager.


  • Plugins/npapi.mm: (NPN_MarkedTextAbandoned): (NPN_MarkedTextSelectionChanged): Add implementations of browser input method methods.


  • Plugins/nptextinput.h: Added. Add file with new text input API.
5:26 PM Changeset in webkit [33017] by beidson@apple.com
  • 9 edits in trunk

WebKit/win:

Reviewed by Adam Roben

Fix a hang-on-quit bug where in the DLL_PROCESS_DETACH DllMain callback, we assummed that
we could cleanly shutdown WebKit but we couldn't because any background threads have already
been uncleanly aborted at that point.


  • ForEachCoClass.cpp: (shutDownWebKit): Moved from WebKitDLL to here, to be exposed via WebKit.def
  • ForEachCoClass.h:


  • WebKit.vcproj/WebKit.def:
  • WebKit.vcproj/WebKit_debug.def:


  • WebKitDLL.cpp: (DllMain): Don't call shutDownWebKit here


WebKitTools:

Reviewed by Adam Roben

Explicitly call shutDownWebKit() before quitting.

  • Drosera/win/Drosera.cpp: (_tWinMain):
  • DumpRenderTree/win/DumpRenderTree.cpp: (main):
5:25 PM Changeset in webkit [33016] by ddkilzer@apple.com
  • 1 edit in trunk/WebCore/DerivedSources.make

Changed tabs into spaces for VPATH and DOM_CLASSES items.

4:51 PM Changeset in webkit [33015] by oliver@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

Debug build fix

No reviewer

4:47 PM Changeset in webkit [33014] by mrowe@apple.com
  • 2 edits in trunk/WebKitTools

Fix the Tiger build of Drosera.

  • Drosera/config.h: Define BUILDING_ON_TIGER when building on Tiger.
4:10 PM Changeset in webkit [33013] by oliver@apple.com
  • 13 edits in branches/squirrelfish

Build fixes for SquirrelFish on windows.

Reviewed by Geoff

2:28 PM Changeset in webkit [33012] by beidson@apple.com
  • 2 edits in trunk/JavaScriptCore

Build Fix

2:08 PM Changeset in webkit [33011] by ggaren@apple.com
  • 2 edits in branches/squirrelfish/LayoutTests

2008-05-09 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.


Restored the expected results for viewsource-empty-attribute-value.html
to what they were prior to r31100. These results expect that the
top-level name in the frame path is "" instead of "1".


It's not clear how r31100 changed the top-level frame in the frame path
to be named "1". The change definitely wasn't related to any expected
behavior in r31100, which was about default margin-bottom for form
elements in quirks mode.


It's also not clear how squirrelfish changes things back.


Sam mentioned that the test result changes intermittently on trunk.


For now, I don't think we need to think deeply about this issue,
since the "" result seems more correct than the "1" result.

  • fast/frames/viewsource-empty-attribute-value-expected.txt:
2:06 PM Changeset in webkit [33010] by kmccullough@apple.com
  • 2 edits in trunk/WebCore

2008-05-09 Kevin McCullough <kmccullough@apple.com>

Build fix.

  • page/Console.cpp: (WebCore::Console::profile):
1:52 PM Changeset in webkit [33009] by weinig@apple.com
  • 20 edits in trunk

WebCore:

2008-05-09 Sam Weinig <sam@webkit.org>

Rubber-stamped by Mark Rowe.

Remove the ENABLE_CROSS_DOCUMENT_MESSAGING #ifdefs.

  • Configurations/WebCore.xcconfig:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.vcproj/build-generated-files.sh:
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::customGetOwnPropertySlot): (WebCore::JSDOMWindow::postMessage):
  • bindings/js/JSEventCustom.cpp: (WebCore::toJS):
  • bindings/objc/DOMEvents.mm: (+[DOMEvent _wrapEvent:WebCore::]):
  • dom/Document.cpp: (WebCore::Document::createEvent):
  • dom/Event.cpp: (WebCore::Event::isMessageEvent):
  • dom/Event.h:
  • dom/MessageEvent.cpp:
  • dom/MessageEvent.h:
  • dom/MessageEvent.idl:
  • page/DOMWindow.cpp: (WebCore::DOMWindow::postMessageTimerFired):
  • page/DOMWindow.h:
  • page/DOMWindow.idl:

WebKit/win:

2008-05-09 Sam Weinig <sam@webkit.org>

Rubber-stamped by Mark Rowe.

Remove the ENABLE_CROSS_DOCUMENT_MESSAGING #ifdefs.

  • WebKit.vcproj/WebKit.vcproj:

WebKitTools:

2008-05-09 Sam Weinig <sam@webkit.org>

Rubber-stamped by Mark Rowe.

Remove the ENABLE_CROSS_DOCUMENT_MESSAGING #ifdefs.

  • Scripts/build-webkit:
1:43 PM Changeset in webkit [33008] by Adam Roben
  • 2 edits in trunk/WebKit/win

Build fix

  • Interfaces/WebKit.idl: Touched.
1:18 PM Changeset in webkit [33007] by kmccullough@apple.com
  • 5 edits
    2 adds in trunk/JavaScriptCore

2008-05-09 Kevin McCullough <kmccullough@apple.com>

Reviewed by Tim.

-<rdar://problem/5770054> JavaScript profiler (10928)
-Add Profile class so that all profiles can be stored and retrieved by
the WebInspector when that time comes.

  • JavaScriptCore.exp: Export the new function signatures.
  • JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the project
  • profiler/Profile.cpp: Added. This class represents a single run of the profiler. (KJS::Profile::Profile): (KJS::Profile::willExecute): (KJS::Profile::didExecute): (KJS::Profile::printDataInspectorStyle): (KJS::functionNameCountPairComparator): (KJS::Profile::printDataSampleStyle):
  • profiler/Profile.h: Added. Ditto (KJS::Profile::stopProfiling):
  • profiler/Profiler.cpp: Now the profiler keeps track of many profiles but only runs one at a time. (KJS::Profiler::startProfiling): (KJS::Profiler::stopProfiling): (KJS::Profiler::willExecute): (KJS::Profiler::didExecute): (KJS::Profiler::printDataInspectorStyle): (KJS::Profiler::printDataSampleStyle):
  • profiler/Profiler.h: Ditto. (KJS::Profiler::~Profiler): (KJS::Profiler::allProfiles): (KJS::Profiler::clearProfiles):
1:14 PM Changeset in webkit [33006] by weinig@apple.com
  • 21 edits
    2 adds in trunk

WebCore:

2008-05-09 Adam Barth <abarth-webkit@adambarth.com>

Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=18771

Make postMessage generate an event on the window instead of the
document.

Test: http/tests/messaging/cross-domain-message-event-dispatch.html

  • dom/EventTargetNode.cpp: (WebCore::EventTargetNode::dispatchWindowEvent):
  • dom/EventTargetNode.h:
  • page/DOMWindow.cpp: (WebCore::DOMWindow::postMessageTimerFired):

LayoutTests:

2008-05-09 Adam Barth <abarth-webkit@adambarth.com>

Reviewed by Sam Weinig.

Update tests to listen for message events on the window instead of
the document. Also, added a test that the event is sent to the
window and not to the document.

  • http/tests/messaging/cross-domain-message-event-dispatch-expected.txt: Added.
  • http/tests/messaging/cross-domain-message-event-dispatch.html: Added.
  • http/tests/messaging/cross-domain-message-send.html:
  • http/tests/messaging/resources/cross-domain-message-receive.html:
  • http/tests/security/cross-frame-access-delete.html:
  • http/tests/security/cross-frame-access-history-put.html:
  • http/tests/security/cross-frame-access-location-put.html:
  • http/tests/security/postMessage/delivery-order.html:
  • http/tests/security/postMessage/invalid-origin-throws-exception.html:
  • http/tests/security/postMessage/javascript-page-still-sends-origin.html:
  • http/tests/security/postMessage/origin-unaffected-by-base-tag.html:
  • http/tests/security/postMessage/origin-unaffected-by-document-domain.html:
  • http/tests/security/postMessage/resources/post-message-listener.html:
  • http/tests/security/postMessage/target-origin.html:
  • http/tests/security/resources/cross-frame-iframe-for-delete-test.html:
  • http/tests/security/resources/cross-frame-iframe-for-history-put-test.html:
  • http/tests/security/resources/cross-frame-iframe-for-location-put-test.html:
  • http/tests/security/xss-eval.html:
6:08 AM Changeset in webkit [33005] by Simon Hausmann
  • 2 edits in trunk

Simon Hausmann <Simon Hausmann>

Removed explicit linkage against libxml and libxslt on Qt/Mac builds.

This dependency is completely unnecessary here and creates only problems by
propagating through WebCore.pro over libQtWebKit.prl right now customer
applications.

4:40 AM Changeset in webkit [33004] by Simon Hausmann
  • 3 edits in trunk/WebKit/qt

Thiago Macieira <tjmaciei@trolltech.com>

Fix bad includes in QtWebKit public headers.

Make sure to include qglobal.h using the QtCore prefix so that an explicit
include/QtCore is not needed in the application's build system. Also make sure
that qwebsettings.h includes the local qwebkitglobal.h.

3:21 AM Changeset in webkit [33003] by Simon Hausmann
  • 2 edits in trunk/WebCore

2008-05-09 Tor Arne Vestbø <tavestbo@trolltech.com>

Reviewed by Simon.

Replaced all instances of qDebug() with LOG(Media, ...)
in MediaPlayerPrivatePhonon.

2:38 AM Changeset in webkit [33002] by Simon Hausmann
  • 2 edits in trunk/WebCore

2008-05-09 Tor Arne Vestbø <tavestbo@trolltech.com>

Reviewed by Simon

Fix the Qt/Mac build.

1:48 AM Changeset in webkit [33001] by Simon Hausmann
  • 2 edits in trunk/WebKit/qt

2008-05-08 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>

Reviewed by Simon.

https://bugs.webkit.org/show_bug.cgi?id=18935

Based on work by Sriram Neelakandan for the Gtk port.

12:43 AM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
12:41 AM Changeset in webkit [33000] by ggaren@apple.com
  • 1 edit
    1 add in branches/squirrelfish/LayoutTests

2008-05-09 Geoffrey Garen <ggaren@apple.com>

Added expected results for this test.

  • fast/js/closure-inside-extra-arg-call-expected.txt: Added.
12:25 AM Changeset in webkit [32999] by ggaren@apple.com
  • 6 edits in branches/squirrelfish/WebCore

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.

Fixed platform/mac/plugins/bindings-test-objc.html.


I've restored -[WebScriptObject setException] and
+[WebScriptObject throwException].


Instead of mucking around in the JavaScript engine's execution state,
throwing an exception sets a global exception string, along with the
environment in which to throw it. An ObjC callback checks the global
exception string and, if it's non-nil and the environment matches the
current exceution environment, throws the global exception string as a
JS exception.

I also removed the old currentGlobalObject infrastructure: it's no longer
used.

May 8, 2008:

11:45 PM Changeset in webkit [32998] by mjs@apple.com
  • 3 edits
    2 adds in branches/squirrelfish

JavaScriptCore:

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.


  • fix activation tearoff in the case where functions are called with too many arguments


Fixes:
fast/canvas/patternfill-repeat.html
fast/dom/SelectorAPI/bug-17313.html

  • VM/Machine.cpp: (KJS::slideRegisterWindowForCall): (KJS::scopeChainForCall): (KJS::Machine::execute): (KJS::Machine::privateExecute):

LayoutTests:

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Geoff.


Add test cases for failures similar to the SquirrelFish failure on
fast/dom/SelectorAPI/bug-17313.html


  • fast/js/closure-inside-extra-arg-call.html: Added.
  • fast/js/resources/closure-inside-extra-arg-call.js: Added.
11:16 PM Changeset in webkit [32997] by mrowe@apple.com
  • 2 edits in trunk/WebKitTools

Another attempt at a Tiger build fix.

Use DumpRenderTreeMac.h rather than DumpRenderTree.h as DumpRenderTreePasteboard is not an Obj-C++ file.

  • DumpRenderTree/mac/DumpRenderTreePasteboard.m:
11:08 PM Changeset in webkit [32996] by mrowe@apple.com
  • 2 edits in trunk/WebKitTools

Tiger build fix. Include DumpRenderTree.h so that BUILDING_ON_TIGER will be defined.

10:43 PM Changeset in webkit [32995] by mrowe@apple.com
  • 8 edits in trunk/WebKitTools

Update DumpRenderTree to build 64-bit.

The three major changes here are:
1) Use NSInteger in the appropriate places.
2) Use ColorSync API that is available in 64-bit to switch display profiles.
3) Use method-swizzling to achieve similar results to class posing when using the Obj-C 2.0 runtime.

The build of DumpRenderTree will still fail in 64-bit for now as the TestNetscapePlugIn target also
needs updated to successfully build.

Reviewed by Oliver Hunt and Dan Bernstein.

  • DumpRenderTree/mac/Configurations/Base.xcconfig: Don't prevent Xcode from building 64-bit.
  • DumpRenderTree/mac/DumpRenderTree.mm:

(swizzleAllMethods):
(poseAsClass):
(prepareConsistentTestingEnvironment):

  • DumpRenderTree/mac/DumpRenderTreeMac.h:
  • DumpRenderTree/mac/DumpRenderTreePasteboard.h:
  • DumpRenderTree/mac/DumpRenderTreePasteboard.m:
  • DumpRenderTree/mac/DumpRenderTreeWindow.mm:
  • DumpRenderTree/mac/PixelDumpSupportMac.mm:

(restoreColorSpace):
(failedGettingCurrentProfile):
(setDefaultColorProfileToRGB):

10:43 PM Changeset in webkit [32994] by mrowe@apple.com
  • 3 edits in trunk/WebKitTools

Clean up Drosera so that it will build 64-bit.

Reviewed by Darin Adler.

  • Drosera/mac/DebuggerApplication.mm:

(-[DebuggerApplication numberOfRowsInTableView:]): Use NSInteger rather than int.
(-[DebuggerApplication tableView:objectValueForTableColumn:row:]): Ditto.

  • Drosera/mac/Drosera.xcodeproj/project.pbxproj: Use the default value for VALID_ARCHS.
10:13 PM Changeset in webkit [32993] by weinig@apple.com
  • 3 edits in trunk/WebCore

2008-05-08 Sam Weinig <sam@webkit.org>

Reviewed by Anders Carlsson.

Rename the XMLHttpRequestState enum values to match the spec.

  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseXML): (WebCore::XMLHttpRequest::XMLHttpRequest): (WebCore::XMLHttpRequest::callReadyStateChangeListener): (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::send): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::setRequestHeader): (WebCore::XMLHttpRequest::getAllResponseHeaders): (WebCore::XMLHttpRequest::getResponseHeader): (WebCore::XMLHttpRequest::status): (WebCore::XMLHttpRequest::statusText): (WebCore::XMLHttpRequest::processSyncLoadResults): (WebCore::XMLHttpRequest::didFinishLoading): (WebCore::XMLHttpRequest::didReceiveData):
  • xml/XMLHttpRequest.h: (WebCore::):
10:06 PM Changeset in webkit [32992] by mitz@apple.com
  • 6 edits
    4 adds in trunk

WebCore:

Reviewed by Mark Rowe.

Test: fast/css/first-letter-float-after-float.html

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateFirstLetter): Changed to add the first letter container right before the rest of the text it is taken from, instead of at the beginning of the block.

LayoutTests:

Reviewed by Mark Rowe.

  • ChangeLog:
  • fast/css/first-letter-float-after-float.html: Added.
  • platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.checksum:
  • platform/mac-leopard/fast/css/first-letter-skip-out-of-flow-expected.png:
  • platform/mac/fast/css/first-letter-float-after-float-expected.checksum: Added.
  • platform/mac/fast/css/first-letter-float-after-float-expected.png: Added.
  • platform/mac/fast/css/first-letter-float-after-float-expected.txt: Added.
  • platform/mac/fast/css/first-letter-skip-out-of-flow-expected.txt:
6:18 PM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
6:09 PM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
6:08 PM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
6:08 PM Changeset in webkit [32991] by ggaren@apple.com
  • 4 edits
    4 adds in branches/squirrelfish

JavaScriptCore:

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.


Fixed failure in fast/canvas/canvas-pattern-behaviour.html.


SunSpider reports a small speedup. Not sure what that's about.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump): Fixed op_call_eval to dump as "op_call_eval". This helped me while debugging.
  • VM/Machine.cpp: (KJS::Machine::unwindCallFrame): When looking for an activation to tear off, don't use the scope chain. Inside eval, the scope chain doesn't belong to us; it belongs to our calling function.


Also, don't use the needsFullScopeChain flag to decide whether to tear
off the activation. "function.arguments" can create an activation
for a function whose needsFullScopeChain flag is set to false.

LayoutTests:

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Oliver Hunt.


Added specific test cases for the root cause of squirrelfish's failure
in fast/canvas/canvas-pattern-behaviour.html.

  • fast/js/exception-thrown-from-eval-inside-closure-expected.txt: Added.
  • fast/js/exception-thrown-from-eval-inside-closure.html: Added.
  • fast/js/exception-thrown-from-function-with-lazy-activation-expected.txt: Added.
  • fast/js/exception-thrown-from-function-with-lazy-activation.html: Added.
5:02 PM Changeset in webkit [32990] by Chris Fleizach
  • 3 edits in trunk/WebCore

<rdar://problem/5921046> AX: list box options have wrong AXPosition

4:59 PM Changeset in webkit [32989] by jchaffraix@webkit.org
  • 5 edits in trunk/WebCore

2008-05-08 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Eric.

Bug 18916: make_names.pl --factory needs to support custom c++ guard

Add --guardFactoryWith to handle the cpp guard around generated factories.

  • DerivedSources.make: Set the guardFactoryWith variable for SVG factory.
  • GNUmakefile.am: Ditto.
  • WebCore.pro: Ditto.
  • dom/make_names.pl: Add guardFactoryWith option.
2:36 PM Changeset in webkit [32988] by andersca@apple.com
  • 2 edits in trunk/JavaScriptCore

2008-05-08 Anders Carlsson <andersca@apple.com>

Reviewed by Mark.

Enable NPAPI plug-ins on 64-bit.


  • wtf/Platform.h:
1:32 PM Changeset in webkit [32987] by jchaffraix@webkit.org
  • 4 edits in trunk/WebCore

2008-05-08 Julien Chaffraix <jchaffraix@webkit.org>

Reviewed by Adam Roben.

wx & Gtk build fix.

Should also fix the cURL backend for the Windows port.

  • WebCore.vcproj/WebCore.vcproj: Add FormDataStreamCurl information.
  • platform/network/curl/FormDataStreamCurl.h: Include stdio.h which fixes the build on some machine.
  • webcore-wx.bkl: Add FormDataStreamCurl.cpp.
1:00 PM Changeset in webkit [32986] by timothy@apple.com
  • 2 edits in trunk/WebCore

2008-05-08 Timothy Hatcher <timothy@apple.com>

Fixes the bug where the Web Inspector could not
find any localization strings.

Reviewed by Mark Rowe.

  • WebCore.xcodeproj/project.pbxproj: Add the localizedStrings.js file to the WebCore Copy Resources phase. Also removes an idl from the Copy Resources phase.
12:04 PM Changeset in webkit [32985] by mitz@apple.com
  • 2 edits in trunk/WebCore

Reviewed by Adam Roben.

  • fix <rdar://problem/5697957> "No recent searches" label in a narrow search field's history popup is truncated
  • platform/win/PopupMenuWin.cpp: (WebCore::PopupMenu::calculatePositionAndSize): Changed to use a bold font for measuring labels.
11:54 AM Changeset in webkit [32984] by mitz@apple.com
  • 2 edits in trunk/WebCore

Reviewed by Geoffrey Garen.

  • page/Frame.cpp: (WebCore::Frame::matchLabelsAgainstElement):
11:14 AM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
11:11 AM Changeset in webkit [32983] by ggaren@apple.com
  • 2 edits in branches/squirrelfish/LayoutTests

2008-05-08 Geoffrey Garen <ggaren@apple.com>

Reviewed by Sam Weinig.


Updated test results to reflect correct behavior: The line number in
the old results was off by 2.

  • fast/js/recursion-limit-equal-expected.txt:
11:11 AM Changeset in webkit [32982] by mrowe@apple.com
  • 2 edits in trunk/WebKitSite

2008-05-08 Mark Rowe <mrowe@apple.com>

Reviewed by Sam Weinig.

Add a link to the Mac OS Forge terms of use.

  • nav.inc:
10:48 AM SquirrelFishBlockers edited by ggaren@apple.com
(diff)
7:58 AM Changeset in webkit [32981] by Simon Hausmann
  • 5 edits
    2 copies in trunk/WebCore

2008-05-08 Holger Hans Peter Freyther <zecke@selfish.org>

Reviewed by Simon.

Simple ImageBuffer::image implementation.

In contrast to cg and cairo we do not use a special BitmapImage because
the ownership of the FrameData inside the BitmapImage is a bit backward
(actually owned by the ImageDecoderQt...). Further work is needed for image
and pixmap handling in the qt port...

7:57 AM Changeset in webkit [32980] by Simon Hausmann
  • 2 edits in trunk/WebCore

2008-05-08 Holger Hans Peter Freyther <zecke@selfish.org>

Reviewed by Simon.

Update the WebKit.qrc of the inspector to be functional again

6:53 AM Changeset in webkit [32979] by Simon Hausmann
  • 2 edits in trunk/WebCore

2008-05-08 Tor Arne Vestbø <tavestbo@trolltech.com>

Reviewed by Simon

Fix the Qt/Mac build.

3:40 AM Changeset in webkit [32978] by Simon Hausmann
  • 2 edits in trunk/WebKit/qt

Warwick Allison <warwick@trolltech.com>

Fixes: WebKit expects initial input method state to be *disabled*.

At least QWS does not need the initial input method state to be forced to
enabled, but other platforms (esp. X11) do. Until fixed/tested on those
platforms, this is specific to QWS.

3:23 AM Changeset in webkit [32977] by mjs@apple.com
  • 2 edits
    2 moves
    6 deletes in branches/squirrelfish/LayoutTests

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


  • move frame.xhtml and iframe.xhtml into a resources dir, as they were never meant to be tests
  • dom/xhtml/level2/html/HTMLFrameElement09.xhtml-disabled:
  • dom/xhtml/level2/html/frame.xhtml: Removed.
  • dom/xhtml/level2/html/iframe.xhtml: Removed.
  • dom/xhtml/level2/html/resources/frame.xhtml: Copied from dom/xhtml/level2/html/frame.xhtml.
  • dom/xhtml/level2/html/resources/iframe.xhtml: Copied from dom/xhtml/level2/html/iframe.xhtml.
  • platform/mac/dom/xhtml/level2/html/frame-expected.checksum: Removed.
  • platform/mac/dom/xhtml/level2/html/frame-expected.png: Removed.
  • platform/mac/dom/xhtml/level2/html/frame-expected.txt: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.checksum: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.png: Removed.
  • platform/mac/dom/xhtml/level2/html/iframe-expected.txt: Removed.
2:39 AM Changeset in webkit [32976] by Simon Hausmann
  • 3 edits in trunk/WebCore

2008-05-08 Ariya Hidayat <ariya.hidayat@trolltech.com>

Reviewed by Simon.

Use native Windows library handling (instead of QLibrary)
for Qt/Win32's PlatformModule.

  • platform/FileSystem.h: (WebCore::PlatformModuleVersion::PlatformModuleVersion):
  • platform/qt/FileSystemQt.cpp: (WebCore::unloadModule):
2:39 AM Changeset in webkit [32975] by mjs@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


  • fix function.call for calls of more than 8 arguments


Fixes svg/carto.net/button.svg

  • kjs/list.cpp: (KJS::List::getSlice): properly set up the m_buffer of the target list.
2:38 AM Changeset in webkit [32974] by Simon Hausmann
  • 4 edits in trunk

2008-05-08 Simon Hausmann <Simon Hausmann>

Reviewed and found by Holger.

Include .css in the list of extensions for text/css. Fixes
fast/loader/local-css-allowed-in-strict-mode.html.

1:36 AM Changeset in webkit [32973] by mjs@apple.com
  • 2 edits in branches/squirrelfish/JavaScriptCore

2008-05-08 Maciej Stachowiak <mjs@apple.com>

Reviewed by Oliver.


  • don't return a null RegisterID from RegExpNode in the exception case, since the caller may need a real register

Fixes:

  • fast/regex/early-acid3-86.html
  • http/tests/misc/acid3.html


  • kjs/nodes.cpp: (KJS::RegExpNode::emitCode):
12:45 AM Changeset in webkit [32972] by Simon Hausmann
  • 2 edits in trunk/WebCore

2008-05-08 Simon Hausmann <Simon Hausmann>

Fix the Qt and Wx build when compiling without offline app support.

Note: See TracTimeline for information about the timeline view.