[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9599: SETPROPERTY opcode: Get name v
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9599: SETPROPERTY opcode: Get name value of the stack for runtime multinames. |
Date: |
Fri, 10 Oct 2008 15:34:52 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9599
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Fri 2008-10-10 15:34:52 +0800
message:
SETPROPERTY opcode: Get name value of the stack for runtime multinames.
SETSLOT opcode: Add a useful log_debug.
modified:
libcore/vm/Machine.cpp
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-10-09 17:34:04 +0000
+++ b/libcore/vm/Machine.cpp 2008-10-10 07:34:52 +0000
@@ -1491,7 +1491,7 @@
break;
}
-/// 0x61 ABC_ACTION_SETPROPERTY
+/// ABC_ACTION_SETPROPERTY
/// Stream: V32 'name_id'
/// Stack In:
/// value -- The value to be used
@@ -1508,13 +1508,22 @@
/// key/value is set in the dictionary obj instead.
case SWF::ABC_ACTION_SETPROPERTY:
{
+ as_value value = pop_stack();
+ string_table::key ns = 0;
+ string_table::key name = 0;
+
asName a = pool_name(mStream->read_V32(), mPoolObject);
- as_value value = pop_stack();
- //TODO: Get Namespace and name value off of the stack if it is
a runtime multiname.
+ //TODO: If multiname is runtime we need to also pop namespace
and name values of the stack.
+ if(a.mFlags == asName::KIND_MultinameL){
+ as_value nameValue = pop_stack();
+ name = mST.find(nameValue.to_string());
+ }
+ else{
+ name = a.getGlobalName();
+ }
as_object *object = pop_stack().to_object().get();
- if(!object->set_member_default(a.getGlobalName(),value,0,true)){
-
object->init_member(mPoolObject->mStringPool[a.getABCName()],value,0,0);
- }
+ object->set_member(name,value,ns,false);
+
break;
}
/// 0x62 ABC_ACTION_GETLOCAL
@@ -1669,6 +1678,9 @@
if(!object.to_object().get()->set_member_slot(sindex+1,value)){
LOG_DEBUG_AVM("Failed to set property at real_slot=%u
abc_slot=%u",sindex+1,sindex);
}
+ else{
+ LOG_DEBUG_AVM("Set property at real_slot=%u
abc_slot=%u",sindex+1,sindex);
+ }
//TODO: Actually set the object's value.
break;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9599: SETPROPERTY opcode: Get name value of the stack for runtime multinames.,
Tom Stellard <=