Chromium Code Reviews| 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 558 } | 558 } |
| 559 } | 559 } |
| 560 | 560 |
| 561 | 561 |
| 562 // Undoes the effects of ReserveSpaceForFastApiCall. | 562 // Undoes the effects of ReserveSpaceForFastApiCall. |
| 563 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { | 563 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { |
| 564 __ Drop(kFastApiCallArguments); | 564 __ Drop(kFastApiCallArguments); |
| 565 } | 565 } |
| 566 | 566 |
| 567 | 567 |
| 568 static MaybeObject* GenerateFastApiDirectCall( | 568 static MaybeObject* GenerateFastApiDirectCall( |
|
Vyacheslav Egorov (Chromium)
2011/10/12 12:36:05
This function returns MaybeObject*
Some callers m
| |
| 569 MacroAssembler* masm, | 569 MacroAssembler* masm, |
| 570 const CallOptimization& optimization, | 570 const CallOptimization& optimization, |
| 571 int argc) { | 571 int argc) { |
| 572 // ----------- S t a t e ------------- | 572 // ----------- S t a t e ------------- |
| 573 // -- sp[0] : holder (set by CheckPrototypes) | 573 // -- sp[0] : holder (set by CheckPrototypes) |
| 574 // -- sp[4] : callee js function | 574 // -- sp[4] : callee js function |
| 575 // -- sp[8] : call data | 575 // -- sp[8] : call data |
| 576 // -- sp[12] : last js argument | 576 // -- sp[12] : last js argument |
| 577 // -- ... | 577 // -- ... |
| 578 // -- sp[(argc + 3) * 4] : first js argument | 578 // -- sp[(argc + 3) * 4] : first js argument |
| 579 // -- sp[(argc + 4) * 4] : receiver | 579 // -- sp[(argc + 4) * 4] : receiver |
| 580 // ----------------------------------- | 580 // ----------------------------------- |
| 581 // Get the function and setup the context. | 581 // Get the function and setup the context. |
| 582 JSFunction* function = optimization.constant_function(); | 582 JSFunction* function = optimization.constant_function(); |
| 583 __ mov(r5, Operand(Handle<JSFunction>(function))); | 583 __ LoadHeapObject(r5, Handle<JSFunction>(function)); |
| 584 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); | 584 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); |
| 585 | 585 |
| 586 // Pass the additional arguments FastHandleApiCall expects. | 586 // Pass the additional arguments FastHandleApiCall expects. |
| 587 Object* call_data = optimization.api_call_info()->data(); | 587 Object* call_data = optimization.api_call_info()->data(); |
| 588 Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info()); | 588 Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info()); |
| 589 if (masm->isolate()->heap()->InNewSpace(call_data)) { | 589 if (masm->isolate()->heap()->InNewSpace(call_data)) { |
| 590 __ Move(r0, api_call_info_handle); | 590 __ Move(r0, api_call_info_handle); |
| 591 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 591 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
| 592 } else { | 592 } else { |
| 593 __ Move(r6, Handle<Object>(call_data)); | 593 __ Move(r6, Handle<Object>(call_data)); |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1182 | 1182 |
| 1183 // Check that the maps haven't changed. | 1183 // Check that the maps haven't changed. |
| 1184 Register reg = | 1184 Register reg = |
| 1185 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, | 1185 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, |
| 1186 name, miss); | 1186 name, miss); |
| 1187 GenerateFastPropertyLoad(masm(), r0, reg, holder, index); | 1187 GenerateFastPropertyLoad(masm(), r0, reg, holder, index); |
| 1188 __ Ret(); | 1188 __ Ret(); |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 | 1191 |
| 1192 void StubCompiler::GenerateLoadConstant(JSObject* object, | 1192 void StubCompiler::GenerateLoadConstant(JSObject* object, |
|
Vyacheslav Egorov (Chromium)
2011/10/12 12:36:05
some callers of this function are not handlfied an
| |
| 1193 JSObject* holder, | 1193 JSObject* holder, |
| 1194 Register receiver, | 1194 Register receiver, |
| 1195 Register scratch1, | 1195 Register scratch1, |
| 1196 Register scratch2, | 1196 Register scratch2, |
| 1197 Register scratch3, | 1197 Register scratch3, |
| 1198 Object* value, | 1198 JSFunction* value, |
| 1199 String* name, | 1199 String* name, |
| 1200 Label* miss) { | 1200 Label* miss) { |
| 1201 // Check that the receiver isn't a smi. | 1201 // Check that the receiver isn't a smi. |
| 1202 __ JumpIfSmi(receiver, miss); | 1202 __ JumpIfSmi(receiver, miss); |
| 1203 | 1203 |
| 1204 // Check that the maps haven't changed. | 1204 // Check that the maps haven't changed. |
| 1205 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, name, | 1205 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, name, |
| 1206 miss); | 1206 miss); |
| 1207 | 1207 |
| 1208 // Return the constant value. | 1208 // Return the constant value. |
| 1209 __ mov(r0, Operand(Handle<Object>(value))); | 1209 __ LoadHeapObject(r0, Handle<JSFunction>(value)); |
| 1210 __ Ret(); | 1210 __ Ret(); |
| 1211 } | 1211 } |
| 1212 | 1212 |
| 1213 | 1213 |
| 1214 MaybeObject* StubCompiler::GenerateLoadCallback(JSObject* object, | 1214 MaybeObject* StubCompiler::GenerateLoadCallback(JSObject* object, |
| 1215 JSObject* holder, | 1215 JSObject* holder, |
| 1216 Register receiver, | 1216 Register receiver, |
| 1217 Register name_reg, | 1217 Register name_reg, |
| 1218 Register scratch1, | 1218 Register scratch1, |
| 1219 Register scratch2, | 1219 Register scratch2, |
| (...skipping 1653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2873 __ bind(&miss); | 2873 __ bind(&miss); |
| 2874 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2874 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2875 | 2875 |
| 2876 // Return the generated code. | 2876 // Return the generated code. |
| 2877 return GetCode(CALLBACKS, name); | 2877 return GetCode(CALLBACKS, name); |
| 2878 } | 2878 } |
| 2879 | 2879 |
| 2880 | 2880 |
| 2881 MaybeObject* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 2881 MaybeObject* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
| 2882 JSObject* holder, | 2882 JSObject* holder, |
| 2883 Object* value, | 2883 JSFunction* value, |
| 2884 String* name) { | 2884 String* name) { |
| 2885 // ----------- S t a t e ------------- | 2885 // ----------- S t a t e ------------- |
| 2886 // -- r0 : receiver | 2886 // -- r0 : receiver |
| 2887 // -- r2 : name | 2887 // -- r2 : name |
| 2888 // -- lr : return address | 2888 // -- lr : return address |
| 2889 // ----------------------------------- | 2889 // ----------------------------------- |
| 2890 Label miss; | 2890 Label miss; |
| 2891 | 2891 |
| 2892 GenerateLoadConstant(object, holder, r0, r3, r1, r4, value, name, &miss); | 2892 GenerateLoadConstant(object, holder, r0, r3, r1, r4, value, name, &miss); |
| 2893 __ bind(&miss); | 2893 __ bind(&miss); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3024 __ bind(&miss); | 3024 __ bind(&miss); |
| 3025 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 3025 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 3026 | 3026 |
| 3027 return GetCode(CALLBACKS, name); | 3027 return GetCode(CALLBACKS, name); |
| 3028 } | 3028 } |
| 3029 | 3029 |
| 3030 | 3030 |
| 3031 MaybeObject* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 3031 MaybeObject* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
| 3032 JSObject* receiver, | 3032 JSObject* receiver, |
| 3033 JSObject* holder, | 3033 JSObject* holder, |
| 3034 Object* value) { | 3034 JSFunction* value) { |
| 3035 // ----------- S t a t e ------------- | 3035 // ----------- S t a t e ------------- |
| 3036 // -- lr : return address | 3036 // -- lr : return address |
| 3037 // -- r0 : key | 3037 // -- r0 : key |
| 3038 // -- r1 : receiver | 3038 // -- r1 : receiver |
| 3039 // ----------------------------------- | 3039 // ----------------------------------- |
| 3040 Label miss; | 3040 Label miss; |
| 3041 | 3041 |
| 3042 // Check the key is the cached one. | 3042 // Check the key is the cached one. |
| 3043 __ cmp(r0, Operand(Handle<String>(name))); | 3043 __ cmp(r0, Operand(Handle<String>(name))); |
| 3044 __ b(ne, &miss); | 3044 __ b(ne, &miss); |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4443 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4443 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4444 __ Jump(ic, RelocInfo::CODE_TARGET); | 4444 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 4445 } | 4445 } |
| 4446 | 4446 |
| 4447 | 4447 |
| 4448 #undef __ | 4448 #undef __ |
| 4449 | 4449 |
| 4450 } } // namespace v8::internal | 4450 } } // namespace v8::internal |
| 4451 | 4451 |
| 4452 #endif // V8_TARGET_ARCH_ARM | 4452 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |