| 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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 // Tear down temporary frame. | 1001 // Tear down temporary frame. |
| 1002 __ LeaveInternalFrame(); | 1002 __ LeaveInternalFrame(); |
| 1003 | 1003 |
| 1004 // Do a tail-call of the compiled function. | 1004 // Do a tail-call of the compiled function. |
| 1005 __ Jump(r2); | 1005 __ Jump(r2); |
| 1006 | 1006 |
| 1007 return GetCodeWithFlags(flags, "LazyCompileStub"); | 1007 return GetCodeWithFlags(flags, "LazyCompileStub"); |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 | 1010 |
| 1011 void CallStubCompiler::GenerateMissBranch() { |
| 1012 Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_); |
| 1013 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 1014 } |
| 1015 |
| 1016 |
| 1011 Object* CallStubCompiler::CompileCallField(JSObject* object, | 1017 Object* CallStubCompiler::CompileCallField(JSObject* object, |
| 1012 JSObject* holder, | 1018 JSObject* holder, |
| 1013 int index, | 1019 int index, |
| 1014 String* name) { | 1020 String* name) { |
| 1015 // ----------- S t a t e ------------- | 1021 // ----------- S t a t e ------------- |
| 1016 // -- r2 : name | 1022 // -- r2 : name |
| 1017 // -- lr : return address | 1023 // -- lr : return address |
| 1018 // ----------------------------------- | 1024 // ----------------------------------- |
| 1019 Label miss; | 1025 Label miss; |
| 1020 | 1026 |
| 1021 const int argc = arguments().immediate(); | 1027 const int argc = arguments().immediate(); |
| 1022 | 1028 |
| 1023 // Get the receiver of the function from the stack into r0. | 1029 // Get the receiver of the function from the stack into r0. |
| 1024 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 1030 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
| 1025 // Check that the receiver isn't a smi. | 1031 // Check that the receiver isn't a smi. |
| 1026 __ tst(r0, Operand(kSmiTagMask)); | 1032 __ tst(r0, Operand(kSmiTagMask)); |
| 1027 __ b(eq, &miss); | 1033 __ b(eq, &miss); |
| 1028 | 1034 |
| 1029 // Do the right check and compute the holder register. | 1035 // Do the right check and compute the holder register. |
| 1030 Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss); | 1036 Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss); |
| 1031 GenerateFastPropertyLoad(masm(), r1, reg, holder, index); | 1037 GenerateFastPropertyLoad(masm(), r1, reg, holder, index); |
| 1032 | 1038 |
| 1033 GenerateCallFunction(masm(), object, arguments(), &miss); | 1039 GenerateCallFunction(masm(), object, arguments(), &miss); |
| 1034 | 1040 |
| 1035 // Handle call cache miss. | 1041 // Handle call cache miss. |
| 1036 __ bind(&miss); | 1042 __ bind(&miss); |
| 1037 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1043 GenerateMissBranch(); |
| 1038 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1039 | 1044 |
| 1040 // Return the generated code. | 1045 // Return the generated code. |
| 1041 return GetCode(FIELD, name); | 1046 return GetCode(FIELD, name); |
| 1042 } | 1047 } |
| 1043 | 1048 |
| 1044 | 1049 |
| 1045 Object* CallStubCompiler::CompileArrayPushCall(Object* object, | 1050 Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
| 1046 JSObject* holder, | 1051 JSObject* holder, |
| 1047 JSFunction* function, | 1052 JSFunction* function, |
| 1048 String* name, | 1053 String* name, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1077 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); | 1082 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
| 1078 __ str(r3, MemOperand(sp, argc * kPointerSize)); | 1083 __ str(r3, MemOperand(sp, argc * kPointerSize)); |
| 1079 } | 1084 } |
| 1080 | 1085 |
| 1081 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), | 1086 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), |
| 1082 argc + 1, | 1087 argc + 1, |
| 1083 1); | 1088 1); |
| 1084 | 1089 |
| 1085 // Handle call cache miss. | 1090 // Handle call cache miss. |
| 1086 __ bind(&miss); | 1091 __ bind(&miss); |
| 1087 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1092 GenerateMissBranch(); |
| 1088 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1089 | 1093 |
| 1090 // Return the generated code. | 1094 // Return the generated code. |
| 1091 return GetCode(function); | 1095 return GetCode(function); |
| 1092 } | 1096 } |
| 1093 | 1097 |
| 1094 | 1098 |
| 1095 Object* CallStubCompiler::CompileArrayPopCall(Object* object, | 1099 Object* CallStubCompiler::CompileArrayPopCall(Object* object, |
| 1096 JSObject* holder, | 1100 JSObject* holder, |
| 1097 JSFunction* function, | 1101 JSFunction* function, |
| 1098 String* name, | 1102 String* name, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1127 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); | 1131 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
| 1128 __ str(r3, MemOperand(sp, argc * kPointerSize)); | 1132 __ str(r3, MemOperand(sp, argc * kPointerSize)); |
| 1129 } | 1133 } |
| 1130 | 1134 |
| 1131 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), | 1135 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), |
| 1132 argc + 1, | 1136 argc + 1, |
| 1133 1); | 1137 1); |
| 1134 | 1138 |
| 1135 // Handle call cache miss. | 1139 // Handle call cache miss. |
| 1136 __ bind(&miss); | 1140 __ bind(&miss); |
| 1137 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1141 GenerateMissBranch(); |
| 1138 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1139 | 1142 |
| 1140 // Return the generated code. | 1143 // Return the generated code. |
| 1141 return GetCode(function); | 1144 return GetCode(function); |
| 1142 } | 1145 } |
| 1143 | 1146 |
| 1144 | 1147 |
| 1145 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object, | 1148 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object, |
| 1146 JSObject* holder, | 1149 JSObject* holder, |
| 1147 JSFunction* function, | 1150 JSFunction* function, |
| 1148 String* name, | 1151 String* name, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); | 1305 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); |
| 1303 } | 1306 } |
| 1304 | 1307 |
| 1305 // Handle call cache miss. | 1308 // Handle call cache miss. |
| 1306 __ bind(&miss); | 1309 __ bind(&miss); |
| 1307 if (depth != kInvalidProtoDepth) { | 1310 if (depth != kInvalidProtoDepth) { |
| 1308 FreeSpaceForFastApiCall(masm()); | 1311 FreeSpaceForFastApiCall(masm()); |
| 1309 } | 1312 } |
| 1310 | 1313 |
| 1311 __ bind(&miss_in_smi_check); | 1314 __ bind(&miss_in_smi_check); |
| 1312 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1315 GenerateMissBranch(); |
| 1313 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1314 | 1316 |
| 1315 // Return the generated code. | 1317 // Return the generated code. |
| 1316 return GetCode(function); | 1318 return GetCode(function); |
| 1317 } | 1319 } |
| 1318 | 1320 |
| 1319 | 1321 |
| 1320 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, | 1322 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
| 1321 JSObject* holder, | 1323 JSObject* holder, |
| 1322 String* name) { | 1324 String* name) { |
| 1323 // ----------- S t a t e ------------- | 1325 // ----------- S t a t e ------------- |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1349 | 1351 |
| 1350 // Move returned value, the function to call, to r1. | 1352 // Move returned value, the function to call, to r1. |
| 1351 __ mov(r1, r0); | 1353 __ mov(r1, r0); |
| 1352 // Restore receiver. | 1354 // Restore receiver. |
| 1353 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 1355 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
| 1354 | 1356 |
| 1355 GenerateCallFunction(masm(), object, arguments(), &miss); | 1357 GenerateCallFunction(masm(), object, arguments(), &miss); |
| 1356 | 1358 |
| 1357 // Handle call cache miss. | 1359 // Handle call cache miss. |
| 1358 __ bind(&miss); | 1360 __ bind(&miss); |
| 1359 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1361 GenerateMissBranch(); |
| 1360 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1361 | 1362 |
| 1362 // Return the generated code. | 1363 // Return the generated code. |
| 1363 return GetCode(INTERCEPTOR, name); | 1364 return GetCode(INTERCEPTOR, name); |
| 1364 } | 1365 } |
| 1365 | 1366 |
| 1366 | 1367 |
| 1367 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, | 1368 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, |
| 1368 GlobalObject* holder, | 1369 GlobalObject* holder, |
| 1369 JSGlobalPropertyCell* cell, | 1370 JSGlobalPropertyCell* cell, |
| 1370 JSFunction* function, | 1371 JSFunction* function, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 __ IncrementCounter(&Counters::call_global_inline, 1, r3, r4); | 1433 __ IncrementCounter(&Counters::call_global_inline, 1, r3, r4); |
| 1433 ASSERT(function->is_compiled()); | 1434 ASSERT(function->is_compiled()); |
| 1434 Handle<Code> code(function->code()); | 1435 Handle<Code> code(function->code()); |
| 1435 ParameterCount expected(function->shared()->formal_parameter_count()); | 1436 ParameterCount expected(function->shared()->formal_parameter_count()); |
| 1436 __ InvokeCode(code, expected, arguments(), | 1437 __ InvokeCode(code, expected, arguments(), |
| 1437 RelocInfo::CODE_TARGET, JUMP_FUNCTION); | 1438 RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
| 1438 | 1439 |
| 1439 // Handle call cache miss. | 1440 // Handle call cache miss. |
| 1440 __ bind(&miss); | 1441 __ bind(&miss); |
| 1441 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); | 1442 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); |
| 1442 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 1443 GenerateMissBranch(); |
| 1443 __ Jump(ic, RelocInfo::CODE_TARGET); | |
| 1444 | 1444 |
| 1445 // Return the generated code. | 1445 // Return the generated code. |
| 1446 return GetCode(NORMAL, name); | 1446 return GetCode(NORMAL, name); |
| 1447 } | 1447 } |
| 1448 | 1448 |
| 1449 | 1449 |
| 1450 Object* StoreStubCompiler::CompileStoreField(JSObject* object, | 1450 Object* StoreStubCompiler::CompileStoreField(JSObject* object, |
| 1451 int index, | 1451 int index, |
| 1452 Map* transition, | 1452 Map* transition, |
| 1453 String* name) { | 1453 String* name) { |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2122 // Return the generated code. | 2122 // Return the generated code. |
| 2123 return GetCode(); | 2123 return GetCode(); |
| 2124 } | 2124 } |
| 2125 | 2125 |
| 2126 | 2126 |
| 2127 #undef __ | 2127 #undef __ |
| 2128 | 2128 |
| 2129 } } // namespace v8::internal | 2129 } } // namespace v8::internal |
| 2130 | 2130 |
| 2131 #endif // V8_TARGET_ARCH_ARM | 2131 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |