OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 Register holder, | 295 Register holder, |
296 Pushable name, | 296 Pushable name, |
297 JSObject* holder_obj) { | 297 JSObject* holder_obj) { |
298 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 298 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
299 | 299 |
300 ExternalReference ref = | 300 ExternalReference ref = |
301 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly)); | 301 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly)); |
302 __ mov(eax, Immediate(5)); | 302 __ mov(eax, Immediate(5)); |
303 __ mov(ebx, Immediate(ref)); | 303 __ mov(ebx, Immediate(ref)); |
304 | 304 |
305 CEntryStub stub; | 305 CEntryStub stub(1); |
306 __ CallStub(&stub); | 306 __ CallStub(&stub); |
307 } | 307 } |
308 | 308 |
309 | 309 |
310 template <class Compiler> | 310 template <class Compiler> |
311 static void CompileLoadInterceptor(Compiler* compiler, | 311 static void CompileLoadInterceptor(Compiler* compiler, |
312 StubCompiler* stub_compiler, | 312 StubCompiler* stub_compiler, |
313 MacroAssembler* masm, | 313 MacroAssembler* masm, |
314 JSObject* object, | 314 JSObject* object, |
315 JSObject* holder, | 315 JSObject* holder, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 __ pop(scratch2); // save old return address | 460 __ pop(scratch2); // save old return address |
461 __ push(holder); | 461 __ push(holder); |
462 __ mov(holder, Immediate(Handle<AccessorInfo>(callback))); | 462 __ mov(holder, Immediate(Handle<AccessorInfo>(callback))); |
463 __ push(holder); | 463 __ push(holder); |
464 __ push(FieldOperand(holder, AccessorInfo::kDataOffset)); | 464 __ push(FieldOperand(holder, AccessorInfo::kDataOffset)); |
465 __ push(name_); | 465 __ push(name_); |
466 __ push(scratch2); // restore old return address | 466 __ push(scratch2); // restore old return address |
467 | 467 |
468 ExternalReference ref = | 468 ExternalReference ref = |
469 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 469 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
470 __ TailCallRuntime(ref, 5); | 470 __ TailCallRuntime(ref, 5, 1); |
471 | 471 |
472 __ bind(&cleanup); | 472 __ bind(&cleanup); |
473 __ pop(scratch1); | 473 __ pop(scratch1); |
474 __ pop(scratch2); | 474 __ pop(scratch2); |
475 __ push(scratch1); | 475 __ push(scratch1); |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 | 479 |
480 void CompileRegular(MacroAssembler* masm, | 480 void CompileRegular(MacroAssembler* masm, |
481 Register receiver, | 481 Register receiver, |
482 Register holder, | 482 Register holder, |
483 Register scratch, | 483 Register scratch, |
484 JSObject* holder_obj, | 484 JSObject* holder_obj, |
485 Label* miss_label) { | 485 Label* miss_label) { |
486 __ pop(scratch); // save old return address | 486 __ pop(scratch); // save old return address |
487 PushInterceptorArguments(masm, receiver, holder, name_, holder_obj); | 487 PushInterceptorArguments(masm, receiver, holder, name_, holder_obj); |
488 __ push(scratch); // restore old return address | 488 __ push(scratch); // restore old return address |
489 | 489 |
490 ExternalReference ref = ExternalReference( | 490 ExternalReference ref = ExternalReference( |
491 IC_Utility(IC::kLoadPropertyWithInterceptorForLoad)); | 491 IC_Utility(IC::kLoadPropertyWithInterceptorForLoad)); |
492 __ TailCallRuntime(ref, 5); | 492 __ TailCallRuntime(ref, 5, 1); |
493 } | 493 } |
494 | 494 |
495 private: | 495 private: |
496 Register name_; | 496 Register name_; |
497 }; | 497 }; |
498 | 498 |
499 | 499 |
500 class CallInterceptorCompiler BASE_EMBEDDED { | 500 class CallInterceptorCompiler BASE_EMBEDDED { |
501 public: | 501 public: |
502 explicit CallInterceptorCompiler(const ParameterCount& arguments) | 502 explicit CallInterceptorCompiler(const ParameterCount& arguments) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 receiver, | 586 receiver, |
587 holder, | 587 holder, |
588 Operand(ebp, (argc_ + 3) * kPointerSize), | 588 Operand(ebp, (argc_ + 3) * kPointerSize), |
589 holder_obj); | 589 holder_obj); |
590 | 590 |
591 ExternalReference ref = ExternalReference( | 591 ExternalReference ref = ExternalReference( |
592 IC_Utility(IC::kLoadPropertyWithInterceptorForCall)); | 592 IC_Utility(IC::kLoadPropertyWithInterceptorForCall)); |
593 __ mov(eax, Immediate(5)); | 593 __ mov(eax, Immediate(5)); |
594 __ mov(ebx, Immediate(ref)); | 594 __ mov(ebx, Immediate(ref)); |
595 | 595 |
596 CEntryStub stub; | 596 CEntryStub stub(1); |
597 __ CallStub(&stub); | 597 __ CallStub(&stub); |
598 | 598 |
599 __ LeaveInternalFrame(); | 599 __ LeaveInternalFrame(); |
600 } | 600 } |
601 | 601 |
602 private: | 602 private: |
603 const ParameterCount& arguments_; | 603 const ParameterCount& arguments_; |
604 int argc_; | 604 int argc_; |
605 }; | 605 }; |
606 | 606 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 __ push(reg); // holder | 782 __ push(reg); // holder |
783 __ mov(reg, Immediate(Handle<AccessorInfo>(callback))); // callback data | 783 __ mov(reg, Immediate(Handle<AccessorInfo>(callback))); // callback data |
784 __ push(reg); | 784 __ push(reg); |
785 __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); | 785 __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); |
786 __ push(name_reg); // name | 786 __ push(name_reg); // name |
787 __ push(scratch2); // restore return address | 787 __ push(scratch2); // restore return address |
788 | 788 |
789 // Do tail-call to the runtime system. | 789 // Do tail-call to the runtime system. |
790 ExternalReference load_callback_property = | 790 ExternalReference load_callback_property = |
791 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 791 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
792 __ TailCallRuntime(load_callback_property, 5); | 792 __ TailCallRuntime(load_callback_property, 5, 1); |
793 } | 793 } |
794 | 794 |
795 | 795 |
796 void StubCompiler::GenerateLoadConstant(JSObject* object, | 796 void StubCompiler::GenerateLoadConstant(JSObject* object, |
797 JSObject* holder, | 797 JSObject* holder, |
798 Register receiver, | 798 Register receiver, |
799 Register scratch1, | 799 Register scratch1, |
800 Register scratch2, | 800 Register scratch2, |
801 Object* value, | 801 Object* value, |
802 String* name, | 802 String* name, |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 __ pop(ebx); // remove the return address | 1230 __ pop(ebx); // remove the return address |
1231 __ push(Operand(esp, 0)); // receiver | 1231 __ push(Operand(esp, 0)); // receiver |
1232 __ push(Immediate(Handle<AccessorInfo>(callback))); // callback info | 1232 __ push(Immediate(Handle<AccessorInfo>(callback))); // callback info |
1233 __ push(ecx); // name | 1233 __ push(ecx); // name |
1234 __ push(eax); // value | 1234 __ push(eax); // value |
1235 __ push(ebx); // restore return address | 1235 __ push(ebx); // restore return address |
1236 | 1236 |
1237 // Do tail-call to the runtime system. | 1237 // Do tail-call to the runtime system. |
1238 ExternalReference store_callback_property = | 1238 ExternalReference store_callback_property = |
1239 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 1239 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
1240 __ TailCallRuntime(store_callback_property, 4); | 1240 __ TailCallRuntime(store_callback_property, 4, 1); |
1241 | 1241 |
1242 // Handle store cache miss. | 1242 // Handle store cache miss. |
1243 __ bind(&miss); | 1243 __ bind(&miss); |
1244 __ mov(ecx, Immediate(Handle<String>(name))); // restore name | 1244 __ mov(ecx, Immediate(Handle<String>(name))); // restore name |
1245 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1245 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
1246 __ jmp(ic, RelocInfo::CODE_TARGET); | 1246 __ jmp(ic, RelocInfo::CODE_TARGET); |
1247 | 1247 |
1248 // Return the generated code. | 1248 // Return the generated code. |
1249 return GetCode(CALLBACKS, name); | 1249 return GetCode(CALLBACKS, name); |
1250 } | 1250 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 | 1283 |
1284 __ pop(ebx); // remove the return address | 1284 __ pop(ebx); // remove the return address |
1285 __ push(Operand(esp, 0)); // receiver | 1285 __ push(Operand(esp, 0)); // receiver |
1286 __ push(ecx); // name | 1286 __ push(ecx); // name |
1287 __ push(eax); // value | 1287 __ push(eax); // value |
1288 __ push(ebx); // restore return address | 1288 __ push(ebx); // restore return address |
1289 | 1289 |
1290 // Do tail-call to the runtime system. | 1290 // Do tail-call to the runtime system. |
1291 ExternalReference store_ic_property = | 1291 ExternalReference store_ic_property = |
1292 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 1292 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
1293 __ TailCallRuntime(store_ic_property, 3); | 1293 __ TailCallRuntime(store_ic_property, 3, 1); |
1294 | 1294 |
1295 // Handle store cache miss. | 1295 // Handle store cache miss. |
1296 __ bind(&miss); | 1296 __ bind(&miss); |
1297 __ mov(ecx, Immediate(Handle<String>(name))); // restore name | 1297 __ mov(ecx, Immediate(Handle<String>(name))); // restore name |
1298 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1298 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
1299 __ jmp(ic, RelocInfo::CODE_TARGET); | 1299 __ jmp(ic, RelocInfo::CODE_TARGET); |
1300 | 1300 |
1301 // Return the generated code. | 1301 // Return the generated code. |
1302 return GetCode(INTERCEPTOR, name); | 1302 return GetCode(INTERCEPTOR, name); |
1303 } | 1303 } |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 1865 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
1866 | 1866 |
1867 // Return the generated code. | 1867 // Return the generated code. |
1868 return GetCode(); | 1868 return GetCode(); |
1869 } | 1869 } |
1870 | 1870 |
1871 | 1871 |
1872 #undef __ | 1872 #undef __ |
1873 | 1873 |
1874 } } // namespace v8::internal | 1874 } } // namespace v8::internal |
OLD | NEW |