Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 3078033: Version 2.3.6 (Closed)
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 1280
1281 1281
1282 void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) { 1282 void CallStubCompiler::GenerateNameCheck(String* name, Label* miss) {
1283 if (kind_ == Code::KEYED_CALL_IC) { 1283 if (kind_ == Code::KEYED_CALL_IC) {
1284 __ cmp(Operand(ecx), Immediate(Handle<String>(name))); 1284 __ cmp(Operand(ecx), Immediate(Handle<String>(name)));
1285 __ j(not_equal, miss, not_taken); 1285 __ j(not_equal, miss, not_taken);
1286 } 1286 }
1287 } 1287 }
1288 1288
1289 1289
1290 void CallStubCompiler::GenerateMissBranch() { 1290 Object* CallStubCompiler::GenerateMissBranch() {
1291 Handle<Code> ic = ComputeCallMiss(arguments().immediate(), kind_); 1291 Object* obj = StubCache::ComputeCallMiss(arguments().immediate(), kind_);
1292 __ jmp(ic, RelocInfo::CODE_TARGET); 1292 if (obj->IsFailure()) return obj;
1293 __ jmp(Handle<Code>(Code::cast(obj)), RelocInfo::CODE_TARGET);
1294 return obj;
1293 } 1295 }
1294 1296
1295 1297
1296 Object* CallStubCompiler::CompileCallField(JSObject* object, 1298 Object* CallStubCompiler::CompileCallField(JSObject* object,
1297 JSObject* holder, 1299 JSObject* holder,
1298 int index, 1300 int index,
1299 String* name) { 1301 String* name) {
1300 // ----------- S t a t e ------------- 1302 // ----------- S t a t e -------------
1301 // -- ecx : name 1303 // -- ecx : name
1302 // -- esp[0] : return address 1304 // -- esp[0] : return address
(...skipping 30 matching lines...) Expand all
1333 if (object->IsGlobalObject()) { 1335 if (object->IsGlobalObject()) {
1334 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); 1336 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset));
1335 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); 1337 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx);
1336 } 1338 }
1337 1339
1338 // Invoke the function. 1340 // Invoke the function.
1339 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); 1341 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION);
1340 1342
1341 // Handle call cache miss. 1343 // Handle call cache miss.
1342 __ bind(&miss); 1344 __ bind(&miss);
1343 GenerateMissBranch(); 1345 Object* obj = GenerateMissBranch();
1346 if (obj->IsFailure()) return obj;
1344 1347
1345 // Return the generated code. 1348 // Return the generated code.
1346 return GetCode(FIELD, name); 1349 return GetCode(FIELD, name);
1347 } 1350 }
1348 1351
1349 1352
1350 Object* CallStubCompiler::CompileArrayPushCall(Object* object, 1353 Object* CallStubCompiler::CompileArrayPushCall(Object* object,
1351 JSObject* holder, 1354 JSObject* holder,
1352 JSFunction* function, 1355 JSFunction* function,
1353 String* name, 1356 String* name,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 1483
1481 __ bind(&call_builtin); 1484 __ bind(&call_builtin);
1482 } 1485 }
1483 1486
1484 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), 1487 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
1485 argc + 1, 1488 argc + 1,
1486 1); 1489 1);
1487 } 1490 }
1488 1491
1489 __ bind(&miss); 1492 __ bind(&miss);
1490 GenerateMissBranch(); 1493 Object* obj = GenerateMissBranch();
1494 if (obj->IsFailure()) return obj;
1491 1495
1492 // Return the generated code. 1496 // Return the generated code.
1493 return GetCode(function); 1497 return GetCode(function);
1494 } 1498 }
1495 1499
1496 1500
1497 Object* CallStubCompiler::CompileArrayPopCall(Object* object, 1501 Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1498 JSObject* holder, 1502 JSObject* holder,
1499 JSFunction* function, 1503 JSFunction* function,
1500 String* name, 1504 String* name,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 __ bind(&return_undefined); 1567 __ bind(&return_undefined);
1564 __ mov(eax, Immediate(Factory::undefined_value())); 1568 __ mov(eax, Immediate(Factory::undefined_value()));
1565 __ ret((argc + 1) * kPointerSize); 1569 __ ret((argc + 1) * kPointerSize);
1566 1570
1567 __ bind(&call_builtin); 1571 __ bind(&call_builtin);
1568 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), 1572 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
1569 argc + 1, 1573 argc + 1,
1570 1); 1574 1);
1571 1575
1572 __ bind(&miss); 1576 __ bind(&miss);
1573 GenerateMissBranch(); 1577 Object* obj = GenerateMissBranch();
1578 if (obj->IsFailure()) return obj;
1574 1579
1575 // Return the generated code. 1580 // Return the generated code.
1576 return GetCode(function); 1581 return GetCode(function);
1577 } 1582 }
1578 1583
1579 1584
1580 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object, 1585 Object* CallStubCompiler::CompileStringCharCodeAtCall(Object* object,
1581 JSObject* holder, 1586 JSObject* holder,
1582 JSFunction* function, 1587 JSFunction* function,
1583 String* name, 1588 String* name,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 __ ret((argc + 1) * kPointerSize); 1631 __ ret((argc + 1) * kPointerSize);
1627 1632
1628 ICRuntimeCallHelper call_helper; 1633 ICRuntimeCallHelper call_helper;
1629 char_code_at_generator.GenerateSlow(masm(), call_helper); 1634 char_code_at_generator.GenerateSlow(masm(), call_helper);
1630 1635
1631 __ bind(&index_out_of_range); 1636 __ bind(&index_out_of_range);
1632 __ Set(eax, Immediate(Factory::nan_value())); 1637 __ Set(eax, Immediate(Factory::nan_value()));
1633 __ ret((argc + 1) * kPointerSize); 1638 __ ret((argc + 1) * kPointerSize);
1634 1639
1635 __ bind(&miss); 1640 __ bind(&miss);
1636 1641 Object* obj = GenerateMissBranch();
1637 GenerateMissBranch(); 1642 if (obj->IsFailure()) return obj;
1638 1643
1639 // Return the generated code. 1644 // Return the generated code.
1640 return GetCode(function); 1645 return GetCode(function);
1641 } 1646 }
1642 1647
1643 1648
1644 Object* CallStubCompiler::CompileStringCharAtCall(Object* object, 1649 Object* CallStubCompiler::CompileStringCharAtCall(Object* object,
1645 JSObject* holder, 1650 JSObject* holder,
1646 JSFunction* function, 1651 JSFunction* function,
1647 String* name, 1652 String* name,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 __ ret((argc + 1) * kPointerSize); 1698 __ ret((argc + 1) * kPointerSize);
1694 1699
1695 ICRuntimeCallHelper call_helper; 1700 ICRuntimeCallHelper call_helper;
1696 char_at_generator.GenerateSlow(masm(), call_helper); 1701 char_at_generator.GenerateSlow(masm(), call_helper);
1697 1702
1698 __ bind(&index_out_of_range); 1703 __ bind(&index_out_of_range);
1699 __ Set(eax, Immediate(Factory::empty_string())); 1704 __ Set(eax, Immediate(Factory::empty_string()));
1700 __ ret((argc + 1) * kPointerSize); 1705 __ ret((argc + 1) * kPointerSize);
1701 1706
1702 __ bind(&miss); 1707 __ bind(&miss);
1703 // Restore function name in ecx. 1708 Object* obj = GenerateMissBranch();
1704 1709 if (obj->IsFailure()) return obj;
1705 GenerateMissBranch();
1706 1710
1707 // Return the generated code. 1711 // Return the generated code.
1708 return GetCode(function); 1712 return GetCode(function);
1709 } 1713 }
1710 1714
1711 1715
1712 Object* CallStubCompiler::CompileCallConstant(Object* object, 1716 Object* CallStubCompiler::CompileCallConstant(Object* object,
1713 JSObject* holder, 1717 JSObject* holder,
1714 JSFunction* function, 1718 JSFunction* function,
1715 String* name, 1719 String* name,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 } else { 1853 } else {
1850 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); 1854 __ InvokeFunction(function, arguments(), JUMP_FUNCTION);
1851 } 1855 }
1852 1856
1853 // Handle call cache miss. 1857 // Handle call cache miss.
1854 __ bind(&miss); 1858 __ bind(&miss);
1855 if (depth != kInvalidProtoDepth) { 1859 if (depth != kInvalidProtoDepth) {
1856 FreeSpaceForFastApiCall(masm(), eax); 1860 FreeSpaceForFastApiCall(masm(), eax);
1857 } 1861 }
1858 __ bind(&miss_in_smi_check); 1862 __ bind(&miss_in_smi_check);
1859 GenerateMissBranch(); 1863 Object* obj = GenerateMissBranch();
1864 if (obj->IsFailure()) return obj;
1860 1865
1861 // Return the generated code. 1866 // Return the generated code.
1862 return GetCode(function); 1867 return GetCode(function);
1863 } 1868 }
1864 1869
1865 1870
1866 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, 1871 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1867 JSObject* holder, 1872 JSObject* holder,
1868 String* name) { 1873 String* name) {
1869 // ----------- S t a t e ------------- 1874 // ----------- S t a t e -------------
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1913 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); 1918 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset));
1914 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx); 1919 __ mov(Operand(esp, (argc + 1) * kPointerSize), edx);
1915 } 1920 }
1916 1921
1917 // Invoke the function. 1922 // Invoke the function.
1918 __ mov(edi, eax); 1923 __ mov(edi, eax);
1919 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); 1924 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION);
1920 1925
1921 // Handle load cache miss. 1926 // Handle load cache miss.
1922 __ bind(&miss); 1927 __ bind(&miss);
1923 GenerateMissBranch(); 1928 Object* obj = GenerateMissBranch();
1929 if (obj->IsFailure()) return obj;
1924 1930
1925 // Return the generated code. 1931 // Return the generated code.
1926 return GetCode(INTERCEPTOR, name); 1932 return GetCode(INTERCEPTOR, name);
1927 } 1933 }
1928 1934
1929 1935
1930 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, 1936 Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
1931 GlobalObject* holder, 1937 GlobalObject* holder,
1932 JSGlobalPropertyCell* cell, 1938 JSGlobalPropertyCell* cell,
1933 JSFunction* function, 1939 JSFunction* function,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 __ IncrementCounter(&Counters::call_global_inline, 1); 2004 __ IncrementCounter(&Counters::call_global_inline, 1);
1999 ASSERT(function->is_compiled()); 2005 ASSERT(function->is_compiled());
2000 Handle<Code> code(function->code()); 2006 Handle<Code> code(function->code());
2001 ParameterCount expected(function->shared()->formal_parameter_count()); 2007 ParameterCount expected(function->shared()->formal_parameter_count());
2002 __ InvokeCode(code, expected, arguments(), 2008 __ InvokeCode(code, expected, arguments(),
2003 RelocInfo::CODE_TARGET, JUMP_FUNCTION); 2009 RelocInfo::CODE_TARGET, JUMP_FUNCTION);
2004 2010
2005 // Handle call cache miss. 2011 // Handle call cache miss.
2006 __ bind(&miss); 2012 __ bind(&miss);
2007 __ IncrementCounter(&Counters::call_global_inline_miss, 1); 2013 __ IncrementCounter(&Counters::call_global_inline_miss, 1);
2008 GenerateMissBranch(); 2014 Object* obj = GenerateMissBranch();
2015 if (obj->IsFailure()) return obj;
2009 2016
2010 // Return the generated code. 2017 // Return the generated code.
2011 return GetCode(NORMAL, name); 2018 return GetCode(NORMAL, name);
2012 } 2019 }
2013 2020
2014 2021
2015 Object* StoreStubCompiler::CompileStoreField(JSObject* object, 2022 Object* StoreStubCompiler::CompileStoreField(JSObject* object,
2016 int index, 2023 int index,
2017 Map* transition, 2024 Map* transition,
2018 String* name) { 2025 String* name) {
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 // Return the generated code. 2747 // Return the generated code.
2741 return GetCode(); 2748 return GetCode();
2742 } 2749 }
2743 2750
2744 2751
2745 #undef __ 2752 #undef __
2746 2753
2747 } } // namespace v8::internal 2754 } } // namespace v8::internal
2748 2755
2749 #endif // V8_TARGET_ARCH_IA32 2756 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698