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 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 | 1245 |
1246 | 1246 |
1247 void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) { | 1247 void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) { |
1248 if (kind_ == Code::KEYED_CALL_IC) { | 1248 if (kind_ == Code::KEYED_CALL_IC) { |
1249 __ cmp(r2, Operand(Handle<String>(name))); | 1249 __ cmp(r2, Operand(Handle<String>(name))); |
1250 __ b(ne, miss); | 1250 __ b(ne, miss); |
1251 } | 1251 } |
1252 } | 1252 } |
1253 | 1253 |
1254 | 1254 |
1255 Object* CallStubCompiler::GenerateMissBranch() { | 1255 void CallStubCompiler::GenerateMissBranch() { |
1256 Object* obj = StubCache::ComputeCallMiss(arguments().immediate(), kind_); | 1256 Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_); |
1257 if (obj->IsFailure()) return obj; | 1257 __ Jump(ic, RelocInfo::CODE_TARGET); |
1258 __ Jump(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET); | |
1259 return obj; | |
1260 } | 1258 } |
1261 | 1259 |
1262 | 1260 |
1263 Object* CallStubCompiler::CompileCallField(JSObject* object, | 1261 Object* CallStubCompiler::CompileCallField(JSObject* object, |
1264 JSObject* holder, | 1262 JSObject* holder, |
1265 int index, | 1263 int index, |
1266 String* name) { | 1264 String* name) { |
1267 // ----------- S t a t e ------------- | 1265 // ----------- S t a t e ------------- |
1268 // -- r2 : name | 1266 // -- r2 : name |
1269 // -- lr : return address | 1267 // -- lr : return address |
(...skipping 11 matching lines...) Expand all Loading... |
1281 __ b(eq, &miss); | 1279 __ b(eq, &miss); |
1282 | 1280 |
1283 // Do the right check and compute the holder register. | 1281 // Do the right check and compute the holder register. |
1284 Register reg = CheckPrototypes(object, r0, holder, r1, r3, r4, name, &miss); | 1282 Register reg = CheckPrototypes(object, r0, holder, r1, r3, r4, name, &miss); |
1285 GenerateFastPropertyLoad(masm(), r1, reg, holder, index); | 1283 GenerateFastPropertyLoad(masm(), r1, reg, holder, index); |
1286 | 1284 |
1287 GenerateCallFunction(masm(), object, arguments(), &miss); | 1285 GenerateCallFunction(masm(), object, arguments(), &miss); |
1288 | 1286 |
1289 // Handle call cache miss. | 1287 // Handle call cache miss. |
1290 __ bind(&miss); | 1288 __ bind(&miss); |
1291 Object* obj = GenerateMissBranch(); | 1289 GenerateMissBranch(); |
1292 if (obj->IsFailure()) return obj; | |
1293 | 1290 |
1294 // Return the generated code. | 1291 // Return the generated code. |
1295 return GetCode(FIELD, name); | 1292 return GetCode(FIELD, name); |
1296 } | 1293 } |
1297 | 1294 |
1298 | 1295 |
1299 Object* CallStubCompiler::CompileArrayPushCall(Object* object, | 1296 Object* CallStubCompiler::CompileArrayPushCall(Object* object, |
1300 JSObject* holder, | 1297 JSObject* holder, |
1301 JSFunction* function, | 1298 JSFunction* function, |
1302 String* name, | 1299 String* name, |
(...skipping 30 matching lines...) Expand all Loading... |
1333 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); | 1330 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
1334 __ str(r3, MemOperand(sp, argc * kPointerSize)); | 1331 __ str(r3, MemOperand(sp, argc * kPointerSize)); |
1335 } | 1332 } |
1336 | 1333 |
1337 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), | 1334 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), |
1338 argc + 1, | 1335 argc + 1, |
1339 1); | 1336 1); |
1340 | 1337 |
1341 // Handle call cache miss. | 1338 // Handle call cache miss. |
1342 __ bind(&miss); | 1339 __ bind(&miss); |
1343 Object* obj = GenerateMissBranch(); | 1340 GenerateMissBranch(); |
1344 if (obj->IsFailure()) return obj; | |
1345 | 1341 |
1346 // Return the generated code. | 1342 // Return the generated code. |
1347 return GetCode(function); | 1343 return GetCode(function); |
1348 } | 1344 } |
1349 | 1345 |
1350 | 1346 |
1351 Object* CallStubCompiler::CompileArrayPopCall(Object* object, | 1347 Object* CallStubCompiler::CompileArrayPopCall(Object* object, |
1352 JSObject* holder, | 1348 JSObject* holder, |
1353 JSFunction* function, | 1349 JSFunction* function, |
1354 String* name, | 1350 String* name, |
(...skipping 30 matching lines...) Expand all Loading... |
1385 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); | 1381 __ ldr(r3, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); |
1386 __ str(r3, MemOperand(sp, argc * kPointerSize)); | 1382 __ str(r3, MemOperand(sp, argc * kPointerSize)); |
1387 } | 1383 } |
1388 | 1384 |
1389 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), | 1385 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), |
1390 argc + 1, | 1386 argc + 1, |
1391 1); | 1387 1); |
1392 | 1388 |
1393 // Handle call cache miss. | 1389 // Handle call cache miss. |
1394 __ bind(&miss); | 1390 __ bind(&miss); |
1395 Object* obj = GenerateMissBranch(); | 1391 GenerateMissBranch(); |
1396 if (obj->IsFailure()) return obj; | |
1397 | 1392 |
1398 // Return the generated code. | 1393 // Return the generated code. |
1399 return GetCode(function); | 1394 return GetCode(function); |
1400 } | 1395 } |
1401 | 1396 |
1402 | 1397 |
1403 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object, | 1398 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object, |
1404 JSObject* holder, | 1399 JSObject* holder, |
1405 JSFunction* function, | 1400 JSFunction* function, |
1406 String* name, | 1401 String* name, |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); | 1554 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); |
1560 } | 1555 } |
1561 | 1556 |
1562 // Handle call cache miss. | 1557 // Handle call cache miss. |
1563 __ bind(&miss); | 1558 __ bind(&miss); |
1564 if (depth != kInvalidProtoDepth) { | 1559 if (depth != kInvalidProtoDepth) { |
1565 FreeSpaceForFastApiCall(masm()); | 1560 FreeSpaceForFastApiCall(masm()); |
1566 } | 1561 } |
1567 | 1562 |
1568 __ bind(&miss_in_smi_check); | 1563 __ bind(&miss_in_smi_check); |
1569 Object* obj = GenerateMissBranch(); | 1564 GenerateMissBranch(); |
1570 if (obj->IsFailure()) return obj; | |
1571 | 1565 |
1572 // Return the generated code. | 1566 // Return the generated code. |
1573 return GetCode(function); | 1567 return GetCode(function); |
1574 } | 1568 } |
1575 | 1569 |
1576 | 1570 |
1577 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, | 1571 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, |
1578 JSObject* holder, | 1572 JSObject* holder, |
1579 String* name) { | 1573 String* name) { |
1580 // ----------- S t a t e ------------- | 1574 // ----------- S t a t e ------------- |
(...skipping 28 matching lines...) Expand all Loading... |
1609 | 1603 |
1610 // Move returned value, the function to call, to r1. | 1604 // Move returned value, the function to call, to r1. |
1611 __ mov(r1, r0); | 1605 __ mov(r1, r0); |
1612 // Restore receiver. | 1606 // Restore receiver. |
1613 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 1607 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
1614 | 1608 |
1615 GenerateCallFunction(masm(), object, arguments(), &miss); | 1609 GenerateCallFunction(masm(), object, arguments(), &miss); |
1616 | 1610 |
1617 // Handle call cache miss. | 1611 // Handle call cache miss. |
1618 __ bind(&miss); | 1612 __ bind(&miss); |
1619 Object* obj = GenerateMissBranch(); | 1613 GenerateMissBranch(); |
1620 if (obj->IsFailure()) return obj; | |
1621 | 1614 |
1622 // Return the generated code. | 1615 // Return the generated code. |
1623 return GetCode(INTERCEPTOR, name); | 1616 return GetCode(INTERCEPTOR, name); |
1624 } | 1617 } |
1625 | 1618 |
1626 | 1619 |
1627 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, | 1620 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, |
1628 GlobalObject* holder, | 1621 GlobalObject* holder, |
1629 JSGlobalPropertyCell* cell, | 1622 JSGlobalPropertyCell* cell, |
1630 JSFunction* function, | 1623 JSFunction* function, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 __ IncrementCounter(&Counters::call_global_inline, 1, r3, r4); | 1687 __ IncrementCounter(&Counters::call_global_inline, 1, r3, r4); |
1695 ASSERT(function->is_compiled()); | 1688 ASSERT(function->is_compiled()); |
1696 Handle<Code> code(function->code()); | 1689 Handle<Code> code(function->code()); |
1697 ParameterCount expected(function->shared()->formal_parameter_count()); | 1690 ParameterCount expected(function->shared()->formal_parameter_count()); |
1698 __ InvokeCode(code, expected, arguments(), | 1691 __ InvokeCode(code, expected, arguments(), |
1699 RelocInfo::CODE_TARGET, JUMP_FUNCTION); | 1692 RelocInfo::CODE_TARGET, JUMP_FUNCTION); |
1700 | 1693 |
1701 // Handle call cache miss. | 1694 // Handle call cache miss. |
1702 __ bind(&miss); | 1695 __ bind(&miss); |
1703 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); | 1696 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); |
1704 Object* obj = GenerateMissBranch(); | 1697 GenerateMissBranch(); |
1705 if (obj->IsFailure()) return obj; | |
1706 | 1698 |
1707 // Return the generated code. | 1699 // Return the generated code. |
1708 return GetCode(NORMAL, name); | 1700 return GetCode(NORMAL, name); |
1709 } | 1701 } |
1710 | 1702 |
1711 | 1703 |
1712 Object* StoreStubCompiler::CompileStoreField(JSObject* object, | 1704 Object* StoreStubCompiler::CompileStoreField(JSObject* object, |
1713 int index, | 1705 int index, |
1714 Map* transition, | 1706 Map* transition, |
1715 String* name) { | 1707 String* name) { |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2386 // Return the generated code. | 2378 // Return the generated code. |
2387 return GetCode(); | 2379 return GetCode(); |
2388 } | 2380 } |
2389 | 2381 |
2390 | 2382 |
2391 #undef __ | 2383 #undef __ |
2392 | 2384 |
2393 } } // namespace v8::internal | 2385 } } // namespace v8::internal |
2394 | 2386 |
2395 #endif // V8_TARGET_ARCH_ARM | 2387 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |