Skip to content

Commit

Permalink
register VM compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Constellation committed Jan 28, 2012
1 parent e896d42 commit da7ee80
Show file tree
Hide file tree
Showing 8 changed files with 1,182 additions and 1,348 deletions.
14 changes: 11 additions & 3 deletions iv/lv5/railgun/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ class Code : public radio::HeapObject<radio::POINTER> {
}

template<Handler::Type type>
void RegisterHandler(uint16_t begin, uint16_t end,
uint16_t stack_base_level,
void RegisterHandler(uint16_t begin,
uint16_t end,
uint32_t reg,
uint16_t dynamic_env_level) {
exception_table_.push_back(
std::make_tuple(type, begin, end, stack_base_level, dynamic_env_level));
std::make_tuple(type, begin, end, dynamic_env_level, reg));
}

bool strict() const { return strict_; }
Expand All @@ -131,6 +132,10 @@ class Code : public radio::HeapObject<radio::POINTER> {
stack_depth_ = depth + stack_size_;
}

void set_registers(std::size_t size) {
registers_ = size;
}

std::size_t start() const { return start_; }

const Instruction* begin() const {
Expand All @@ -155,6 +160,8 @@ class Code : public radio::HeapObject<radio::POINTER> {

uint32_t stack_size() const { return stack_size_; }

uint32_t registers() const { return registers_; }

bool empty() const { return empty_; }

Data* GetData() {
Expand Down Expand Up @@ -200,6 +207,7 @@ class Code : public radio::HeapObject<radio::POINTER> {
std::size_t block_begin_position_;
std::size_t block_end_position_;
std::size_t stack_depth_;
std::size_t registers_;
CoreData* core_;
std::size_t start_;
std::size_t end_;
Expand Down
Loading

0 comments on commit da7ee80

Please sign in to comment.