| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 #ifdef ENABLE_DEBUGGER_SUPPORT | 509 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 510 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 510 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
| 511 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | 511 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
| 512 #endif | 512 #endif |
| 513 | 513 |
| 514 // Static functions for generating parts of stubs. | 514 // Static functions for generating parts of stubs. |
| 515 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 515 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 516 int index, | 516 int index, |
| 517 Register prototype); | 517 Register prototype); |
| 518 | 518 |
| 519 // Helper function used to check that the dictionary doesn't contain |
| 520 // the property. This function may return false negatives, so miss_label |
| 521 // must always call a backup property check that is complete. |
| 522 // This function is safe to call if the receiver has fast properties. |
| 523 // Name must be unique and receiver must be a heap object. |
| 524 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
| 525 Label* miss_label, |
| 526 Register receiver, |
| 527 Handle<Name> name, |
| 528 Register r0, |
| 529 Register r1); |
| 530 |
| 519 // Generates prototype loading code that uses the objects from the | 531 // Generates prototype loading code that uses the objects from the |
| 520 // context we were in when this function was called. If the context | 532 // context we were in when this function was called. If the context |
| 521 // has changed, a jump to miss is performed. This ties the generated | 533 // has changed, a jump to miss is performed. This ties the generated |
| 522 // code to a particular context and so must not be used in cases | 534 // code to a particular context and so must not be used in cases |
| 523 // where the generated code is not allowed to have references to | 535 // where the generated code is not allowed to have references to |
| 524 // objects from a context. | 536 // objects from a context. |
| 525 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, | 537 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 526 int index, | 538 int index, |
| 527 Register prototype, | 539 Register prototype, |
| 528 Label* miss); | 540 Label* miss); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 545 Register scratch2, | 557 Register scratch2, |
| 546 Label* miss_label, | 558 Label* miss_label, |
| 547 bool support_wrappers); | 559 bool support_wrappers); |
| 548 | 560 |
| 549 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 561 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 550 Register receiver, | 562 Register receiver, |
| 551 Register scratch1, | 563 Register scratch1, |
| 552 Register scratch2, | 564 Register scratch2, |
| 553 Label* miss_label); | 565 Label* miss_label); |
| 554 | 566 |
| 567 // Generate code to check that a global property cell is empty. Create |
| 568 // the property cell at compilation time if no cell exists for the |
| 569 // property. |
| 570 static void GenerateCheckPropertyCell(MacroAssembler* masm, |
| 571 Handle<JSGlobalObject> global, |
| 572 Handle<Name> name, |
| 573 Register scratch, |
| 574 Label* miss); |
| 575 |
| 576 // Calls GenerateCheckPropertyCell for each global object in the prototype |
| 577 // chain from object to (but not including) holder. |
| 578 static void GenerateCheckPropertyCells(MacroAssembler* masm, |
| 579 Handle<JSObject> object, |
| 580 Handle<JSObject> holder, |
| 581 Handle<Name> name, |
| 582 Register scratch, |
| 583 Label* miss); |
| 584 |
| 555 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 585 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
| 556 | 586 |
| 557 // Generates code that verifies that the property holder has not changed | 587 // Generates code that verifies that the property holder has not changed |
| 558 // (checking maps of objects in the prototype chain for fast and global | 588 // (checking maps of objects in the prototype chain for fast and global |
| 559 // objects or doing negative lookup for slow objects, ensures that the | 589 // objects or doing negative lookup for slow objects, ensures that the |
| 560 // property cells for global objects are still empty) and checks that the map | 590 // property cells for global objects are still empty) and checks that the map |
| 561 // of the holder has not changed. If necessary the function also generates | 591 // of the holder has not changed. If necessary the function also generates |
| 562 // code for security check in case of global object holders. Helps to make | 592 // code for security check in case of global object holders. Helps to make |
| 563 // sure that the current IC is still valid. | 593 // sure that the current IC is still valid. |
| 564 // | 594 // |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 Register CallbackHandlerFrontend(Handle<JSObject> object, | 758 Register CallbackHandlerFrontend(Handle<JSObject> object, |
| 729 Register object_reg, | 759 Register object_reg, |
| 730 Handle<JSObject> holder, | 760 Handle<JSObject> holder, |
| 731 Handle<Name> name, | 761 Handle<Name> name, |
| 732 Label* success, | 762 Label* success, |
| 733 Handle<ExecutableAccessorInfo> callback); | 763 Handle<ExecutableAccessorInfo> callback); |
| 734 void NonexistentHandlerFrontend(Handle<JSObject> object, | 764 void NonexistentHandlerFrontend(Handle<JSObject> object, |
| 735 Handle<JSObject> last, | 765 Handle<JSObject> last, |
| 736 Handle<Name> name, | 766 Handle<Name> name, |
| 737 Label* success, | 767 Label* success, |
| 738 Handle<GlobalObject> global); | 768 Handle<JSGlobalObject> global); |
| 739 | 769 |
| 740 void GenerateLoadField(Register reg, | 770 void GenerateLoadField(Register reg, |
| 741 Handle<JSObject> holder, | 771 Handle<JSObject> holder, |
| 742 PropertyIndex field, | 772 PropertyIndex field, |
| 743 Representation representation); | 773 Representation representation); |
| 744 void GenerateLoadConstant(Handle<Object> value); | 774 void GenerateLoadConstant(Handle<Object> value); |
| 745 void GenerateLoadCallback(Register reg, | 775 void GenerateLoadCallback(Register reg, |
| 746 Handle<ExecutableAccessorInfo> callback); | 776 Handle<ExecutableAccessorInfo> callback); |
| 747 void GenerateLoadInterceptor(Register holder_reg, | 777 void GenerateLoadInterceptor(Register holder_reg, |
| 748 Handle<JSObject> object, | 778 Handle<JSObject> object, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 768 | 798 |
| 769 | 799 |
| 770 class LoadStubCompiler: public BaseLoadStubCompiler { | 800 class LoadStubCompiler: public BaseLoadStubCompiler { |
| 771 public: | 801 public: |
| 772 explicit LoadStubCompiler(Isolate* isolate) | 802 explicit LoadStubCompiler(Isolate* isolate) |
| 773 : BaseLoadStubCompiler(isolate, registers()) { } | 803 : BaseLoadStubCompiler(isolate, registers()) { } |
| 774 | 804 |
| 775 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, | 805 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, |
| 776 Handle<JSObject> last, | 806 Handle<JSObject> last, |
| 777 Handle<Name> name, | 807 Handle<Name> name, |
| 778 Handle<GlobalObject> global); | 808 Handle<JSGlobalObject> global); |
| 779 | 809 |
| 780 static void GenerateLoadViaGetter(MacroAssembler* masm, | 810 static void GenerateLoadViaGetter(MacroAssembler* masm, |
| 781 Handle<JSFunction> getter); | 811 Handle<JSFunction> getter); |
| 782 | 812 |
| 783 Handle<Code> CompileLoadViaGetter(Handle<JSObject> object, | 813 Handle<Code> CompileLoadViaGetter(Handle<JSObject> object, |
| 784 Handle<JSObject> holder, | 814 Handle<JSObject> holder, |
| 785 Handle<Name> name, | 815 Handle<Name> name, |
| 786 Handle<JSFunction> getter); | 816 Handle<JSFunction> getter); |
| 787 | 817 |
| 788 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, | 818 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 Handle<JSFunction> constant_function_; | 1213 Handle<JSFunction> constant_function_; |
| 1184 bool is_simple_api_call_; | 1214 bool is_simple_api_call_; |
| 1185 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1215 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1186 Handle<CallHandlerInfo> api_call_info_; | 1216 Handle<CallHandlerInfo> api_call_info_; |
| 1187 }; | 1217 }; |
| 1188 | 1218 |
| 1189 | 1219 |
| 1190 } } // namespace v8::internal | 1220 } } // namespace v8::internal |
| 1191 | 1221 |
| 1192 #endif // V8_STUB_CACHE_H_ | 1222 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |