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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 Handle<Name> name); | 105 Handle<Name> name); |
106 | 106 |
107 // Computes the right stub matching. Inserts the result in the | 107 // Computes the right stub matching. Inserts the result in the |
108 // cache before returning. This might compile a stub if needed. | 108 // cache before returning. This might compile a stub if needed. |
109 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, | 109 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, |
110 Handle<JSObject> object); | 110 Handle<JSObject> object); |
111 | 111 |
112 Handle<Code> ComputeLoadField(Handle<Name> name, | 112 Handle<Code> ComputeLoadField(Handle<Name> name, |
113 Handle<JSObject> object, | 113 Handle<JSObject> object, |
114 Handle<JSObject> holder, | 114 Handle<JSObject> holder, |
115 PropertyIndex field_index); | 115 PropertyIndex field_index, |
| 116 Representation representation); |
116 | 117 |
117 Handle<Code> ComputeLoadCallback(Handle<Name> name, | 118 Handle<Code> ComputeLoadCallback(Handle<Name> name, |
118 Handle<JSObject> object, | 119 Handle<JSObject> object, |
119 Handle<JSObject> holder, | 120 Handle<JSObject> holder, |
120 Handle<ExecutableAccessorInfo> callback); | 121 Handle<ExecutableAccessorInfo> callback); |
121 | 122 |
122 Handle<Code> ComputeLoadViaGetter(Handle<Name> name, | 123 Handle<Code> ComputeLoadViaGetter(Handle<Name> name, |
123 Handle<JSObject> object, | 124 Handle<JSObject> object, |
124 Handle<JSObject> holder, | 125 Handle<JSObject> holder, |
125 Handle<JSFunction> getter); | 126 Handle<JSFunction> getter); |
(...skipping 14 matching lines...) Expand all Loading... |
140 Handle<JSObject> object, | 141 Handle<JSObject> object, |
141 Handle<GlobalObject> holder, | 142 Handle<GlobalObject> holder, |
142 Handle<JSGlobalPropertyCell> cell, | 143 Handle<JSGlobalPropertyCell> cell, |
143 bool is_dont_delete); | 144 bool is_dont_delete); |
144 | 145 |
145 // --- | 146 // --- |
146 | 147 |
147 Handle<Code> ComputeKeyedLoadField(Handle<Name> name, | 148 Handle<Code> ComputeKeyedLoadField(Handle<Name> name, |
148 Handle<JSObject> object, | 149 Handle<JSObject> object, |
149 Handle<JSObject> holder, | 150 Handle<JSObject> holder, |
150 PropertyIndex field_index); | 151 PropertyIndex field_index, |
| 152 Representation representation); |
151 | 153 |
152 Handle<Code> ComputeKeyedLoadCallback( | 154 Handle<Code> ComputeKeyedLoadCallback( |
153 Handle<Name> name, | 155 Handle<Name> name, |
154 Handle<JSObject> object, | 156 Handle<JSObject> object, |
155 Handle<JSObject> holder, | 157 Handle<JSObject> holder, |
156 Handle<ExecutableAccessorInfo> callback); | 158 Handle<ExecutableAccessorInfo> callback); |
157 | 159 |
158 Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name, | 160 Handle<Code> ComputeKeyedLoadConstant(Handle<Name> name, |
159 Handle<JSObject> object, | 161 Handle<JSObject> object, |
160 Handle<JSObject> holder, | 162 Handle<JSObject> holder, |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 // where the generated code is not allowed to have references to | 501 // where the generated code is not allowed to have references to |
500 // objects from a context. | 502 // objects from a context. |
501 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, | 503 static void GenerateDirectLoadGlobalFunctionPrototype(MacroAssembler* masm, |
502 int index, | 504 int index, |
503 Register prototype, | 505 Register prototype, |
504 Label* miss); | 506 Label* miss); |
505 | 507 |
506 static void GenerateFastPropertyLoad(MacroAssembler* masm, | 508 static void GenerateFastPropertyLoad(MacroAssembler* masm, |
507 Register dst, | 509 Register dst, |
508 Register src, | 510 Register src, |
509 Handle<JSObject> holder, | 511 bool inobject, |
510 PropertyIndex index); | 512 int index, |
511 static void DoGenerateFastPropertyLoad(MacroAssembler* masm, | 513 Representation representation); |
512 Register dst, | |
513 Register src, | |
514 bool inobject, | |
515 int index); | |
516 | 514 |
517 static void GenerateLoadArrayLength(MacroAssembler* masm, | 515 static void GenerateLoadArrayLength(MacroAssembler* masm, |
518 Register receiver, | 516 Register receiver, |
519 Register scratch, | 517 Register scratch, |
520 Label* miss_label); | 518 Label* miss_label); |
521 | 519 |
522 static void GenerateLoadStringLength(MacroAssembler* masm, | 520 static void GenerateLoadStringLength(MacroAssembler* masm, |
523 Register receiver, | 521 Register receiver, |
524 Register scratch1, | 522 Register scratch1, |
525 Register scratch2, | 523 Register scratch2, |
(...skipping 10 matching lines...) Expand all Loading... |
536 Handle<JSObject> object, | 534 Handle<JSObject> object, |
537 LookupResult* lookup, | 535 LookupResult* lookup, |
538 Handle<Map> transition, | 536 Handle<Map> transition, |
539 Handle<Name> name, | 537 Handle<Name> name, |
540 Register receiver_reg, | 538 Register receiver_reg, |
541 Register name_reg, | 539 Register name_reg, |
542 Register value_reg, | 540 Register value_reg, |
543 Register scratch1, | 541 Register scratch1, |
544 Register scratch2, | 542 Register scratch2, |
545 Label* miss_label, | 543 Label* miss_label, |
546 Label* miss_restore_name); | 544 Label* miss_restore_name, |
| 545 Label* slow); |
547 | 546 |
548 void GenerateStoreField(MacroAssembler* masm, | 547 void GenerateStoreField(MacroAssembler* masm, |
549 Handle<JSObject> object, | 548 Handle<JSObject> object, |
550 LookupResult* lookup, | 549 LookupResult* lookup, |
551 Register receiver_reg, | 550 Register receiver_reg, |
552 Register name_reg, | 551 Register name_reg, |
553 Register value_reg, | 552 Register value_reg, |
554 Register scratch1, | 553 Register scratch1, |
555 Register scratch2, | 554 Register scratch2, |
556 Label* miss_label); | 555 Label* miss_label); |
557 | 556 |
558 static Builtins::Name MissBuiltin(Code::Kind kind) { | 557 static Builtins::Name MissBuiltin(Code::Kind kind) { |
559 switch (kind) { | 558 switch (kind) { |
560 case Code::LOAD_IC: return Builtins::kLoadIC_Miss; | 559 case Code::LOAD_IC: return Builtins::kLoadIC_Miss; |
561 case Code::STORE_IC: return Builtins::kStoreIC_Miss; | 560 case Code::STORE_IC: return Builtins::kStoreIC_Miss; |
562 case Code::KEYED_LOAD_IC: return Builtins::kKeyedLoadIC_Miss; | 561 case Code::KEYED_LOAD_IC: return Builtins::kKeyedLoadIC_Miss; |
563 case Code::KEYED_STORE_IC: return Builtins::kKeyedStoreIC_Miss; | 562 case Code::KEYED_STORE_IC: return Builtins::kKeyedStoreIC_Miss; |
564 default: UNREACHABLE(); | 563 default: UNREACHABLE(); |
565 } | 564 } |
566 return Builtins::kLoadIC_Miss; | 565 return Builtins::kLoadIC_Miss; |
567 } | 566 } |
| 567 static Builtins::Name SlowBuiltin(Code::Kind kind) { |
| 568 switch (kind) { |
| 569 case Code::STORE_IC: return Builtins::kStoreIC_Slow; |
| 570 case Code::KEYED_STORE_IC: return Builtins::kKeyedStoreIC_Slow; |
| 571 default: UNREACHABLE(); |
| 572 } |
| 573 return Builtins::kStoreIC_Slow; |
| 574 } |
568 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 575 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
569 | 576 |
570 // Generates code that verifies that the property holder has not changed | 577 // Generates code that verifies that the property holder has not changed |
571 // (checking maps of objects in the prototype chain for fast and global | 578 // (checking maps of objects in the prototype chain for fast and global |
572 // objects or doing negative lookup for slow objects, ensures that the | 579 // objects or doing negative lookup for slow objects, ensures that the |
573 // property cells for global objects are still empty) and checks that the map | 580 // property cells for global objects are still empty) and checks that the map |
574 // of the holder has not changed. If necessary the function also generates | 581 // of the holder has not changed. If necessary the function also generates |
575 // code for security check in case of global object holders. Helps to make | 582 // code for security check in case of global object holders. Helps to make |
576 // sure that the current IC is still valid. | 583 // sure that the current IC is still valid. |
577 // | 584 // |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 643 |
637 class BaseLoadStubCompiler: public StubCompiler { | 644 class BaseLoadStubCompiler: public StubCompiler { |
638 public: | 645 public: |
639 BaseLoadStubCompiler(Isolate* isolate, Register* registers) | 646 BaseLoadStubCompiler(Isolate* isolate, Register* registers) |
640 : StubCompiler(isolate), registers_(registers) { } | 647 : StubCompiler(isolate), registers_(registers) { } |
641 virtual ~BaseLoadStubCompiler() { } | 648 virtual ~BaseLoadStubCompiler() { } |
642 | 649 |
643 Handle<Code> CompileLoadField(Handle<JSObject> object, | 650 Handle<Code> CompileLoadField(Handle<JSObject> object, |
644 Handle<JSObject> holder, | 651 Handle<JSObject> holder, |
645 Handle<Name> name, | 652 Handle<Name> name, |
646 PropertyIndex index); | 653 PropertyIndex index, |
| 654 Representation representation); |
647 | 655 |
648 Handle<Code> CompileLoadCallback(Handle<JSObject> object, | 656 Handle<Code> CompileLoadCallback(Handle<JSObject> object, |
649 Handle<JSObject> holder, | 657 Handle<JSObject> holder, |
650 Handle<Name> name, | 658 Handle<Name> name, |
651 Handle<ExecutableAccessorInfo> callback); | 659 Handle<ExecutableAccessorInfo> callback); |
652 | 660 |
653 Handle<Code> CompileLoadConstant(Handle<JSObject> object, | 661 Handle<Code> CompileLoadConstant(Handle<JSObject> object, |
654 Handle<JSObject> holder, | 662 Handle<JSObject> holder, |
655 Handle<Name> name, | 663 Handle<Name> name, |
656 Handle<JSFunction> value); | 664 Handle<JSFunction> value); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 Label* success, | 696 Label* success, |
689 Handle<ExecutableAccessorInfo> callback); | 697 Handle<ExecutableAccessorInfo> callback); |
690 void NonexistentHandlerFrontend(Handle<JSObject> object, | 698 void NonexistentHandlerFrontend(Handle<JSObject> object, |
691 Handle<JSObject> last, | 699 Handle<JSObject> last, |
692 Handle<Name> name, | 700 Handle<Name> name, |
693 Label* success, | 701 Label* success, |
694 Handle<GlobalObject> global); | 702 Handle<GlobalObject> global); |
695 | 703 |
696 void GenerateLoadField(Register reg, | 704 void GenerateLoadField(Register reg, |
697 Handle<JSObject> holder, | 705 Handle<JSObject> holder, |
698 PropertyIndex index); | 706 PropertyIndex field, |
| 707 Representation representation); |
699 void GenerateLoadConstant(Handle<JSFunction> value); | 708 void GenerateLoadConstant(Handle<JSFunction> value); |
700 void GenerateLoadCallback(Register reg, | 709 void GenerateLoadCallback(Register reg, |
701 Handle<ExecutableAccessorInfo> callback); | 710 Handle<ExecutableAccessorInfo> callback); |
702 void GenerateLoadInterceptor(Register holder_reg, | 711 void GenerateLoadInterceptor(Register holder_reg, |
703 Handle<JSObject> object, | 712 Handle<JSObject> object, |
704 Handle<JSObject> holder, | 713 Handle<JSObject> holder, |
705 LookupResult* lookup, | 714 LookupResult* lookup, |
706 Handle<Name> name); | 715 Handle<Name> name); |
707 void GenerateLoadPostInterceptor(Register reg, | 716 void GenerateLoadPostInterceptor(Register reg, |
708 Handle<JSObject> interceptor_holder, | 717 Handle<JSObject> interceptor_holder, |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 Handle<JSFunction> constant_function_; | 1123 Handle<JSFunction> constant_function_; |
1115 bool is_simple_api_call_; | 1124 bool is_simple_api_call_; |
1116 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1125 Handle<FunctionTemplateInfo> expected_receiver_type_; |
1117 Handle<CallHandlerInfo> api_call_info_; | 1126 Handle<CallHandlerInfo> api_call_info_; |
1118 }; | 1127 }; |
1119 | 1128 |
1120 | 1129 |
1121 } } // namespace v8::internal | 1130 } } // namespace v8::internal |
1122 | 1131 |
1123 #endif // V8_STUB_CACHE_H_ | 1132 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |