| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 236 } |
| 237 | 237 |
| 238 // The receiver frame slot. | 238 // The receiver frame slot. |
| 239 Operand Receiver() const { return ParameterAt(-1); } | 239 Operand Receiver() const { return ParameterAt(-1); } |
| 240 | 240 |
| 241 // Push a try-catch or try-finally handler on top of the virtual frame. | 241 // Push a try-catch or try-finally handler on top of the virtual frame. |
| 242 void PushTryHandler(HandlerType type); | 242 void PushTryHandler(HandlerType type); |
| 243 | 243 |
| 244 // Call a code stub, given the number of arguments it expects on (and | 244 // Call a code stub, given the number of arguments it expects on (and |
| 245 // removes from) the top of the physical frame. | 245 // removes from) the top of the physical frame. |
| 246 Result CallStub(CodeStub* stub, int frame_arg_count); | 246 Result CallStub(CodeStub* stub, int arg_count); |
| 247 Result CallStub(CodeStub* stub, Result* arg, int frame_arg_count); | 247 Result CallStub(CodeStub* stub, Result* arg, int arg_count); |
| 248 Result CallStub(CodeStub* stub, | 248 Result CallStub(CodeStub* stub, Result* arg0, Result* arg1, int arg_count); |
| 249 Result* arg0, | |
| 250 Result* arg1, | |
| 251 int frame_arg_count); | |
| 252 | 249 |
| 253 // Call the runtime, given the number of arguments expected on (and | 250 // Call the runtime, given the number of arguments expected on (and |
| 254 // removed from) the top of the physical frame. | 251 // removed from) the top of the physical frame. |
| 255 Result CallRuntime(Runtime::Function* f, int frame_arg_count); | 252 Result CallRuntime(Runtime::Function* f, int arg_count); |
| 256 Result CallRuntime(Runtime::FunctionId id, int frame_arg_count); | 253 Result CallRuntime(Runtime::FunctionId id, int arg_count); |
| 257 | 254 |
| 258 // Invoke a builtin, given the number of arguments it expects on (and | 255 // Invoke a builtin, given the number of arguments it expects on (and |
| 259 // removes from) the top of the physical frame. | 256 // removes from) the top of the physical frame. |
| 260 Result InvokeBuiltin(Builtins::JavaScript id, | 257 Result InvokeBuiltin(Builtins::JavaScript id, |
| 261 InvokeFlag flag, | 258 InvokeFlag flag, |
| 262 int frame_arg_count); | 259 int arg_count); |
| 263 | |
| 264 // Call into a call IC or a JS code object given the number of | |
| 265 // arguments it drops from the top of the stack. Arguments passed | |
| 266 // in registers are given as results and invalidated by the call. | |
| 267 Result CallCodeObject(Handle<Code> ic, | |
| 268 RelocInfo::Mode rmode, | |
| 269 int dropped_args); | |
| 270 Result CallCodeObject(Handle<Code> ic, | |
| 271 RelocInfo::Mode rmode, | |
| 272 Result* arg0, | |
| 273 Result* arg1, | |
| 274 int dropped_args); | |
| 275 | 260 |
| 276 // Call load IC. Name and receiver are found on top of the frame. | 261 // Call load IC. Name and receiver are found on top of the frame. |
| 277 // Receiver is not dropped. | 262 // Receiver is not dropped. |
| 278 Result CallLoadIC(RelocInfo::Mode mode); | 263 Result CallLoadIC(RelocInfo::Mode mode); |
| 279 | 264 |
| 280 // Call keyed load IC. Key and receiver are found on top of the | 265 // Call keyed load IC. Key and receiver are found on top of the |
| 281 // frame. They are not dropped. | 266 // frame. They are not dropped. |
| 282 Result CallKeyedLoadIC(RelocInfo::Mode mode); | 267 Result CallKeyedLoadIC(RelocInfo::Mode mode); |
| 283 | 268 |
| 284 // Call store IC. Name, value, and receiver are found on top of the | 269 // Call store IC. Name, value, and receiver are found on top of the |
| 285 // frame. Receiver is not dropped. | 270 // frame. Receiver is not dropped. |
| 286 Result CallStoreIC(); | 271 Result CallStoreIC(); |
| 287 | 272 |
| 288 // Call keyed store IC. Value, key, and receiver are found on top | 273 // Call keyed store IC. Value, key, and receiver are found on top |
| 289 // of the frame. Key and receiver are not dropped. | 274 // of the frame. Key and receiver are not dropped. |
| 290 Result CallKeyedStoreIC(); | 275 Result CallKeyedStoreIC(); |
| 291 | 276 |
| 277 // Call call IC. Arguments, reciever, and function name are found |
| 278 // on top of the frame. Function name slot is not dropped. The |
| 279 // argument count does not include the receiver. |
| 280 Result CallCallIC(RelocInfo::Mode mode, int arg_count, int loop_nesting); |
| 281 |
| 282 // Allocate and call JS function as constructor. Arguments, |
| 283 // receiver (global object), and function are found on top of the |
| 284 // frame. Function is not dropped. The argument count does not |
| 285 // include the receiver. |
| 286 Result CallConstructor(int arg_count); |
| 287 |
| 292 // Drop a number of elements from the top of the expression stack. May | 288 // Drop a number of elements from the top of the expression stack. May |
| 293 // emit code to affect the physical frame. Does not clobber any registers | 289 // emit code to affect the physical frame. Does not clobber any registers |
| 294 // excepting possibly the stack pointer. | 290 // excepting possibly the stack pointer. |
| 295 void Drop(int count); | 291 void Drop(int count); |
| 296 | 292 |
| 297 // Drop one element. | 293 // Drop one element. |
| 298 void Drop() { Drop(1); } | 294 void Drop() { Drop(1); } |
| 299 | 295 |
| 300 // Duplicate the top element of the frame. | 296 // Duplicate the top element of the frame. |
| 301 void Dup() { PushFrameSlotAt(elements_.length() - 1); } | 297 void Dup() { PushFrameSlotAt(elements_.length() - 1); } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 454 |
| 459 // Invalidates a frame slot (puts an invalid frame element in it). | 455 // Invalidates a frame slot (puts an invalid frame element in it). |
| 460 // Copies on the frame are correctly handled, and if this slot was | 456 // Copies on the frame are correctly handled, and if this slot was |
| 461 // the backing store of copies, the index of the new backing store | 457 // the backing store of copies, the index of the new backing store |
| 462 // is returned. Otherwise, returns kIllegalIndex. | 458 // is returned. Otherwise, returns kIllegalIndex. |
| 463 // Register counts are correctly updated. | 459 // Register counts are correctly updated. |
| 464 int InvalidateFrameSlotAt(int index); | 460 int InvalidateFrameSlotAt(int index); |
| 465 | 461 |
| 466 // Call a code stub that has already been prepared for calling (via | 462 // Call a code stub that has already been prepared for calling (via |
| 467 // PrepareForCall). | 463 // PrepareForCall). |
| 468 Result RawCallStub(CodeStub* stub, int frame_arg_count); | 464 Result RawCallStub(CodeStub* stub); |
| 469 | 465 |
| 470 // Calls a code object which has already been prepared for calling | 466 // Calls a code object which has already been prepared for calling |
| 471 // (via PrepareForCall). | 467 // (via PrepareForCall). |
| 472 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); | 468 Result RawCallCodeObject(Handle<Code> code, RelocInfo::Mode rmode); |
| 473 | 469 |
| 474 bool Equals(VirtualFrame* other); | 470 bool Equals(VirtualFrame* other); |
| 475 | 471 |
| 476 friend class JumpTarget; | 472 friend class JumpTarget; |
| 477 }; | 473 }; |
| 478 | 474 |
| 479 } } // namespace v8::internal | 475 } } // namespace v8::internal |
| 480 | 476 |
| 481 #endif // V8_VIRTUAL_FRAME_IA32_H_ | 477 #endif // V8_VIRTUAL_FRAME_IA32_H_ |
| OLD | NEW |