~ubuntu-branches/ubuntu/precise/nodejs/precise

« back to all changes in this revision

Viewing changes to deps/v8/src/virtual-frame-light-inl.h

  • Committer: Bazaar Package Importer
  • Author(s): Jérémy Lal
  • Date: 2010-08-20 11:49:04 UTC
  • mfrom: (7.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100820114904-lz22w6fkth7yh179
Tags: 0.2.0-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
VirtualFrame::VirtualFrame(InvalidVirtualFrameInitializer* dummy)
43
43
    : element_count_(0),
44
44
      top_of_stack_state_(NO_TOS_REGISTERS),
45
 
      register_allocation_map_(0) { }
 
45
      register_allocation_map_(0),
 
46
      tos_known_smi_map_(0) { }
46
47
 
47
48
 
48
49
// On entry to a function, the virtual frame already contains the receiver,
50
51
VirtualFrame::VirtualFrame()
51
52
    : element_count_(parameter_count() + 2),
52
53
      top_of_stack_state_(NO_TOS_REGISTERS),
53
 
      register_allocation_map_(0) { }
 
54
      register_allocation_map_(0),
 
55
      tos_known_smi_map_(0) { }
54
56
 
55
57
 
56
58
// When cloned, a frame is a deep copy of the original.
57
59
VirtualFrame::VirtualFrame(VirtualFrame* original)
58
60
    : element_count_(original->element_count()),
59
61
      top_of_stack_state_(original->top_of_stack_state_),
60
 
      register_allocation_map_(original->register_allocation_map_) { }
61
 
 
62
 
 
63
 
bool VirtualFrame::Equals(VirtualFrame* other) {
 
62
      register_allocation_map_(original->register_allocation_map_),
 
63
      tos_known_smi_map_(0) { }
 
64
 
 
65
 
 
66
bool VirtualFrame::Equals(const VirtualFrame* other) {
64
67
  ASSERT(element_count() == other->element_count());
65
68
  if (top_of_stack_state_ != other->top_of_stack_state_) return false;
66
69
  if (register_allocation_map_ != other->register_allocation_map_) return false;
 
70
  if (tos_known_smi_map_ != other->tos_known_smi_map_) return false;
67
71
 
68
72
  return true;
69
73
}
70
74
 
71
75
 
72
76
void VirtualFrame::PrepareForReturn() {
73
 
  SpillAll();
 
77
  // Don't bother flushing tos registers as returning does not require more
 
78
  // access to the expression stack.
 
79
  top_of_stack_state_ = NO_TOS_REGISTERS;
74
80
}
75
81
 
76
82
 
99
105
}
100
106
 
101
107
 
102
 
CodeGenerator* VirtualFrame::cgen() { return CodeGeneratorScope::Current(); }
 
108
CodeGenerator* VirtualFrame::cgen() const {
 
109
  return CodeGeneratorScope::Current();
 
110
}
103
111
 
104
112
 
105
113
MacroAssembler* VirtualFrame::masm() { return cgen()->masm(); }
112
120
}
113
121
 
114
122
 
115
 
int VirtualFrame::parameter_count() {
 
123
int VirtualFrame::parameter_count() const {
116
124
  return cgen()->scope()->num_parameters();
117
125
}
118
126
 
119
127
 
120
 
int VirtualFrame::local_count() { return cgen()->scope()->num_stack_slots(); }
121
 
 
122
 
 
123
 
int VirtualFrame::frame_pointer() { return parameter_count() + 3; }
 
128
int VirtualFrame::local_count() const {
 
129
  return cgen()->scope()->num_stack_slots();
 
130
}
 
131
 
 
132
 
 
133
int VirtualFrame::frame_pointer() const { return parameter_count() + 3; }
124
134
 
125
135
 
126
136
int VirtualFrame::context_index() { return frame_pointer() - 1; }
129
139
int VirtualFrame::function_index() { return frame_pointer() - 2; }
130
140
 
131
141
 
132
 
int VirtualFrame::local0_index() { return frame_pointer() + 2; }
 
142
int VirtualFrame::local0_index() const { return frame_pointer() + 2; }
133
143
 
134
144
 
135
145
int VirtualFrame::fp_relative(int index) {
139
149
}
140
150
 
141
151
 
142
 
int VirtualFrame::expression_base_index() {
 
152
int VirtualFrame::expression_base_index() const {
143
153
  return local0_index() + local_count();
144
154
}
145
155
 
146
156
 
147
 
int VirtualFrame::height() {
 
157
int VirtualFrame::height() const {
148
158
  return element_count() - expression_base_index();
149
159
}
150
160