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

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

Issue 9158015: Change inlined cache of intanceof stub to use indirection through cell. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4138 matching lines...) Expand 10 before | Expand all | Expand 10 after
4149 // rax is object map. 4149 // rax is object map.
4150 // rdx is function. 4150 // rdx is function.
4151 // rbx is function prototype. 4151 // rbx is function prototype.
4152 if (!HasCallSiteInlineCheck()) { 4152 if (!HasCallSiteInlineCheck()) {
4153 __ StoreRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex); 4153 __ StoreRoot(rdx, Heap::kInstanceofCacheFunctionRootIndex);
4154 __ StoreRoot(rax, Heap::kInstanceofCacheMapRootIndex); 4154 __ StoreRoot(rax, Heap::kInstanceofCacheMapRootIndex);
4155 } else { 4155 } else {
4156 // Get return address and delta to inlined map check. 4156 // Get return address and delta to inlined map check.
4157 __ movq(kScratchRegister, Operand(rsp, 0 * kPointerSize)); 4157 __ movq(kScratchRegister, Operand(rsp, 0 * kPointerSize));
4158 __ subq(kScratchRegister, Operand(rsp, 1 * kPointerSize)); 4158 __ subq(kScratchRegister, Operand(rsp, 1 * kPointerSize));
4159 __ movq(Operand(kScratchRegister, kOffsetToMapCheckValue), rax);
4160 if (FLAG_debug_code) { 4159 if (FLAG_debug_code) {
4161 __ movl(rdi, Immediate(kWordBeforeMapCheckValue)); 4160 __ movl(rdi, Immediate(kWordBeforeMapCheckValue));
4162 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), rdi); 4161 __ cmpl(Operand(kScratchRegister, kOffsetToMapCheckValue - 4), rdi);
4163 __ Assert(equal, "InstanceofStub unexpected call site cache (check)."); 4162 __ Assert(equal, "InstanceofStub unexpected call site cache (check).");
4164 } 4163 }
4164 __ movq(kScratchRegister,
4165 Operand(kScratchRegister, kOffsetToMapCheckValue));
4166 __ movq(Operand(kScratchRegister, 0), rax);
4165 } 4167 }
4166 4168
4167 __ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset)); 4169 __ movq(rcx, FieldOperand(rax, Map::kPrototypeOffset));
4168 4170
4169 // Loop through the prototype chain looking for the function prototype. 4171 // Loop through the prototype chain looking for the function prototype.
4170 Label loop, is_instance, is_not_instance; 4172 Label loop, is_instance, is_not_instance;
4171 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex); 4173 __ LoadRoot(kScratchRegister, Heap::kNullValueRootIndex);
4172 __ bind(&loop); 4174 __ bind(&loop);
4173 __ cmpq(rcx, rbx); 4175 __ cmpq(rcx, rbx);
4174 __ j(equal, &is_instance, Label::kNear); 4176 __ j(equal, &is_instance, Label::kNear);
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
6234 xmm0, 6236 xmm0,
6235 &slow_elements); 6237 &slow_elements);
6236 __ ret(0); 6238 __ ret(0);
6237 } 6239 }
6238 6240
6239 #undef __ 6241 #undef __
6240 6242
6241 } } // namespace v8::internal 6243 } } // namespace v8::internal
6242 6244
6243 #endif // V8_TARGET_ARCH_X64 6245 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698