| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 Handle<Code> ComputeMonomorphicIC(Handle<HeapObject> receiver, | 98 Handle<Code> ComputeMonomorphicIC(Handle<HeapObject> receiver, |
| 99 Handle<Code> handler, | 99 Handle<Code> handler, |
| 100 Handle<Name> name, | 100 Handle<Name> name, |
| 101 StrictModeFlag strict_mode); | 101 StrictModeFlag strict_mode); |
| 102 | 102 |
| 103 // Computes the right stub matching. Inserts the result in the | 103 // Computes the right stub matching. Inserts the result in the |
| 104 // cache before returning. This might compile a stub if needed. | 104 // cache before returning. This might compile a stub if needed. |
| 105 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, | 105 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, |
| 106 Handle<JSObject> object); | 106 Handle<JSObject> object); |
| 107 | 107 |
| 108 Handle<Code> ComputeLoadGlobal(Handle<Name> name, | |
| 109 Handle<JSObject> object, | |
| 110 Handle<GlobalObject> holder, | |
| 111 Handle<PropertyCell> cell, | |
| 112 bool is_dont_delete); | |
| 113 | |
| 114 // --- | 108 // --- |
| 115 | 109 |
| 116 Handle<Code> ComputeKeyedLoadField(Handle<Name> name, | |
| 117 Handle<JSObject> object, | |
| 118 Handle<JSObject> holder, | |
| 119 PropertyIndex field_index, | |
| 120 Representation representation); | |
| 121 | |
| 122 Handle<Code> ComputeKeyedLoadCallback( | |
| 123 Handle<Name> name, | |
| 124 Handle<JSObject> object, | |
| 125 Handle<JSObject> holder, | |
| 126 Handle<ExecutableAccessorInfo> callback); | |
| 127 | |
| 128 Handle<Code> ComputeKeyedLoadCallback( | |
| 129 Handle<Name> name, | |
| 130 Handle<JSObject> object, | |
| 131 Handle<JSObject> holder, | |
| 132 const CallOptimization& call_optimization); | |
| 133 | |
| 134 Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name, | |
| 135 Handle<JSObject> object, | |
| 136 Handle<JSObject> holder, | |
| 137 Handle<Object> value); | |
| 138 | |
| 139 Handle<Code> ComputeKeyedLoadInterceptor(Handle<Name> name, | |
| 140 Handle<JSObject> object, | |
| 141 Handle<JSObject> holder); | |
| 142 | |
| 143 Handle<Code> ComputeStoreGlobal(Handle<Name> name, | |
| 144 Handle<GlobalObject> object, | |
| 145 Handle<PropertyCell> cell, | |
| 146 Handle<Object> value, | |
| 147 StrictModeFlag strict_mode); | |
| 148 | |
| 149 Handle<Code> ComputeKeyedLoadElement(Handle<Map> receiver_map); | 110 Handle<Code> ComputeKeyedLoadElement(Handle<Map> receiver_map); |
| 150 | 111 |
| 151 Handle<Code> ComputeKeyedStoreElement(Handle<Map> receiver_map, | 112 Handle<Code> ComputeKeyedStoreElement(Handle<Map> receiver_map, |
| 152 StrictModeFlag strict_mode, | 113 StrictModeFlag strict_mode, |
| 153 KeyedAccessStoreMode store_mode); | 114 KeyedAccessStoreMode store_mode); |
| 154 | 115 |
| 155 Handle<Code> ComputeCallField(int argc, | 116 Handle<Code> ComputeCallField(int argc, |
| 156 Code::Kind, | 117 Code::Kind, |
| 157 Code::ExtraICState extra_state, | 118 Code::ExtraICState extra_state, |
| 158 Handle<Name> name, | 119 Handle<Name> name, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 #ifdef ENABLE_DEBUGGER_SUPPORT | 388 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 428 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 389 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
| 429 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | 390 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
| 430 #endif | 391 #endif |
| 431 | 392 |
| 432 // Static functions for generating parts of stubs. | 393 // Static functions for generating parts of stubs. |
| 433 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 394 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 434 int index, | 395 int index, |
| 435 Register prototype); | 396 Register prototype); |
| 436 | 397 |
| 398 // Helper function used to check that the dictionary doesn't contain |
| 399 // the property. This function may return false negatives, so miss_label |
| 400 // must always call a backup property check that is complete. |
| 401 // This function is safe to call if the receiver has fast properties. |
| 402 // Name must be unique and receiver must be a heap object. |
| 403 static void GenerateDictionaryNegativeLookup(MacroAssembler* masm, |
| 404 Label* miss_label, |
| 405 Register receiver, |
| 406 Handle<Name> name, |
| 407 Register r0, |
| 408 Register r1); |
| 409 |
| 437 // Generates prototype loading code that uses the objects from the | 410 // Generates prototype loading code that uses the objects from the |
| 438 // context we were in when this function was called. If the context | 411 // context we were in when this function was called. If the context |
| 439 // has changed, a jump to miss is performed. This ties the generated | 412 // has changed, a jump to miss is performed. This ties the generated |
| 440 // code to a particular context and so must not be used in cases | 413 // code to a particular context and so must not be used in cases |
| 441 // where the generated code is not allowed to have references to | 414 // where the generated code is not allowed to have references to |
| 442 // objects from a context. | 415 // objects from a context. |
| 443 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, | 416 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, |
| 444 int index, | 417 int index, |
| 445 Register prototype, | 418 Register prototype, |
| 446 Label* miss); | 419 Label* miss); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 462 Register scratch1, | 435 Register scratch1, |
| 463 Register scratch2, | 436 Register scratch2, |
| 464 Label* miss_label); | 437 Label* miss_label); |
| 465 | 438 |
| 466 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 439 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 467 Register receiver, | 440 Register receiver, |
| 468 Register scratch1, | 441 Register scratch1, |
| 469 Register scratch2, | 442 Register scratch2, |
| 470 Label* miss_label); | 443 Label* miss_label); |
| 471 | 444 |
| 445 // Generate code to check that a global property cell is empty. Create |
| 446 // the property cell at compilation time if no cell exists for the |
| 447 // property. |
| 448 static void GenerateCheckPropertyCell(MacroAssembler* masm, |
| 449 Handle<JSGlobalObject> global, |
| 450 Handle<Name> name, |
| 451 Register scratch, |
| 452 Label* miss); |
| 453 |
| 454 // Calls GenerateCheckPropertyCell for each global object in the prototype |
| 455 // chain from object to (but not including) holder. |
| 456 static void GenerateCheckPropertyCells(MacroAssembler* masm, |
| 457 Handle<JSObject> object, |
| 458 Handle<JSObject> holder, |
| 459 Handle<Name> name, |
| 460 Register scratch, |
| 461 Label* miss); |
| 462 |
| 472 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 463 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
| 473 | 464 |
| 474 // Generates code that verifies that the property holder has not changed | 465 // Generates code that verifies that the property holder has not changed |
| 475 // (checking maps of objects in the prototype chain for fast and global | 466 // (checking maps of objects in the prototype chain for fast and global |
| 476 // objects or doing negative lookup for slow objects, ensures that the | 467 // objects or doing negative lookup for slow objects, ensures that the |
| 477 // property cells for global objects are still empty) and checks that the map | 468 // property cells for global objects are still empty) and checks that the map |
| 478 // of the holder has not changed. If necessary the function also generates | 469 // of the holder has not changed. If necessary the function also generates |
| 479 // code for security check in case of global object holders. Helps to make | 470 // code for security check in case of global object holders. Helps to make |
| 480 // sure that the current IC is still valid. | 471 // sure that the current IC is still valid. |
| 481 // | 472 // |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 Handle<Name> name, | 657 Handle<Name> name, |
| 667 Handle<JSFunction> getter); | 658 Handle<JSFunction> getter); |
| 668 | 659 |
| 669 static void GenerateLoadViaGetter(MacroAssembler* masm, | 660 static void GenerateLoadViaGetter(MacroAssembler* masm, |
| 670 Register receiver, | 661 Register receiver, |
| 671 Handle<JSFunction> getter); | 662 Handle<JSFunction> getter); |
| 672 | 663 |
| 673 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, | 664 Handle<Code> CompileLoadNonexistent(Handle<JSObject> object, |
| 674 Handle<JSObject> last, | 665 Handle<JSObject> last, |
| 675 Handle<Name> name, | 666 Handle<Name> name, |
| 676 Handle<GlobalObject> global); | 667 Handle<JSGlobalObject> global); |
| 677 | 668 |
| 678 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, | 669 Handle<Code> CompileLoadGlobal(Handle<JSObject> object, |
| 679 Handle<GlobalObject> holder, | 670 Handle<GlobalObject> holder, |
| 680 Handle<PropertyCell> cell, | 671 Handle<PropertyCell> cell, |
| 681 Handle<Name> name, | 672 Handle<Name> name, |
| 682 bool is_dont_delete); | 673 bool is_dont_delete); |
| 683 | 674 |
| 684 static Register* registers(); | 675 static Register* registers(); |
| 685 | 676 |
| 686 protected: | 677 protected: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 697 Register CallbackHandlerFrontend(Handle<JSObject> object, | 688 Register CallbackHandlerFrontend(Handle<JSObject> object, |
| 698 Register object_reg, | 689 Register object_reg, |
| 699 Handle<JSObject> holder, | 690 Handle<JSObject> holder, |
| 700 Handle<Name> name, | 691 Handle<Name> name, |
| 701 Label* success, | 692 Label* success, |
| 702 Handle<Object> callback); | 693 Handle<Object> callback); |
| 703 void NonexistentHandlerFrontend(Handle<JSObject> object, | 694 void NonexistentHandlerFrontend(Handle<JSObject> object, |
| 704 Handle<JSObject> last, | 695 Handle<JSObject> last, |
| 705 Handle<Name> name, | 696 Handle<Name> name, |
| 706 Label* success, | 697 Label* success, |
| 707 Handle<GlobalObject> global); | 698 Handle<JSGlobalObject> global); |
| 708 | 699 |
| 709 void GenerateLoadField(Register reg, | 700 void GenerateLoadField(Register reg, |
| 710 Handle<JSObject> holder, | 701 Handle<JSObject> holder, |
| 711 PropertyIndex field, | 702 PropertyIndex field, |
| 712 Representation representation); | 703 Representation representation); |
| 713 void GenerateLoadConstant(Handle<Object> value); | 704 void GenerateLoadConstant(Handle<Object> value); |
| 714 void GenerateLoadCallback(Register reg, | 705 void GenerateLoadCallback(Register reg, |
| 715 Handle<ExecutableAccessorInfo> callback); | 706 Handle<ExecutableAccessorInfo> callback); |
| 716 void GenerateLoadCallback(const CallOptimization& call_optimization); | 707 void GenerateLoadCallback(const CallOptimization& call_optimization); |
| 717 void GenerateLoadInterceptor(Register holder_reg, | 708 void GenerateLoadInterceptor(Register holder_reg, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 Handle<JSFunction> constant_function_; | 1059 Handle<JSFunction> constant_function_; |
| 1069 bool is_simple_api_call_; | 1060 bool is_simple_api_call_; |
| 1070 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1061 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1071 Handle<CallHandlerInfo> api_call_info_; | 1062 Handle<CallHandlerInfo> api_call_info_; |
| 1072 }; | 1063 }; |
| 1073 | 1064 |
| 1074 | 1065 |
| 1075 } } // namespace v8::internal | 1066 } } // namespace v8::internal |
| 1076 | 1067 |
| 1077 #endif // V8_STUB_CACHE_H_ | 1068 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |