OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // -- sp[0] : holder (set by CheckPrototypes) | 567 // -- sp[0] : holder (set by CheckPrototypes) |
568 // -- sp[4] : callee js function | 568 // -- sp[4] : callee js function |
569 // -- sp[8] : call data | 569 // -- sp[8] : call data |
570 // -- sp[12] : last js argument | 570 // -- sp[12] : last js argument |
571 // -- ... | 571 // -- ... |
572 // -- sp[(argc + 3) * 4] : first js argument | 572 // -- sp[(argc + 3) * 4] : first js argument |
573 // -- sp[(argc + 4) * 4] : receiver | 573 // -- sp[(argc + 4) * 4] : receiver |
574 // ----------------------------------- | 574 // ----------------------------------- |
575 // Get the function and setup the context. | 575 // Get the function and setup the context. |
576 Handle<JSFunction> function = optimization.constant_function(); | 576 Handle<JSFunction> function = optimization.constant_function(); |
577 __ li(t1, Operand(function)); | 577 __ LoadHeapObject(t1, function); |
578 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset)); | 578 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset)); |
579 | 579 |
580 // Pass the additional arguments FastHandleApiCall expects. | 580 // Pass the additional arguments FastHandleApiCall expects. |
581 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 581 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
582 Handle<Object> call_data(api_call_info->data()); | 582 Handle<Object> call_data(api_call_info->data()); |
583 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 583 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
584 __ li(a0, api_call_info); | 584 __ li(a0, api_call_info); |
585 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); | 585 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); |
586 } else { | 586 } else { |
587 __ li(t2, call_data); | 587 __ li(t2, call_data); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 __ Ret(); | 1108 __ Ret(); |
1109 } | 1109 } |
1110 | 1110 |
1111 | 1111 |
1112 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, | 1112 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, |
1113 Handle<JSObject> holder, | 1113 Handle<JSObject> holder, |
1114 Register receiver, | 1114 Register receiver, |
1115 Register scratch1, | 1115 Register scratch1, |
1116 Register scratch2, | 1116 Register scratch2, |
1117 Register scratch3, | 1117 Register scratch3, |
1118 Handle<Object> value, | 1118 Handle<JSFunction> value, |
1119 Handle<String> name, | 1119 Handle<String> name, |
1120 Label* miss) { | 1120 Label* miss) { |
1121 // Check that the receiver isn't a smi. | 1121 // Check that the receiver isn't a smi. |
1122 __ JumpIfSmi(receiver, miss, scratch1); | 1122 __ JumpIfSmi(receiver, miss, scratch1); |
1123 | 1123 |
1124 // Check that the maps haven't changed. | 1124 // Check that the maps haven't changed. |
1125 Register reg = | 1125 Register reg = |
1126 CheckPrototypes(object, receiver, holder, | 1126 CheckPrototypes(object, receiver, holder, |
1127 scratch1, scratch2, scratch3, name, miss); | 1127 scratch1, scratch2, scratch3, name, miss); |
1128 | 1128 |
1129 // Return the constant value. | 1129 // Return the constant value. |
1130 __ li(v0, Operand(value)); | 1130 __ LoadHeapObject(v0, value); |
1131 __ Ret(); | 1131 __ Ret(); |
1132 } | 1132 } |
1133 | 1133 |
1134 | 1134 |
1135 void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, | 1135 void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, |
1136 Handle<JSObject> holder, | 1136 Handle<JSObject> holder, |
1137 Register receiver, | 1137 Register receiver, |
1138 Register name_reg, | 1138 Register name_reg, |
1139 Register scratch1, | 1139 Register scratch1, |
1140 Register scratch2, | 1140 Register scratch2, |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2702 __ bind(&miss); | 2702 __ bind(&miss); |
2703 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2703 GenerateLoadMiss(masm(), Code::LOAD_IC); |
2704 | 2704 |
2705 // Return the generated code. | 2705 // Return the generated code. |
2706 return GetCode(CALLBACKS, name); | 2706 return GetCode(CALLBACKS, name); |
2707 } | 2707 } |
2708 | 2708 |
2709 | 2709 |
2710 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 2710 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
2711 Handle<JSObject> holder, | 2711 Handle<JSObject> holder, |
2712 Handle<Object> value, | 2712 Handle<JSFunction> value, |
2713 Handle<String> name) { | 2713 Handle<String> name) { |
2714 // ----------- S t a t e ------------- | 2714 // ----------- S t a t e ------------- |
2715 // -- a0 : receiver | 2715 // -- a0 : receiver |
2716 // -- a2 : name | 2716 // -- a2 : name |
2717 // -- ra : return address | 2717 // -- ra : return address |
2718 // ----------------------------------- | 2718 // ----------------------------------- |
2719 Label miss; | 2719 Label miss; |
2720 | 2720 |
2721 GenerateLoadConstant(object, holder, a0, a3, a1, t0, value, name, &miss); | 2721 GenerateLoadConstant(object, holder, a0, a3, a1, t0, value, name, &miss); |
2722 __ bind(&miss); | 2722 __ bind(&miss); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 2840 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
2841 | 2841 |
2842 return GetCode(CALLBACKS, name); | 2842 return GetCode(CALLBACKS, name); |
2843 } | 2843 } |
2844 | 2844 |
2845 | 2845 |
2846 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( | 2846 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( |
2847 Handle<String> name, | 2847 Handle<String> name, |
2848 Handle<JSObject> receiver, | 2848 Handle<JSObject> receiver, |
2849 Handle<JSObject> holder, | 2849 Handle<JSObject> holder, |
2850 Handle<Object> value) { | 2850 Handle<JSFunction> value) { |
2851 // ----------- S t a t e ------------- | 2851 // ----------- S t a t e ------------- |
2852 // -- ra : return address | 2852 // -- ra : return address |
2853 // -- a0 : key | 2853 // -- a0 : key |
2854 // -- a1 : receiver | 2854 // -- a1 : receiver |
2855 // ----------------------------------- | 2855 // ----------------------------------- |
2856 Label miss; | 2856 Label miss; |
2857 | 2857 |
2858 // Check the key is the cached one. | 2858 // Check the key is the cached one. |
2859 __ Branch(&miss, ne, a0, Operand(name)); | 2859 __ Branch(&miss, ne, a0, Operand(name)); |
2860 | 2860 |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4313 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 4313 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
4314 __ Jump(ic_miss, RelocInfo::CODE_TARGET); | 4314 __ Jump(ic_miss, RelocInfo::CODE_TARGET); |
4315 } | 4315 } |
4316 | 4316 |
4317 | 4317 |
4318 #undef __ | 4318 #undef __ |
4319 | 4319 |
4320 } } // namespace v8::internal | 4320 } } // namespace v8::internal |
4321 | 4321 |
4322 #endif // V8_TARGET_ARCH_MIPS | 4322 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |