[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9693: implemted set_stack_index()
From: |
Markus Gothe |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9693: implemted set_stack_index() |
Date: |
Sun, 07 Sep 2008 18:59:52 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9693
committer: Markus Gothe <address@hidden>
branch nick: gnash
timestamp: Sun 2008-09-07 18:59:52 +0200
message:
implemted set_stack_index()
modified:
libcore/as_environment.cpp
libcore/as_environment.h
libcore/debugger.cpp
libcore/debugger.h
libcore/vm/SafeStack.h
=== modified file 'libcore/as_environment.cpp'
--- a/libcore/as_environment.cpp 2008-09-07 03:18:34 +0000
+++ b/libcore/as_environment.cpp 2008-09-07 16:59:52 +0000
@@ -986,6 +986,12 @@
}
void
+as_environment::set_stack_index(unsigned int index, as_value val)
+{
+ _stack.assign(index, val);
+}
+
+void
as_environment::dump_stack(std::ostream& out, unsigned int limit) const
{
unsigned int si=0, n=_stack.size();
=== modified file 'libcore/as_environment.h'
--- a/libcore/as_environment.h 2008-09-07 03:18:34 +0000
+++ b/libcore/as_environment.h 2008-09-07 16:59:52 +0000
@@ -425,6 +425,16 @@
///
as_value get_stack_index(unsigned int index);
+ /// Assign value of the stack on a given index.
+ //
+ /// @param index
+ /// Index of the stack.
+ ///
+ /// @param val
+ /// Value to assign to the stack-index.
+ ///
+ void set_stack_index(unsigned int index, as_value val);
+
/// Dump content of the stack to a std::ostream
//
/// @param out
=== modified file 'libcore/debugger.cpp'
--- a/libcore/debugger.cpp 2008-09-07 03:18:34 +0000
+++ b/libcore/debugger.cpp 2008-09-07 16:59:52 +0000
@@ -535,14 +535,14 @@
// Change the value of a parameter on the stack
void
-Debugger::changeStackValue(int index, as_value &val)
+Debugger::changeStackValue(unsigned int index, as_value &val)
{
// GNASH_REPORT_FUNCTION;
changeStackValue(*_env, index, val);
}
void
-Debugger::changeStackValue(as_environment &env, int index, as_value &val)
+Debugger::changeStackValue(as_environment &env, unsigned int index, as_value
&val)
{
// GNASH_REPORT_FUNCTION;
if (!_env) {
@@ -550,7 +550,7 @@
return;
}
if (env.stack_size()) {
- env.get_stack_index(index) = val;
+ env.set_stack_index(index, val);
}
}
=== modified file 'libcore/debugger.h'
--- a/libcore/debugger.h 2008-03-23 02:06:16 +0000
+++ b/libcore/debugger.h 2008-09-07 16:59:52 +0000
@@ -115,8 +115,8 @@
void dumpSymbols();
// Change the value of a parameter on the stack
- void changeStackValue(int index, as_value &val);
- void changeStackValue(as_environment &env, int index, as_value &val);
+ void changeStackValue(unsigned int index, as_value &val);
+ void changeStackValue(as_environment &env, unsigned int index, as_value
&val);
// Change the value of a local variable
void changeLocalVariable(const std::string &var, as_value &val);
=== modified file 'libcore/vm/SafeStack.h'
--- a/libcore/vm/SafeStack.h 2008-09-01 18:52:16 +0000
+++ b/libcore/vm/SafeStack.h 2008-09-07 16:59:52 +0000
@@ -81,6 +81,17 @@
return mData[offset >> mChunkShift][offset & mChunkMod];
}
+ /// Assign a value to given index counting from bottom.
+ void assign(StackSize i, T val)
+ {
+ if (i >= size())
+ throw StackException();
+
+ StackSize offset = mDownstop + i + 2;
+ //log_debug("value(%d): mEnd:%d, mDownstop:%d, offset:%d", i,
mEnd, mDownstop, offset);
+ mData[offset >> mChunkShift][offset & mChunkMod] = val;
+ }
+
/// Shrink the stack by i entries. Does not invalidate any entries
/// previously given, it just sets the top for pop, push, and top
/// operations.
- [Gnash-commit] /srv/bzr/gnash/trunk r9693: implemted set_stack_index(),
Markus Gothe <=