| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 Register holder, | 347 Register holder, |
| 348 Pushable name, | 348 Pushable name, |
| 349 JSObject* holder_obj) { | 349 JSObject* holder_obj) { |
| 350 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 350 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
| 351 | 351 |
| 352 ExternalReference ref = | 352 ExternalReference ref = |
| 353 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly)); | 353 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorOnly)); |
| 354 __ movq(rax, Immediate(5)); | 354 __ movq(rax, Immediate(5)); |
| 355 __ movq(rbx, ref); | 355 __ movq(rbx, ref); |
| 356 | 356 |
| 357 CEntryStub stub; | 357 CEntryStub stub(1); |
| 358 __ CallStub(&stub); | 358 __ CallStub(&stub); |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| 362 | 362 |
| 363 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, | 363 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 364 Register receiver, | 364 Register receiver, |
| 365 Register result, | 365 Register result, |
| 366 Register scratch, | 366 Register scratch, |
| 367 Label* miss_label) { | 367 Label* miss_label) { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 __ pop(scratch2); // save old return address | 482 __ pop(scratch2); // save old return address |
| 483 __ push(holder); | 483 __ push(holder); |
| 484 __ Move(holder, Handle<AccessorInfo>(callback)); | 484 __ Move(holder, Handle<AccessorInfo>(callback)); |
| 485 __ push(holder); | 485 __ push(holder); |
| 486 __ push(FieldOperand(holder, AccessorInfo::kDataOffset)); | 486 __ push(FieldOperand(holder, AccessorInfo::kDataOffset)); |
| 487 __ push(name_); | 487 __ push(name_); |
| 488 __ push(scratch2); // restore old return address | 488 __ push(scratch2); // restore old return address |
| 489 | 489 |
| 490 ExternalReference ref = | 490 ExternalReference ref = |
| 491 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 491 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
| 492 __ TailCallRuntime(ref, 5); | 492 __ TailCallRuntime(ref, 5, 1); |
| 493 | 493 |
| 494 __ bind(&cleanup); | 494 __ bind(&cleanup); |
| 495 __ pop(scratch1); | 495 __ pop(scratch1); |
| 496 __ pop(scratch2); | 496 __ pop(scratch2); |
| 497 __ push(scratch1); | 497 __ push(scratch1); |
| 498 } | 498 } |
| 499 } | 499 } |
| 500 | 500 |
| 501 | 501 |
| 502 void CompileRegular(MacroAssembler* masm, | 502 void CompileRegular(MacroAssembler* masm, |
| 503 Register receiver, | 503 Register receiver, |
| 504 Register holder, | 504 Register holder, |
| 505 Register scratch, | 505 Register scratch, |
| 506 JSObject* holder_obj, | 506 JSObject* holder_obj, |
| 507 Label* miss_label) { | 507 Label* miss_label) { |
| 508 __ pop(scratch); // save old return address | 508 __ pop(scratch); // save old return address |
| 509 PushInterceptorArguments(masm, receiver, holder, name_, holder_obj); | 509 PushInterceptorArguments(masm, receiver, holder, name_, holder_obj); |
| 510 __ push(scratch); // restore old return address | 510 __ push(scratch); // restore old return address |
| 511 | 511 |
| 512 ExternalReference ref = ExternalReference( | 512 ExternalReference ref = ExternalReference( |
| 513 IC_Utility(IC::kLoadPropertyWithInterceptorForLoad)); | 513 IC_Utility(IC::kLoadPropertyWithInterceptorForLoad)); |
| 514 __ TailCallRuntime(ref, 5); | 514 __ TailCallRuntime(ref, 5, 1); |
| 515 } | 515 } |
| 516 | 516 |
| 517 private: | 517 private: |
| 518 Register name_; | 518 Register name_; |
| 519 }; | 519 }; |
| 520 | 520 |
| 521 | 521 |
| 522 template <class Compiler> | 522 template <class Compiler> |
| 523 static void CompileLoadInterceptor(Compiler* compiler, | 523 static void CompileLoadInterceptor(Compiler* compiler, |
| 524 StubCompiler* stub_compiler, | 524 StubCompiler* stub_compiler, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 receiver, | 654 receiver, |
| 655 holder, | 655 holder, |
| 656 Operand(rbp, (argc_ + 3) * kPointerSize), | 656 Operand(rbp, (argc_ + 3) * kPointerSize), |
| 657 holder_obj); | 657 holder_obj); |
| 658 | 658 |
| 659 ExternalReference ref = ExternalReference( | 659 ExternalReference ref = ExternalReference( |
| 660 IC_Utility(IC::kLoadPropertyWithInterceptorForCall)); | 660 IC_Utility(IC::kLoadPropertyWithInterceptorForCall)); |
| 661 __ movq(rax, Immediate(5)); | 661 __ movq(rax, Immediate(5)); |
| 662 __ movq(rbx, ref); | 662 __ movq(rbx, ref); |
| 663 | 663 |
| 664 CEntryStub stub; | 664 CEntryStub stub(1); |
| 665 __ CallStub(&stub); | 665 __ CallStub(&stub); |
| 666 | 666 |
| 667 __ LeaveInternalFrame(); | 667 __ LeaveInternalFrame(); |
| 668 } | 668 } |
| 669 | 669 |
| 670 private: | 670 private: |
| 671 const ParameterCount& arguments_; | 671 const ParameterCount& arguments_; |
| 672 int argc_; | 672 int argc_; |
| 673 }; | 673 }; |
| 674 | 674 |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 __ pop(rbx); // remove the return address | 1355 __ pop(rbx); // remove the return address |
| 1356 __ push(Operand(rsp, 0)); // receiver | 1356 __ push(Operand(rsp, 0)); // receiver |
| 1357 __ Push(Handle<AccessorInfo>(callback)); // callback info | 1357 __ Push(Handle<AccessorInfo>(callback)); // callback info |
| 1358 __ push(rcx); // name | 1358 __ push(rcx); // name |
| 1359 __ push(rax); // value | 1359 __ push(rax); // value |
| 1360 __ push(rbx); // restore return address | 1360 __ push(rbx); // restore return address |
| 1361 | 1361 |
| 1362 // Do tail-call to the runtime system. | 1362 // Do tail-call to the runtime system. |
| 1363 ExternalReference store_callback_property = | 1363 ExternalReference store_callback_property = |
| 1364 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 1364 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
| 1365 __ TailCallRuntime(store_callback_property, 4); | 1365 __ TailCallRuntime(store_callback_property, 4, 1); |
| 1366 | 1366 |
| 1367 // Handle store cache miss. | 1367 // Handle store cache miss. |
| 1368 __ bind(&miss); | 1368 __ bind(&miss); |
| 1369 __ Move(rcx, Handle<String>(name)); // restore name | 1369 __ Move(rcx, Handle<String>(name)); // restore name |
| 1370 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1370 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
| 1371 __ Jump(ic, RelocInfo::CODE_TARGET); | 1371 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 1372 | 1372 |
| 1373 // Return the generated code. | 1373 // Return the generated code. |
| 1374 return GetCode(CALLBACKS, name); | 1374 return GetCode(CALLBACKS, name); |
| 1375 } | 1375 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 | 1443 |
| 1444 __ pop(rbx); // remove the return address | 1444 __ pop(rbx); // remove the return address |
| 1445 __ push(Operand(rsp, 0)); // receiver | 1445 __ push(Operand(rsp, 0)); // receiver |
| 1446 __ push(rcx); // name | 1446 __ push(rcx); // name |
| 1447 __ push(rax); // value | 1447 __ push(rax); // value |
| 1448 __ push(rbx); // restore return address | 1448 __ push(rbx); // restore return address |
| 1449 | 1449 |
| 1450 // Do tail-call to the runtime system. | 1450 // Do tail-call to the runtime system. |
| 1451 ExternalReference store_ic_property = | 1451 ExternalReference store_ic_property = |
| 1452 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 1452 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
| 1453 __ TailCallRuntime(store_ic_property, 3); | 1453 __ TailCallRuntime(store_ic_property, 3, 1); |
| 1454 | 1454 |
| 1455 // Handle store cache miss. | 1455 // Handle store cache miss. |
| 1456 __ bind(&miss); | 1456 __ bind(&miss); |
| 1457 __ Move(rcx, Handle<String>(name)); // restore name | 1457 __ Move(rcx, Handle<String>(name)); // restore name |
| 1458 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1458 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
| 1459 __ Jump(ic, RelocInfo::CODE_TARGET); | 1459 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 1460 | 1460 |
| 1461 // Return the generated code. | 1461 // Return the generated code. |
| 1462 return GetCode(INTERCEPTOR, name); | 1462 return GetCode(INTERCEPTOR, name); |
| 1463 } | 1463 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 __ push(reg); // holder | 1645 __ push(reg); // holder |
| 1646 __ Move(reg, Handle<AccessorInfo>(callback)); // callback data | 1646 __ Move(reg, Handle<AccessorInfo>(callback)); // callback data |
| 1647 __ push(reg); | 1647 __ push(reg); |
| 1648 __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); | 1648 __ push(FieldOperand(reg, AccessorInfo::kDataOffset)); |
| 1649 __ push(name_reg); // name | 1649 __ push(name_reg); // name |
| 1650 __ push(scratch2); // restore return address | 1650 __ push(scratch2); // restore return address |
| 1651 | 1651 |
| 1652 // Do tail-call to the runtime system. | 1652 // Do tail-call to the runtime system. |
| 1653 ExternalReference load_callback_property = | 1653 ExternalReference load_callback_property = |
| 1654 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 1654 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
| 1655 __ TailCallRuntime(load_callback_property, 5); | 1655 __ TailCallRuntime(load_callback_property, 5, 1); |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 | 1658 |
| 1659 Register StubCompiler::CheckPrototypes(JSObject* object, | 1659 Register StubCompiler::CheckPrototypes(JSObject* object, |
| 1660 Register object_reg, | 1660 Register object_reg, |
| 1661 JSObject* holder, | 1661 JSObject* holder, |
| 1662 Register holder_reg, | 1662 Register holder_reg, |
| 1663 Register scratch, | 1663 Register scratch, |
| 1664 String* name, | 1664 String* name, |
| 1665 Label* miss) { | 1665 Label* miss) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1864 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1865 | 1865 |
| 1866 // Return the generated code. | 1866 // Return the generated code. |
| 1867 return GetCode(); | 1867 return GetCode(); |
| 1868 } | 1868 } |
| 1869 | 1869 |
| 1870 | 1870 |
| 1871 #undef __ | 1871 #undef __ |
| 1872 | 1872 |
| 1873 } } // namespace v8::internal | 1873 } } // namespace v8::internal |
| OLD | NEW |