[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server...
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server... |
Date: |
Tue, 17 Jun 2008 19:36:45 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/06/17 19:36:45
Modified files:
. : ChangeLog
server/vm : ASHandlers.cpp ActionExec.cpp ActionExec.h
Log message:
* server/vm/ActionExec.{h,cpp}, ASHandlers.cpp: add more
accessors to
data members.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6964&r2=1.6965
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.253&r2=1.254
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.cpp?cvsroot=gnash&r1=1.82&r2=1.83
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ActionExec.h?cvsroot=gnash&r1=1.36&r2=1.37
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6964
retrieving revision 1.6965
diff -u -b -r1.6964 -r1.6965
--- ChangeLog 17 Jun 2008 18:05:40 -0000 1.6964
+++ ChangeLog 17 Jun 2008 19:36:43 -0000 1.6965
@@ -1,3 +1,8 @@
+2008-06-17 Benjamin Wolsey <address@hidden>
+
+ * server/vm/ActionExec.{h,cpp}, ASHandlers.cpp: add more accessors to
+ data members.
+
2008-06-17 Sandro Santilli <address@hidden>
* testsuite/actionscript.all/AsBroadcaster.as: add test for 'super'
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.253
retrieving revision 1.254
diff -u -b -r1.253 -r1.254
--- server/vm/ASHandlers.cpp 17 Jun 2008 18:05:42 -0000 1.253
+++ server/vm/ASHandlers.cpp 17 Jun 2008 19:36:44 -0000 1.254
@@ -2540,8 +2540,8 @@
as_environment& env = thread.env;
const action_buffer& code = thread.code;
size_t pc = thread.getCurrentPC();
- size_t next_pc = thread.next_pc;
- size_t stop_pc = thread.stop_pc;
+ size_t nextPC = thread.getNextPC();
+ size_t stopPC = thread.getStopPC();
assert(thread.atActionTag(SWF::ACTION_BRANCHIFTRUE));
@@ -2554,12 +2554,12 @@
{
thread.adjustNextPC(offset);
- if (next_pc > stop_pc)
+ if (nextPC > stopPC)
{
IF_VERBOSE_MALFORMED_SWF (
log_swferror(_("branch to offset %d -- "
" this section only runs to %d"),
- next_pc, stop_pc);
+ nextPC, stopPC);
)
}
}
@@ -3954,7 +3954,7 @@
SWFHandlers::ActionConstantPool(ActionExec& thread)
{
- thread.code.process_decl_dict(thread.getCurrentPC(), thread.next_pc);
+ thread.code.process_decl_dict(thread.getCurrentPC(), thread.getNextPC());
}
void
@@ -3965,11 +3965,11 @@
as_environment& env = thread.env;
const action_buffer& code = thread.code;
- // Code starts at thread.next_pc as the DefineFunction tag
+ // Code starts at thread.getNextPC() as the DefineFunction tag
// contains name and args, while next tag is first tag
// of the function body.
swf_function* func = new swf_function(
- &code, &env, thread.next_pc, thread.getScopeStack());
+ &code, &env, thread.getNextPC(), thread.getScopeStack());
func->set_is_function2();
@@ -4016,7 +4016,7 @@
// Check code_size value consistency
size_t actionbuf_size = thread.code.size();
- if ( thread.next_pc+code_size > actionbuf_size )
+ if ( thread.getNextPC() + code_size > actionbuf_size )
{
IF_VERBOSE_MALFORMED_SWF(
log_swferror(_("function2 code len (%u) "
@@ -4025,9 +4025,9 @@
", function2 code offset=%d). "
"Forcing code len to eat the whole buffer "
"(would this work?)."),
- code_size, actionbuf_size, thread.next_pc);
+ code_size, actionbuf_size, thread.getNextPC());
);
- code_size = actionbuf_size-thread.next_pc;
+ code_size = actionbuf_size-thread.getNextPC();
}
i += 2;
@@ -4116,7 +4116,7 @@
thread.pushTryBlock(t);
}
- thread.next_pc = i; // Proceed into the try block.
+ thread.setNextPC(i); // Proceed into the try block.
IF_VERBOSE_ACTION(
log_action(_("ActionTry: reserved:%x doFinally:%d doCatch:%d trySize:%u "
@@ -4166,7 +4166,7 @@
pc += 2; // skip with body size
// now we should be on the first action of the 'with' body
- assert(thread.next_pc == pc);
+ assert(thread.getNextPC() == pc);
if ( ! with_obj )
{
@@ -4180,7 +4180,7 @@
}
// where does the 'with' block ends ?
- unsigned block_end = thread.next_pc + block_length;
+ unsigned block_end = thread.getNextPC() + block_length;
if ( ! thread.pushWithEntry(with_stack_entry(with_obj, block_end)) )
{
@@ -4204,11 +4204,11 @@
#endif
// Create a new swf_function
- // Code starts at thread.next_pc as the DefineFunction tag
+ // Code starts at thread.getNextPC() as the DefineFunction tag
// contains name and args, while next tag is first tag
// of the function body.
swf_function* func = new swf_function(
- &code, &env, thread.next_pc, thread.getScopeStack());
+ &code, &env, thread.getNextPC(), thread.getScopeStack());
size_t i = thread.getCurrentPC() + 3;
@@ -4239,7 +4239,7 @@
// Skip the function body (don't interpret it now).
- // next_pc is assumed to point to first action of
+ // getNextPC() is assumed to point to first action of
// the function body (one-past the current tag, whic
// is DefineFunction). We add code_size to it.
thread.adjustNextPC(code_size);
Index: server/vm/ActionExec.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- server/vm/ActionExec.cpp 16 Jun 2008 12:23:07 -0000 1.82
+++ server/vm/ActionExec.cpp 17 Jun 2008 19:36:44 -0000 1.83
@@ -78,12 +78,12 @@
_tryList(),
_returning(false),
_abortOnUnload(false),
- code(func.getActionBuffer()),
- env(newEnv),
- retval(nRetVal),
pc(func.getStartPC()),
+ next_pc(pc),
stop_pc(pc+func.getLength()),
- next_pc(pc)
+ code(func.getActionBuffer()),
+ env(newEnv),
+ retval(nRetVal)
{
assert(stop_pc < code.size());
@@ -116,12 +116,12 @@
_tryList(),
_returning(false),
_abortOnUnload(abortOnUnloaded),
+ pc(0),
+ next_pc(0),
+ stop_pc(abuf.size()),
code(abuf),
env(newEnv),
- retval(0),
- pc(0),
- stop_pc(code.size()),
- next_pc(0)
+ retval(0)
{
//GNASH_REPORT_FUNCTION;
Index: server/vm/ActionExec.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ActionExec.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/vm/ActionExec.h 16 Jun 2008 12:23:07 -0000 1.36
+++ server/vm/ActionExec.h 17 Jun 2008 19:36:44 -0000 1.37
@@ -218,6 +218,16 @@
bool _abortOnUnload;
+ /// Program counter (offset of current action tag)
+ size_t pc;
+
+ /// Offset to next action tag
+ size_t next_pc;
+
+ /// End of current function execution
+ /// Used for try/throw/catch blocks.
+ size_t stop_pc;
+
public:
/// \brief
@@ -449,6 +459,8 @@
/// Execute.
void operator() ();
+
+ // TODO: cut down these accessors.
bool atActionTag(SWF::action_type t) { return code[pc] == t; }
size_t getCurrentPC() const { return pc; }
@@ -457,23 +469,11 @@
void adjustNextPC(int offset) { next_pc += offset; }
-// This is just a temporary mess for initialization order
-// while I sort out accessors.
-
-private:
+ size_t getNextPC() const { return next_pc; }
- /// Program counter (offset of current action tag)
- size_t pc;
-
-public:
-
- /// End of current function execution
- /// Used for try/throw/catch blocks.
- size_t stop_pc;
-
- /// Offset to next action tag
- size_t next_pc;
+ void setNextPC(size_t pc) { next_pc = pc; }
+ size_t getStopPC() const { return stop_pc; }
};
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/12
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/12
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/13
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/13
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/16
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server..., Benjamin Wolsey, 2008/06/16
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server...,
Benjamin Wolsey <=