src/Code.h
changeset 195 c1ba166f3fc4
parent 91 5f4402180204
child 230 fb3cd08bc7fb
     1.1 --- a/src/Code.h	Mon Sep 17 00:10:01 2012 -0700
     1.2 +++ b/src/Code.h	Sat Nov 17 18:41:01 2012 -0800
     1.3 @@ -24,7 +24,6 @@
     1.4  #include "Heap.h"
     1.5  #include "Types.h"
     1.6  #include "FixedArray.h"
     1.7 -#include "Token.h"
     1.8  
     1.9  namespace ke {
    1.10  
    1.11 @@ -40,6 +39,7 @@
    1.12      Barriered<ByteArray> bytecode_;
    1.13      Barriered<FixedArray> locals_;
    1.14      Barriered<FixedArray> objects_;
    1.15 +    Barriered<FixedArray> strings_;
    1.16      Barriered<ByteArray> safepoints_;
    1.17      Barriered<ByteArray> sourcemap_;
    1.18      unsigned maxStackDepth_;
    1.19 @@ -52,9 +52,8 @@
    1.20  
    1.21    public:
    1.22      static Code *New(Zone *zone, Handle<ByteArray> bytecode, Handle<FixedArray> locals,
    1.23 -                     Handle<FixedArray> objects, unsigned maxStackDepth, Handle<Module> module,
    1.24 -                     Handle<ByteArray> safepoints, Handle<ByteArray> sourcemap,
    1.25 -                     unsigned lineNumber);
    1.26 +                     Handle<FixedArray> objects, Handle<FixedArray> strings, unsigned maxStackDepth,
    1.27 +                     Handle<ByteArray> safepoints, Handle<ByteArray> sourcemap);
    1.28  
    1.29      Module *module() {
    1.30          return module_;
    1.31 @@ -83,8 +82,15 @@
    1.32      ByteArray *safepoints() {
    1.33          return safepoints_;
    1.34      }
    1.35 +    FixedArray *strings() {
    1.36 +        return strings_;
    1.37 +    }
    1.38      uint8 *safepointAt(unsigned pcOffset);
    1.39  
    1.40 +    void setModule(Handle<Module> module) {
    1.41 +        module_ = module;
    1.42 +    }
    1.43 +
    1.44      unsigned pcToOffset(bytecode *pc) {
    1.45          assert(pc >= start() && pc < start() + length());
    1.46          return unsigned(pc - start());
    1.47 @@ -108,6 +114,9 @@
    1.48      static inline size_t offsetOfObjects() {
    1.49          return OFFSETOF(Code, objects_);
    1.50      }
    1.51 +    static inline size_t offsetOfStrings() {
    1.52 +        return OFFSETOF(Code, strings_);
    1.53 +    }
    1.54      static inline size_t offsetOfSafepoints() {
    1.55          return OFFSETOF(Code, safepoints_);
    1.56      }