| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 #ifdef ENABLE_DEBUGGER_SUPPORT | 538 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 539 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 539 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
| 540 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | 540 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
| 541 #endif | 541 #endif |
| 542 | 542 |
| 543 // Static functions for generating parts of stubs. | 543 // Static functions for generating parts of stubs. |
| 544 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 544 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 545 int index, | 545 int index, |
| 546 Register prototype); | 546 Register prototype); |
| 547 | 547 |
| 548 // Helper function used to check that the dictionary doesn't contain |
| 549 // the property. This function may return false negatives, so miss_label |
| 550 // must always call a backup property check that is complete. |
| 551 // This function is safe to call if the receiver has fast properties. |
| 552 // Name must be unique and receiver must be a heap object. |
| 553 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
| 554 Label* miss_label, |
| 555 Register receiver, |
| 556 Handle<Name> name, |
| 557 Register r0, |
| 558 Register r1); |
| 559 |
| 548 // Generates prototype loading code that uses the objects from the | 560 // Generates prototype loading code that uses the objects from the |
| 549 // context we were in when this function was called. If the context | 561 // context we were in when this function was called. If the context |
| 550 // has changed, a jump to miss is performed. This ties the generated | 562 // has changed, a jump to miss is performed. This ties the generated |
| 551 // code to a particular context and so must not be used in cases | 563 // code to a particular context and so must not be used in cases |
| 552 // where the generated code is not allowed to have references to | 564 // where the generated code is not allowed to have references to |
| 553 // objects from a context. | 565 // objects from a context. |
| 554 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, | 566 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 555 int index, | 567 int index, |
| 556 Register prototype, | 568 Register prototype, |
| 557 Label* miss); | 569 Label* miss); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 574 Register scratch2, | 586 Register scratch2, |
| 575 Label* miss_label, | 587 Label* miss_label, |
| 576 bool support_wrappers); | 588 bool support_wrappers); |
| 577 | 589 |
| 578 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 590 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 579 Register receiver, | 591 Register receiver, |
| 580 Register scratch1, | 592 Register scratch1, |
| 581 Register scratch2, | 593 Register scratch2, |
| 582 Label* miss_label); | 594 Label* miss_label); |
| 583 | 595 |
| 596 // Generate code to check that a global property cell is empty. Create |
| 597 // the property cell at compilation time if no cell exists for the |
| 598 // property. |
| 599 static void GenerateCheckPropertyCell(MacroAssembler* masm, |
| 600 Handle<JSGlobalObject> global, |
| 601 Handle<Name> name, |
| 602 Register scratch, |
| 603 Label* miss); |
| 604 |
| 605 // Calls GenerateCheckPropertyCell for each global object in the prototype |
| 606 // chain from object to (but not including) holder. |
| 607 static void GenerateCheckPropertyCells(MacroAssembler* masm, |
| 608 Handle<JSObject> object, |
| 609 Handle<JSObject> holder, |
| 610 Handle<Name> name, |
| 611 Register scratch, |
| 612 Label* miss); |
| 613 |
| 584 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 614 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
| 585 | 615 |
| 586 // Generates code that verifies that the property holder has not changed | 616 // Generates code that verifies that the property holder has not changed |
| 587 // (checking maps of objects in the prototype chain for fast and global | 617 // (checking maps of objects in the prototype chain for fast and global |
| 588 // objects or doing negative lookup for slow objects, ensures that the | 618 // objects or doing negative lookup for slow objects, ensures that the |
| 589 // property cells for global objects are still empty) and checks that the map | 619 // property cells for global objects are still empty) and checks that the map |
| 590 // of the holder has not changed. If necessary the function also generates | 620 // of the holder has not changed. If necessary the function also generates |
| 591 // code for security check in case of global object holders. Helps to make | 621 // code for security check in case of global object holders. Helps to make |
| 592 // sure that the current IC is still valid. | 622 // sure that the current IC is still valid. |
| 593 // | 623 // |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 Register CallbackHandlerFrontend(Handle<JSObject> object, | 792 Register CallbackHandlerFrontend(Handle<JSObject> object, |
| 763 Register object_reg, | 793 Register object_reg, |
| 764 Handle<JSObject> holder, | 794 Handle<JSObject> holder, |
| 765 Handle<Name> name, | 795 Handle<Name> name, |
| 766 Label* success, | 796 Label* success, |
| 767 Handle<Object> callback); | 797 Handle<Object> callback); |
| 768 void NonexistentHandlerFrontend(Handle<JSObject> object, | 798 void NonexistentHandlerFrontend(Handle<JSObject> object, |
| 769 Handle<JSObject> last, | 799 Handle<JSObject> last, |
| 770 Handle<Name> name, | 800 Handle<Name> name, |
| 771 Label* success, | 801 Label* success, |
| 772 Handle<GlobalObject> global); | 802 Handle<JSGlobalObject> global); |
| 773 | 803 |
| 774 void GenerateLoadField(Register reg, | 804 void GenerateLoadField(Register reg, |
| 775 Handle<JSObject> holder, | 805 Handle<JSObject> holder, |
| 776 PropertyIndex field, | 806 PropertyIndex field, |
| 777 Representation representation); | 807 Representation representation); |
| 778 void GenerateLoadConstant(Handle<Object> value); | 808 void GenerateLoadConstant(Handle<Object> value); |
| 779 void GenerateLoadCallback(Register reg, | 809 void GenerateLoadCallback(Register reg, |
| 780 Handle<ExecutableAccessorInfo> callback); | 810 Handle<ExecutableAccessorInfo> callback); |
| 781 void GenerateLoadCallback(const CallOptimization& call_optimization); | 811 void GenerateLoadCallback(const CallOptimization& call_optimization); |
| 782 void GenerateLoadInterceptor(Register holder_reg, | 812 void GenerateLoadInterceptor(Register holder_reg, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 803 | 833 |
| 804 | 834 |
| 805 class LoadStubCompiler: public BaseLoadStubCompiler { | 835 class LoadStubCompiler: public BaseLoadStubCompiler { |
| 806 public: | 836 public: |
| 807 explicit LoadStubCompiler(Isolate* isolate) | 837 explicit LoadStubCompiler(Isolate* isolate) |
| 808 : BaseLoadStubCompiler(isolate, registers()) { } | 838 : BaseLoadStubCompiler(isolate, registers()) { } |
| 809 | 839 |
| 810 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, | 840 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, |
| 811 Handle<JSObject> last, | 841 Handle<JSObject> last, |
| 812 Handle<Name> name, | 842 Handle<Name> name, |
| 813 Handle<GlobalObject> global); | 843 Handle<JSGlobalObject> global); |
| 814 | 844 |
| 815 static void GenerateLoadViaGetter(MacroAssembler* masm, | 845 static void GenerateLoadViaGetter(MacroAssembler* masm, |
| 816 Handle<JSFunction> getter); | 846 Handle<JSFunction> getter); |
| 817 | 847 |
| 818 Handle<Code> CompileLoadViaGetter(Handle<JSObject> object, | 848 Handle<Code> CompileLoadViaGetter(Handle<JSObject> object, |
| 819 Handle<JSObject> holder, | 849 Handle<JSObject> holder, |
| 820 Handle<Name> name, | 850 Handle<Name> name, |
| 821 Handle<JSFunction> getter); | 851 Handle<JSFunction> getter); |
| 822 | 852 |
| 823 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, | 853 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 Handle<JSFunction> constant_function_; | 1241 Handle<JSFunction> constant_function_; |
| 1212 bool is_simple_api_call_; | 1242 bool is_simple_api_call_; |
| 1213 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1243 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1214 Handle<CallHandlerInfo> api_call_info_; | 1244 Handle<CallHandlerInfo> api_call_info_; |
| 1215 }; | 1245 }; |
| 1216 | 1246 |
| 1217 | 1247 |
| 1218 } } // namespace v8::internal | 1248 } } // namespace v8::internal |
| 1219 | 1249 |
| 1220 #endif // V8_STUB_CACHE_H_ | 1250 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |