| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace v8 { namespace internal { | 34 namespace v8 { namespace internal { |
| 35 | 35 |
| 36 // ------------------------------------------------------------------------- | 36 // ------------------------------------------------------------------------- |
| 37 // VirtualFrame implementation. | 37 // VirtualFrame implementation. |
| 38 | 38 |
| 39 #define __ masm_-> | 39 #define __ masm_-> |
| 40 | 40 |
| 41 VirtualFrame::VirtualFrame(CodeGenerator* cgen) | 41 VirtualFrame::VirtualFrame(CodeGenerator* cgen) |
| 42 : masm_(cgen->masm()), | 42 : masm_(cgen->masm()), |
| 43 elements_(cgen->scope()->num_parameters() + 5), | 43 elements_(0), |
| 44 virtual_stack_pointer_(-1), | 44 virtual_stack_pointer_(-1), |
| 45 virtual_frame_pointer_(-1), | 45 virtual_frame_pointer_(-1), |
| 46 parameter_count_(cgen->scope()->num_parameters()), | 46 parameter_count_(cgen->scope()->num_parameters()), |
| 47 local_count_(0) { | 47 local_count_(0) { |
| 48 // The virtual frame contains a receiver, the parameters, and a return | 48 // The virtual frame contains a receiver, the parameters, and a return |
| 49 // address (all in memory) when it is created. | 49 // address (all in memory) when it is created. |
| 50 Adjust(parameter_count_ + 2); | 50 Adjust(parameter_count_ + 2); |
| 51 } | 51 } |
| 52 | 52 |
| 53 | 53 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, | 180 void VirtualFrame::InvokeBuiltin(Builtins::JavaScript id, |
| 181 InvokeFlag flag, | 181 InvokeFlag flag, |
| 182 int frame_arg_count) { | 182 int frame_arg_count) { |
| 183 ASSERT(height() >= frame_arg_count); | 183 ASSERT(height() >= frame_arg_count); |
| 184 Forget(frame_arg_count); | 184 Forget(frame_arg_count); |
| 185 __ InvokeBuiltin(id, flag); | 185 __ InvokeBuiltin(id, flag); |
| 186 } | 186 } |
| 187 | 187 |
| 188 | 188 |
| 189 void VirtualFrame::CallCode(Handle<Code> code, | 189 void VirtualFrame::CallCodeObject(Handle<Code> code, |
| 190 RelocInfo::Mode rmode, | 190 RelocInfo::Mode rmode, |
| 191 int frame_arg_count) { | 191 int frame_arg_count) { |
| 192 ASSERT(height() >= frame_arg_count); | 192 ASSERT(height() >= frame_arg_count); |
| 193 Forget(frame_arg_count); | 193 Forget(frame_arg_count); |
| 194 __ call(code, rmode); | 194 __ call(code, rmode); |
| 195 } | 195 } |
| 196 | 196 |
| 197 | 197 |
| 198 void VirtualFrame::Drop(int count) { | 198 void VirtualFrame::Drop(int count) { |
| 199 ASSERT(height() >= count); | 199 ASSERT(height() >= count); |
| 200 Forget(count); | 200 Forget(count); |
| 201 if (count > 0) { | 201 if (count > 0) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 232 | 232 |
| 233 | 233 |
| 234 void VirtualFrame::Push(Immediate immediate) { | 234 void VirtualFrame::Push(Immediate immediate) { |
| 235 Adjust(1); | 235 Adjust(1); |
| 236 __ push(immediate); | 236 __ push(immediate); |
| 237 } | 237 } |
| 238 | 238 |
| 239 #undef __ | 239 #undef __ |
| 240 | 240 |
| 241 } } // namespace v8::internal | 241 } } // namespace v8::internal |
| OLD | NEW |