summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/JavaScriptCore/interpreter/Interpreter.cpp
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 355acaa02..5eaed9657 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -50,6 +50,7 @@
#include "LiteralParser.h"
#include "JSStaticScopeObject.h"
#include "JSString.h"
+#include "NameInstance.h"
#include "ObjectPrototype.h"
#include "Operations.h"
#include "Parser.h"
@@ -2620,7 +2621,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
*/
int dst = vPC[1].u.operand;
int src = vPC[2].u.operand;
- JSValue result = jsBoolean(!callFrame->r(src).jsValue().toBoolean(callFrame));
+ JSValue result = jsBoolean(!callFrame->r(src).jsValue().toBoolean());
CHECK_FOR_EXCEPTION();
callFrame->uncheckedR(dst) = result;
@@ -2795,6 +2796,8 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi
uint32_t i;
if (propName.getUInt32(i))
callFrame->uncheckedR(dst) = jsBoolean(baseObj->hasProperty(callFrame, i));
+ else if (isName(propName))
+ callFrame->uncheckedR(dst) = jsBoolean(baseObj->hasProperty(callFrame, jsCast<NameInstance*>(propName.asCell())->privateName()));
else {
Identifier property(callFrame, propName.toString(callFrame)->value(callFrame));
CHECK_FOR_EXCEPTION();
@@ -3775,7 +3778,9 @@ skip_id_custom_self:
result = asString(baseValue)->getIndex(callFrame, i);
else
result = baseValue.get(callFrame, i);
- } else {
+ } else if (isName(subscript))
+ result = baseValue.get(callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName());
+ else {
Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
result = baseValue.get(callFrame, property);
}
@@ -3813,6 +3818,9 @@ skip_id_custom_self:
jsArray->JSArray::putByIndex(jsArray, callFrame, i, callFrame->r(value).jsValue(), codeBlock->isStrictMode());
} else
baseValue.putByIndex(callFrame, i, callFrame->r(value).jsValue(), codeBlock->isStrictMode());
+ } else if (isName(subscript)) {
+ PutPropertySlot slot(codeBlock->isStrictMode());
+ baseValue.put(callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName(), callFrame->r(value).jsValue(), slot);
} else {
Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
if (!globalData->exception) { // Don't put to an object if toString threw an exception.
@@ -3844,6 +3852,8 @@ skip_id_custom_self:
uint32_t i;
if (subscript.getUInt32(i))
result = baseObj->methodTable()->deletePropertyByIndex(baseObj, callFrame, i);
+ else if (isName(subscript))
+ result = baseObj->methodTable()->deleteProperty(baseObj, callFrame, jsCast<NameInstance*>(subscript.asCell())->privateName());
else {
CHECK_FOR_EXCEPTION();
Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
@@ -3929,7 +3939,7 @@ skip_id_custom_self:
*/
int cond = vPC[1].u.operand;
int target = vPC[2].u.operand;
- if (callFrame->r(cond).jsValue().toBoolean(callFrame)) {
+ if (callFrame->r(cond).jsValue().toBoolean()) {
vPC += target;
CHECK_FOR_TIMEOUT();
NEXT_INSTRUCTION();
@@ -3949,7 +3959,7 @@ skip_id_custom_self:
*/
int cond = vPC[1].u.operand;
int target = vPC[2].u.operand;
- if (!callFrame->r(cond).jsValue().toBoolean(callFrame)) {
+ if (!callFrame->r(cond).jsValue().toBoolean()) {
vPC += target;
CHECK_FOR_TIMEOUT();
NEXT_INSTRUCTION();
@@ -3966,7 +3976,7 @@ skip_id_custom_self:
*/
int cond = vPC[1].u.operand;
int target = vPC[2].u.operand;
- if (callFrame->r(cond).jsValue().toBoolean(callFrame)) {
+ if (callFrame->r(cond).jsValue().toBoolean()) {
vPC += target;
NEXT_INSTRUCTION();
}
@@ -3982,7 +3992,7 @@ skip_id_custom_self:
*/
int cond = vPC[1].u.operand;
int target = vPC[2].u.operand;
- if (!callFrame->r(cond).jsValue().toBoolean(callFrame)) {
+ if (!callFrame->r(cond).jsValue().toBoolean()) {
vPC += target;
NEXT_INSTRUCTION();
}
@@ -5272,7 +5282,7 @@ JSValue Interpreter::retrieveArgumentsFromVMCode(CallFrame* callFrame, JSFunctio
if (!functionCallFrame)
return jsNull();
- CodeBlock* codeBlock = functionCallFrame->codeBlock();
+ CodeBlock* codeBlock = functionCallFrame->someCodeBlockForPossiblyInlinedCode();
if (codeBlock->usesArguments()) {
ASSERT(codeBlock->codeType() == FunctionCode);
int argumentsRegister = codeBlock->argumentsRegister();