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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 189263011: ARM: cleanning of InstanceOfKnownGlobal (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); 1891 __ ldm(ia_w, sp, kCalleeSaved | pc.bit());
1892 } 1892 }
1893 1893
1894 1894
1895 // Uses registers r0 to r4. 1895 // Uses registers r0 to r4.
1896 // Expected input (depending on whether args are in registers or on the stack): 1896 // Expected input (depending on whether args are in registers or on the stack):
1897 // * object: r0 or at sp + 1 * kPointerSize. 1897 // * object: r0 or at sp + 1 * kPointerSize.
1898 // * function: r1 or at sp. 1898 // * function: r1 or at sp.
1899 // 1899 //
1900 // An inlined call site may have been generated before calling this stub. 1900 // An inlined call site may have been generated before calling this stub.
1901 // In this case the offset to the inline site to patch is passed on the stack, 1901 // In this case the offset to the inline site to patch is passed in r5.
1902 // in the safepoint slot for register r4.
1903 // (See LCodeGen::DoInstanceOfKnownGlobal) 1902 // (See LCodeGen::DoInstanceOfKnownGlobal)
1904 void InstanceofStub::Generate(MacroAssembler* masm) { 1903 void InstanceofStub::Generate(MacroAssembler* masm) {
1905 // Call site inlining and patching implies arguments in registers. 1904 // Call site inlining and patching implies arguments in registers.
1906 ASSERT(HasArgsInRegisters() || !HasCallSiteInlineCheck()); 1905 ASSERT(HasArgsInRegisters() || !HasCallSiteInlineCheck());
1907 // ReturnTrueFalse is only implemented for inlined call sites. 1906 // ReturnTrueFalse is only implemented for inlined call sites.
1908 ASSERT(!ReturnTrueFalseObject() || HasCallSiteInlineCheck()); 1907 ASSERT(!ReturnTrueFalseObject() || HasCallSiteInlineCheck());
1909 1908
1910 // Fixed register usage throughout the stub: 1909 // Fixed register usage throughout the stub:
1911 const Register object = r0; // Object (lhs). 1910 const Register object = r0; // Object (lhs).
1912 Register map = r3; // Map of the object. 1911 Register map = r3; // Map of the object.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 1950
1952 // Update the global instanceof or call site inlined cache with the current 1951 // Update the global instanceof or call site inlined cache with the current
1953 // map and function. The cached answer will be set when it is known below. 1952 // map and function. The cached answer will be set when it is known below.
1954 if (!HasCallSiteInlineCheck()) { 1953 if (!HasCallSiteInlineCheck()) {
1955 __ StoreRoot(function, Heap::kInstanceofCacheFunctionRootIndex); 1954 __ StoreRoot(function, Heap::kInstanceofCacheFunctionRootIndex);
1956 __ StoreRoot(map, Heap::kInstanceofCacheMapRootIndex); 1955 __ StoreRoot(map, Heap::kInstanceofCacheMapRootIndex);
1957 } else { 1956 } else {
1958 ASSERT(HasArgsInRegisters()); 1957 ASSERT(HasArgsInRegisters());
1959 // Patch the (relocated) inlined map check. 1958 // Patch the (relocated) inlined map check.
1960 1959
1961 // The offset was stored in r4 safepoint slot. 1960 // The offset was stored in r5
1962 // (See LCodeGen::DoDeferredLInstanceOfKnownGlobal) 1961 // (See LCodeGen::DoDeferredLInstanceOfKnownGlobal).
1963 __ LoadFromSafepointRegisterSlot(scratch, r4); 1962 const Register offset = r5;
1964 __ sub(inline_site, lr, scratch); 1963 __ sub(inline_site, lr, offset);
1965 // Get the map location in scratch and patch it. 1964 // Get the map location in r5 and patch it.
1966 __ GetRelocatedValueLocation(inline_site, scratch); 1965 __ GetRelocatedValueLocation(inline_site, offset);
1967 __ ldr(scratch, MemOperand(scratch)); 1966 __ ldr(offset, MemOperand(offset));
1968 __ str(map, FieldMemOperand(scratch, Cell::kValueOffset)); 1967 __ str(map, FieldMemOperand(offset, Cell::kValueOffset));
1969 } 1968 }
1970 1969
1971 // Register mapping: r3 is object map and r4 is function prototype. 1970 // Register mapping: r3 is object map and r4 is function prototype.
1972 // Get prototype of object into r2. 1971 // Get prototype of object into r2.
1973 __ ldr(scratch, FieldMemOperand(map, Map::kPrototypeOffset)); 1972 __ ldr(scratch, FieldMemOperand(map, Map::kPrototypeOffset));
1974 1973
1975 // We don't need map any more. Use it as a scratch register. 1974 // We don't need map any more. Use it as a scratch register.
1976 Register scratch2 = map; 1975 Register scratch2 = map;
1977 map = no_reg; 1976 map = no_reg;
1978 1977
(...skipping 3600 matching lines...) Expand 10 before | Expand all | Expand 10 after
5579 MemOperand(fp, 6 * kPointerSize), 5578 MemOperand(fp, 6 * kPointerSize),
5580 NULL); 5579 NULL);
5581 } 5580 }
5582 5581
5583 5582
5584 #undef __ 5583 #undef __
5585 5584
5586 } } // namespace v8::internal 5585 } } // namespace v8::internal
5587 5586
5588 #endif // V8_TARGET_ARCH_ARM 5587 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698