Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 600 JSFunction* function = optimization.constant_function(); | 600 JSFunction* function = optimization.constant_function(); |
| 601 __ mov(r7, Operand(Handle<JSFunction>(function))); | 601 __ mov(r7, Operand(Handle<JSFunction>(function))); |
| 602 __ ldr(cp, FieldMemOperand(r7, JSFunction::kContextOffset)); | 602 __ ldr(cp, FieldMemOperand(r7, JSFunction::kContextOffset)); |
| 603 | 603 |
| 604 // Pass the additional arguments FastHandleApiCall expects. | 604 // Pass the additional arguments FastHandleApiCall expects. |
| 605 bool info_loaded = false; | 605 bool info_loaded = false; |
| 606 Object* callback = optimization.api_call_info()->callback(); | 606 Object* callback = optimization.api_call_info()->callback(); |
| 607 if (Heap::InNewSpace(callback)) { | 607 if (Heap::InNewSpace(callback)) { |
| 608 info_loaded = true; | 608 info_loaded = true; |
| 609 __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info())); | 609 __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info())); |
| 610 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kCallbackOffset)); | 610 __ ldr(r5, FieldMemOperand(r0, CallHandlerInfo::kCallbackOffset)); |
| 611 } else { | 611 } else { |
| 612 __ Move(r6, Handle<Object>(callback)); | 612 __ Move(r5, Handle<Object>(callback)); |
| 613 } | 613 } |
| 614 Object* call_data = optimization.api_call_info()->data(); | 614 Object* call_data = optimization.api_call_info()->data(); |
| 615 if (Heap::InNewSpace(call_data)) { | 615 if (Heap::InNewSpace(call_data)) { |
| 616 if (!info_loaded) { | 616 if (!info_loaded) { |
| 617 __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info())); | 617 __ Move(r0, Handle<CallHandlerInfo>(optimization.api_call_info())); |
| 618 } | 618 } |
| 619 __ ldr(r5, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 619 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
| 620 } else { | 620 } else { |
| 621 __ Move(r5, Handle<Object>(call_data)); | 621 __ Move(r6, Handle<Object>(call_data)); |
| 622 } | 622 } |
| 623 | 623 |
| 624 __ add(sp, sp, Operand(1 * kPointerSize)); | 624 __ add(sp, sp, Operand(1 * kPointerSize)); |
| 625 __ stm(ia, sp, r5.bit() | r6.bit() | r7.bit()); | 625 __ stm(ia, sp, r5.bit() | r6.bit() | r7.bit()); |
| 626 __ sub(sp, sp, Operand(1 * kPointerSize)); | 626 __ sub(sp, sp, Operand(1 * kPointerSize)); |
| 627 | 627 |
| 628 // Set the number of arguments. | 628 // Set the number of arguments. |
| 629 __ mov(r0, Operand(argc + 4)); | 629 __ mov(r0, Operand(argc + 4)); |
| 630 | 630 |
| 631 // Jump to the fast api call builtin (tail call). | 631 // Jump to the fast api call builtin (tail call). |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1074 // Check that the receiver isn't a smi. | 1074 // Check that the receiver isn't a smi. |
| 1075 __ tst(receiver, Operand(kSmiTagMask)); | 1075 __ tst(receiver, Operand(kSmiTagMask)); |
| 1076 __ b(eq, miss); | 1076 __ b(eq, miss); |
| 1077 | 1077 |
| 1078 // Check that the maps haven't changed. | 1078 // Check that the maps haven't changed. |
| 1079 Register reg = | 1079 Register reg = |
| 1080 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, | 1080 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, |
| 1081 name, miss); | 1081 name, miss); |
| 1082 | 1082 |
| 1083 // Push the arguments on the JS stack of the caller. | 1083 // Push the arguments on the JS stack of the caller. |
| 1084 __ push(receiver); // Receiver. | 1084 __ push(receiver); // Receiver |
|
antonm
2010/11/17 14:10:32
nit: probably change R -> r as you remove a dot.
SeRya
2010/11/17 15:36:29
Reverted change in this line.
| |
| 1085 __ push(reg); // Holder. | |
| 1086 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data | 1085 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data |
|
antonm
2010/11/17 14:10:32
why such a change, __ Push(reg, ip, name_reg) appa
SeRya
2010/11/17 15:36:29
It would work, but generates more instructions. |P
| |
| 1087 __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset)); | 1086 __ ldr(scratch3, FieldMemOperand(ip, AccessorInfo::kDataOffset)); |
| 1088 __ Push(ip, reg, name_reg); | 1087 __ Push(reg, scratch3, ip); |
| 1088 __ push(name_reg); | |
| 1089 | 1089 |
| 1090 // Do tail-call to the runtime system. | 1090 // Do tail-call to the runtime system. |
| 1091 ExternalReference load_callback_property = | 1091 ExternalReference load_callback_property = |
| 1092 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 1092 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
| 1093 __ TailCallExternalReference(load_callback_property, 5, 1); | 1093 __ TailCallExternalReference(load_callback_property, 5, 1); |
| 1094 | 1094 |
| 1095 return true; | 1095 return true; |
| 1096 } | 1096 } |
| 1097 | 1097 |
| 1098 | 1098 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 ASSERT(callback != NULL); | 1201 ASSERT(callback != NULL); |
| 1202 ASSERT(callback->getter() != NULL); | 1202 ASSERT(callback->getter() != NULL); |
| 1203 | 1203 |
| 1204 // Tail call to runtime. | 1204 // Tail call to runtime. |
| 1205 // Important invariant in CALLBACKS case: the code above must be | 1205 // Important invariant in CALLBACKS case: the code above must be |
| 1206 // structured to never clobber |receiver| register. | 1206 // structured to never clobber |receiver| register. |
| 1207 __ Move(scratch2, Handle<AccessorInfo>(callback)); | 1207 __ Move(scratch2, Handle<AccessorInfo>(callback)); |
| 1208 // holder_reg is either receiver or scratch1. | 1208 // holder_reg is either receiver or scratch1. |
| 1209 if (!receiver.is(holder_reg)) { | 1209 if (!receiver.is(holder_reg)) { |
| 1210 ASSERT(scratch1.is(holder_reg)); | 1210 ASSERT(scratch1.is(holder_reg)); |
| 1211 __ Push(receiver, holder_reg, scratch2); | 1211 __ ldr(scratch3, |
|
antonm
2010/11/17 14:10:32
why scratch3? it looks like the diff might be mad
SeRya
2010/11/17 15:36:29
Done.
| |
| 1212 __ ldr(scratch1, | |
| 1213 FieldMemOperand(holder_reg, AccessorInfo::kDataOffset)); | 1212 FieldMemOperand(holder_reg, AccessorInfo::kDataOffset)); |
| 1214 __ Push(scratch1, name_reg); | 1213 __ Push(receiver, holder_reg, scratch3); |
| 1214 __ Push(scratch2, name_reg); | |
| 1215 } else { | 1215 } else { |
| 1216 __ push(receiver); | 1216 __ push(receiver); |
| 1217 __ ldr(scratch1, | 1217 __ ldr(scratch1, |
| 1218 FieldMemOperand(holder_reg, AccessorInfo::kDataOffset)); | 1218 FieldMemOperand(holder_reg, AccessorInfo::kDataOffset)); |
| 1219 __ Push(holder_reg, scratch2, scratch1, name_reg); | 1219 __ Push(holder_reg, scratch1, scratch2, name_reg); |
| 1220 } | 1220 } |
| 1221 | 1221 |
| 1222 ExternalReference ref = | 1222 ExternalReference ref = |
| 1223 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 1223 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
| 1224 __ TailCallExternalReference(ref, 5, 1); | 1224 __ TailCallExternalReference(ref, 5, 1); |
| 1225 } | 1225 } |
| 1226 } else { // !compile_followup_inline | 1226 } else { // !compile_followup_inline |
| 1227 // Call the runtime system to load the interceptor. | 1227 // Call the runtime system to load the interceptor. |
| 1228 // Check that the maps haven't changed. | 1228 // Check that the maps haven't changed. |
| 1229 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, | 1229 Register holder_reg = CheckPrototypes(object, receiver, interceptor_holder, |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2745 // Return the generated code. | 2745 // Return the generated code. |
| 2746 return GetCode(); | 2746 return GetCode(); |
| 2747 } | 2747 } |
| 2748 | 2748 |
| 2749 | 2749 |
| 2750 #undef __ | 2750 #undef __ |
| 2751 | 2751 |
| 2752 } } // namespace v8::internal | 2752 } } // namespace v8::internal |
| 2753 | 2753 |
| 2754 #endif // V8_TARGET_ARCH_ARM | 2754 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |