diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/JavaScriptCore/interpreter | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/JavaScriptCore/interpreter')
-rw-r--r-- | Source/JavaScriptCore/interpreter/Interpreter.cpp | 18 | ||||
-rw-r--r-- | Source/JavaScriptCore/interpreter/Interpreter.h | 78 | ||||
-rw-r--r-- | Source/JavaScriptCore/interpreter/RegisterFile.cpp | 4 | ||||
-rw-r--r-- | Source/JavaScriptCore/interpreter/RegisterFile.h | 3 |
4 files changed, 64 insertions, 39 deletions
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp index b8610e7bf..b6072a5d6 100644 --- a/Source/JavaScriptCore/interpreter/Interpreter.cpp +++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca> * * Redistribution and use in source and binary forms, with or without @@ -1822,7 +1822,7 @@ NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock* ASSERT(slot.slotBase().isObject()); JSObject* baseObject = asObject(slot.slotBase()); - size_t offset = slot.cachedOffset(); + PropertyOffset offset = slot.cachedOffset(); // Since we're accessing a prototype in a loop, it's a good bet that it // should not be treated as a dictionary. @@ -1851,7 +1851,7 @@ NEVER_INLINE void Interpreter::tryCacheGetByID(CallFrame* callFrame, CodeBlock* return; } - size_t offset = slot.cachedOffset(); + PropertyOffset offset = slot.cachedOffset(); size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase(), propertyName, offset); if (!count) { vPC[0] = getOpcode(op_get_by_id_generic); @@ -3045,6 +3045,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi vPC += OPCODE_LENGTH(op_resolve_with_this); NEXT_INSTRUCTION(); } + DEFINE_OPCODE(op_get_by_id_out_of_line) DEFINE_OPCODE(op_get_by_id) { /* get_by_id dst(r) base(r) property(id) structure(sID) nop(n) nop(n) nop(n) @@ -3527,6 +3528,7 @@ skip_id_custom_self: skip_get_string_length: goto *(&&skip_put_by_id); #endif + DEFINE_OPCODE(op_put_by_id_out_of_line) DEFINE_OPCODE(op_put_by_id) { /* put_by_id base(r) property(id) value(r) nop(n) nop(n) nop(n) nop(n) direct(b) @@ -3565,6 +3567,8 @@ skip_id_custom_self: #endif DEFINE_OPCODE(op_put_by_id_transition_direct) DEFINE_OPCODE(op_put_by_id_transition_normal) + DEFINE_OPCODE(op_put_by_id_transition_direct_out_of_line) + DEFINE_OPCODE(op_put_by_id_transition_normal_out_of_line) DEFINE_OPCODE(op_put_by_id_transition) { /* op_put_by_id_transition base(r) property(id) value(r) oldStructure(sID) newStructure(sID) structureChain(chain) offset(n) direct(b) @@ -3602,10 +3606,10 @@ skip_id_custom_self: proto = asObject(proto)->structure()->prototypeForLookup(callFrame); } } - baseObject->transitionTo(*globalData, newStructure); + baseObject->setStructureAndReallocateStorageIfNecessary(*globalData, newStructure); int value = vPC[3].u.operand; - unsigned offset = vPC[7].u.operand; + int offset = vPC[7].u.operand; ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(*globalData, codeBlock->identifier(vPC[2].u.operand))) == offset); baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue()); @@ -3639,7 +3643,7 @@ skip_id_custom_self: ASSERT(baseCell->isObject()); JSObject* baseObject = asObject(baseCell); int value = vPC[3].u.operand; - unsigned offset = vPC[5].u.operand; + int offset = vPC[5].u.operand; ASSERT(baseObject->offsetForLocation(baseObject->getDirectLocation(*globalData, codeBlock->identifier(vPC[2].u.operand))) == offset); baseObject->putDirectOffset(callFrame->globalData(), offset, callFrame->r(value).jsValue()); @@ -3717,7 +3721,7 @@ skip_id_custom_self: JSValue expectedSubscript = callFrame->r(expected).jsValue(); int index = callFrame->r(i).i() - 1; JSValue result; - int offset = 0; + PropertyOffset offset = 0; if (subscript == expectedSubscript && baseValue.isCell() && (baseValue.asCell()->structure() == it->cachedStructure()) && it->getOffset(index, offset)) { callFrame->uncheckedR(dst) = JSValue(asObject(baseValue)->getDirectOffset(offset)); vPC += OPCODE_LENGTH(op_get_by_pname); diff --git a/Source/JavaScriptCore/interpreter/Interpreter.h b/Source/JavaScriptCore/interpreter/Interpreter.h index adb23f237..ba2f4fac4 100644 --- a/Source/JavaScriptCore/interpreter/Interpreter.h +++ b/Source/JavaScriptCore/interpreter/Interpreter.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2012 Research In Motion Limited. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -39,6 +40,7 @@ #include "RegisterFile.h" #include <wtf/HashMap.h> +#include <wtf/text/StringBuilder.h> namespace JSC { @@ -80,45 +82,63 @@ namespace JSC { UString sourceURL; UString toString(CallFrame* callFrame) const { - bool hasSourceURLInfo = !sourceURL.isNull() && !sourceURL.isEmpty(); - bool hasLineInfo = line > -1; + StringBuilder traceBuild; + String functionName = friendlyFunctionName(callFrame); + String sourceURL = friendlySourceURL(); + traceBuild.append(functionName); + if (!sourceURL.isEmpty()) { + if (!functionName.isEmpty()) + traceBuild.append('@'); + traceBuild.append(sourceURL); + if (line > -1) { + traceBuild.append(':'); + traceBuild.append(String::number(line)); + } + } + return traceBuild.toString().impl(); + } + String friendlySourceURL() const + { String traceLine; - JSObject* stackFrameCallee = callee.get(); switch (codeType) { case StackFrameEvalCode: - if (hasSourceURLInfo) { - traceLine = hasLineInfo ? String::format("eval code@%s:%d", sourceURL.ascii().data(), line) - : String::format("eval code@%s", sourceURL.ascii().data()); - } else - traceLine = String::format("eval code"); + case StackFrameFunctionCode: + case StackFrameGlobalCode: + if (!sourceURL.isEmpty()) + traceLine = sourceURL.impl(); break; - case StackFrameNativeCode: { - if (callee) { - UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee); - traceLine = String::format("%s@[native code]", functionName.ascii().data()); - } else - traceLine = "[native code]"; + case StackFrameNativeCode: + traceLine = "[native code]"; break; } - case StackFrameFunctionCode: { - UString functionName = getCalculatedDisplayName(callFrame, stackFrameCallee); - if (hasSourceURLInfo) { - traceLine = hasLineInfo ? String::format("%s@%s:%d", functionName.ascii().data(), sourceURL.ascii().data(), line) - : String::format("%s@%s", functionName.ascii().data(), sourceURL.ascii().data()); - } else - traceLine = String::format("%s\n", functionName.ascii().data()); + return traceLine.isNull() ? emptyString() : traceLine; + } + String friendlyFunctionName(CallFrame* callFrame) const + { + String traceLine; + JSObject* stackFrameCallee = callee.get(); + + switch (codeType) { + case StackFrameEvalCode: + traceLine = "eval code"; + break; + case StackFrameNativeCode: + if (callee) + traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl(); + break; + case StackFrameFunctionCode: + traceLine = getCalculatedDisplayName(callFrame, stackFrameCallee).impl(); break; - } case StackFrameGlobalCode: - if (hasSourceURLInfo) { - traceLine = hasLineInfo ? String::format("global code@%s:%d", sourceURL.ascii().data(), line) - : String::format("global code@%s", sourceURL.ascii().data()); - } else - traceLine = String::format("global code"); - + traceLine = "global code"; + break; } - return traceLine.impl(); + return traceLine.isNull() ? emptyString() : traceLine; + } + unsigned friendlyLineNumber() const + { + return line > -1 ? line : 0; } }; diff --git a/Source/JavaScriptCore/interpreter/RegisterFile.cpp b/Source/JavaScriptCore/interpreter/RegisterFile.cpp index b72352781..dacb53872 100644 --- a/Source/JavaScriptCore/interpreter/RegisterFile.cpp +++ b/Source/JavaScriptCore/interpreter/RegisterFile.cpp @@ -73,9 +73,9 @@ void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots) conservativeRoots.add(begin(), end()); } -void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots, DFGCodeBlocks& dfgCodeBlocks) +void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, DFGCodeBlocks& dfgCodeBlocks) { - conservativeRoots.add(begin(), end(), dfgCodeBlocks); + conservativeRoots.add(begin(), end(), jitStubRoutines, dfgCodeBlocks); } void RegisterFile::releaseExcessCapacity() diff --git a/Source/JavaScriptCore/interpreter/RegisterFile.h b/Source/JavaScriptCore/interpreter/RegisterFile.h index 21ad7fbae..8fff8208c 100644 --- a/Source/JavaScriptCore/interpreter/RegisterFile.h +++ b/Source/JavaScriptCore/interpreter/RegisterFile.h @@ -39,6 +39,7 @@ namespace JSC { class ConservativeRoots; class DFGCodeBlocks; + class JITStubRoutineSet; class LLIntOffsetsExtractor; class RegisterFile { @@ -64,7 +65,7 @@ namespace JSC { ~RegisterFile(); void gatherConservativeRoots(ConservativeRoots&); - void gatherConservativeRoots(ConservativeRoots&, DFGCodeBlocks&); + void gatherConservativeRoots(ConservativeRoots&, JITStubRoutineSet&, DFGCodeBlocks&); Register* begin() const { return static_cast<Register*>(m_reservation.base()); } Register* end() const { return m_end; } |