Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GNASH_FUNCTION2_H
00020 #define GNASH_FUNCTION2_H
00021
00022 #include <vector>
00023 #include <cassert>
00024 #include <string>
00025
00026 #include "Function.h"
00027 #include "smart_ptr.h"
00028
00029
00030 namespace gnash {
00031 class action_buffer;
00032 class as_object;
00033 }
00034
00035 namespace gnash {
00036
00038
00045 class Function2 : public Function
00046 {
00047
00048 public:
00049
00050 enum DefineFunction2Flags
00051 {
00053 PRELOAD_THIS = 0x01,
00054
00056 SUPPRESS_THIS = 0x02,
00057
00059 PRELOAD_ARGUMENTS = 0x04,
00060
00062 SUPPRESS_ARGUMENTS = 0x08,
00063
00065 PRELOAD_SUPER = 0x10,
00066
00068 SUPPRESS_SUPER = 0x20,
00069
00071 PRELOAD_ROOT = 0x40,
00072
00074 PRELOAD_PARENT = 0x80,
00075
00077 PRELOAD_GLOBAL = 256
00078 };
00079
00080
00081 Function2(const action_buffer& ab, as_environment& env, size_t start,
00082 const ScopeStack& with_stack);
00083
00084 virtual ~Function2() {}
00085
00087 virtual boost::uint8_t registers() const {
00088 return _registerCount;
00089 }
00090
00091 void setRegisterCount(boost::uint8_t ct) {
00092 _registerCount = ct;
00093 }
00094
00095 void setFlags(boost::uint16_t flags) {
00096 _function2Flags = flags;
00097 }
00098
00100 virtual as_value call(const fn_call& fn);
00101
00102 private:
00103
00105 boost::uint8_t _registerCount;
00106
00108 boost::uint16_t _function2Flags;
00109
00110 };
00111
00112
00113 }
00114
00115 #endif
00116