| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 205 } |
| 206 | 206 |
| 207 void PushElementAt(int index) { | 207 void PushElementAt(int index) { |
| 208 PushFrameSlotAt(element_count() - index - 1); | 208 PushFrameSlotAt(element_count() - index - 1); |
| 209 } | 209 } |
| 210 | 210 |
| 211 // A frame-allocated local as an assembly operand. | 211 // A frame-allocated local as an assembly operand. |
| 212 MemOperand LocalAt(int index) { | 212 MemOperand LocalAt(int index) { |
| 213 ASSERT(0 <= index); | 213 ASSERT(0 <= index); |
| 214 ASSERT(index < local_count()); | 214 ASSERT(index < local_count()); |
| 215 return MemOperand(s8_fp, kLocal0Offset - index * kPointerSize); | 215 return MemOperand(fp, kLocal0Offset - index * kPointerSize); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Push a copy of the value of a local frame slot on top of the frame. | 218 // Push a copy of the value of a local frame slot on top of the frame. |
| 219 void PushLocalAt(int index) { | 219 void PushLocalAt(int index) { |
| 220 PushFrameSlotAt(local0_index() + index); | 220 PushFrameSlotAt(local0_index() + index); |
| 221 } | 221 } |
| 222 | 222 |
| 223 // Push the value of a local frame slot on top of the frame and invalidate | 223 // Push the value of a local frame slot on top of the frame and invalidate |
| 224 // the local slot. The slot should be written to before trying to read | 224 // the local slot. The slot should be written to before trying to read |
| 225 // from it again. | 225 // from it again. |
| 226 void TakeLocalAt(int index) { | 226 void TakeLocalAt(int index) { |
| 227 TakeFrameSlotAt(local0_index() + index); | 227 TakeFrameSlotAt(local0_index() + index); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // Store the top value on the virtual frame into a local frame slot. The | 230 // Store the top value on the virtual frame into a local frame slot. The |
| 231 // value is left in place on top of the frame. | 231 // value is left in place on top of the frame. |
| 232 void StoreToLocalAt(int index) { | 232 void StoreToLocalAt(int index) { |
| 233 StoreToFrameSlotAt(local0_index() + index); | 233 StoreToFrameSlotAt(local0_index() + index); |
| 234 } | 234 } |
| 235 | 235 |
| 236 // Push the address of the receiver slot on the frame. | 236 // Push the address of the receiver slot on the frame. |
| 237 void PushReceiverSlotAddress(); | 237 void PushReceiverSlotAddress(); |
| 238 | 238 |
| 239 // The function frame slot. | 239 // The function frame slot. |
| 240 MemOperand Function() { return MemOperand(s8_fp, kFunctionOffset); } | 240 MemOperand Function() { return MemOperand(fp, kFunctionOffset); } |
| 241 | 241 |
| 242 // Push the function on top of the frame. | 242 // Push the function on top of the frame. |
| 243 void PushFunction() { PushFrameSlotAt(function_index()); } | 243 void PushFunction() { PushFrameSlotAt(function_index()); } |
| 244 | 244 |
| 245 // The context frame slot. | 245 // The context frame slot. |
| 246 MemOperand Context() { return MemOperand(s8_fp, kContextOffset); } | 246 MemOperand Context() { return MemOperand(fp, kContextOffset); } |
| 247 | 247 |
| 248 // Save the value of the cp register to the context frame slot. | 248 // Save the value of the cp register to the context frame slot. |
| 249 void SaveContextRegister(); | 249 void SaveContextRegister(); |
| 250 | 250 |
| 251 // Restore the cp register from the value of the context frame | 251 // Restore the cp register from the value of the context frame |
| 252 // slot. | 252 // slot. |
| 253 void RestoreContextRegister(); | 253 void RestoreContextRegister(); |
| 254 | 254 |
| 255 // A parameter as an assembly operand. | 255 // A parameter as an assembly operand. |
| 256 MemOperand ParameterAt(int index) { | 256 MemOperand ParameterAt(int index) { |
| 257 // Index -1 corresponds to the receiver. | 257 // Index -1 corresponds to the receiver. |
| 258 ASSERT(-1 <= index); // -1 is the receiver. | 258 ASSERT(-1 <= index); // -1 is the receiver. |
| 259 ASSERT(index <= parameter_count()); | 259 ASSERT(index <= parameter_count()); |
| 260 uint16_t a = 0; // Number of argument slots. | 260 return MemOperand(fp, (1 + parameter_count() - index) * kPointerSize); |
| 261 return MemOperand(s8_fp, (1 + parameter_count() + a - index) *kPointerSize); | |
| 262 } | 261 } |
| 263 | 262 |
| 264 // Push a copy of the value of a parameter frame slot on top of the frame. | 263 // Push a copy of the value of a parameter frame slot on top of the frame. |
| 265 void PushParameterAt(int index) { | 264 void PushParameterAt(int index) { |
| 266 PushFrameSlotAt(param0_index() + index); | 265 PushFrameSlotAt(param0_index() + index); |
| 267 } | 266 } |
| 268 | 267 |
| 269 // Push the value of a paramter frame slot on top of the frame and | 268 // Push the value of a paramter frame slot on top of the frame and |
| 270 // invalidate the parameter slot. The slot should be written to before | 269 // invalidate the parameter slot. The slot should be written to before |
| 271 // trying to read from it again. | 270 // trying to read from it again. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 302 void CallRuntime(Runtime::FunctionId id, int arg_count); | 301 void CallRuntime(Runtime::FunctionId id, int arg_count); |
| 303 | 302 |
| 304 // Call runtime with sp aligned to 8 bytes. | 303 // Call runtime with sp aligned to 8 bytes. |
| 305 void CallAlignedRuntime(Runtime::Function* f, int arg_count); | 304 void CallAlignedRuntime(Runtime::Function* f, int arg_count); |
| 306 void CallAlignedRuntime(Runtime::FunctionId id, int arg_count); | 305 void CallAlignedRuntime(Runtime::FunctionId id, int arg_count); |
| 307 | 306 |
| 308 // Invoke builtin given the number of arguments it expects on (and | 307 // Invoke builtin given the number of arguments it expects on (and |
| 309 // removes from) the stack. | 308 // removes from) the stack. |
| 310 void InvokeBuiltin(Builtins::JavaScript id, | 309 void InvokeBuiltin(Builtins::JavaScript id, |
| 311 InvokeJSFlags flag, | 310 InvokeJSFlags flag, |
| 312 Result* arg_count_register, | |
| 313 int arg_count); | 311 int arg_count); |
| 314 | 312 |
| 315 // Call into an IC stub given the number of arguments it removes | 313 // Call into an IC stub given the number of arguments it removes |
| 316 // from the stack. Register arguments are passed as results and | 314 // from the stack. Register arguments are passed as results and |
| 317 // consumed by the call. | 315 // consumed by the call. |
| 318 void CallCodeObject(Handle<Code> ic, | 316 void CallCodeObject(Handle<Code> ic, |
| 319 RelocInfo::Mode rmode, | 317 RelocInfo::Mode rmode, |
| 320 int dropped_args); | 318 int dropped_args); |
| 321 void CallCodeObject(Handle<Code> ic, | |
| 322 RelocInfo::Mode rmode, | |
| 323 Result* arg, | |
| 324 int dropped_args); | |
| 325 void CallCodeObject(Handle<Code> ic, | |
| 326 RelocInfo::Mode rmode, | |
| 327 Result* arg0, | |
| 328 Result* arg1, | |
| 329 int dropped_args, | |
| 330 bool set_auto_args_slots = false); | |
| 331 | 319 |
| 332 // Drop a number of elements from the top of the expression stack. May | 320 // Drop a number of elements from the top of the expression stack. May |
| 333 // emit code to affect the physical frame. Does not clobber any registers | 321 // emit code to affect the physical frame. Does not clobber any registers |
| 334 // excepting possibly the stack pointer. | 322 // excepting possibly the stack pointer. |
| 335 void Drop(int count); | 323 void Drop(int count); |
| 336 // Similar to VirtualFrame::Drop but we don't modify the actual stack. | 324 // Similar to VirtualFrame::Drop but we don't modify the actual stack. |
| 337 // This is because we need to manually restore sp to the correct position. | 325 // This is because we need to manually restore sp to the correct position. |
| 338 void DropFromVFrameOnly(int count); | 326 void DropFromVFrameOnly(int count); |
| 339 | 327 |
| 340 // Drop one element. | 328 // Drop one element. |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 // Classes that need raw access to the elements_ array. | 527 // Classes that need raw access to the elements_ array. |
| 540 friend class DeferredCode; | 528 friend class DeferredCode; |
| 541 friend class JumpTarget; | 529 friend class JumpTarget; |
| 542 }; | 530 }; |
| 543 | 531 |
| 544 | 532 |
| 545 } } // namespace v8::internal | 533 } } // namespace v8::internal |
| 546 | 534 |
| 547 #endif // V8_MIPS_VIRTUAL_FRAME_MIPS_H_ | 535 #endif // V8_MIPS_VIRTUAL_FRAME_MIPS_H_ |
| 548 | 536 |
| OLD | NEW |