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

Side by Side Diff: src/x64/lithium-codegen-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 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 __ JumpIfSmi(object, &false_result); 1890 __ JumpIfSmi(object, &false_result);
1891 1891
1892 // This is the inlined call site instanceof cache. The two occurences of the 1892 // This is the inlined call site instanceof cache. The two occurences of the
1893 // hole value will be patched to the last map/result pair generated by the 1893 // hole value will be patched to the last map/result pair generated by the
1894 // instanceof stub. 1894 // instanceof stub.
1895 Label cache_miss; 1895 Label cache_miss;
1896 // Use a temp register to avoid memory operands with variable lengths. 1896 // Use a temp register to avoid memory operands with variable lengths.
1897 Register map = ToRegister(instr->TempAt(0)); 1897 Register map = ToRegister(instr->TempAt(0));
1898 __ movq(map, FieldOperand(object, HeapObject::kMapOffset)); 1898 __ movq(map, FieldOperand(object, HeapObject::kMapOffset));
1899 __ bind(deferred->map_check()); // Label for calculating code patching. 1899 __ bind(deferred->map_check()); // Label for calculating code patching.
1900 __ movq(kScratchRegister, factory()->the_hole_value(), 1900 Handle<JSGlobalPropertyCell> cache_cell =
1901 RelocInfo::EMBEDDED_OBJECT); 1901 factory()->NewJSGlobalPropertyCell(factory()->the_hole_value());
1902 __ cmpq(map, kScratchRegister); // Patched to cached map. 1902 __ movq(kScratchRegister, cache_cell, RelocInfo::GLOBAL_PROPERTY_CELL);
1903 __ cmpq(map, Operand(kScratchRegister, 0));
1903 __ j(not_equal, &cache_miss, Label::kNear); 1904 __ j(not_equal, &cache_miss, Label::kNear);
1904 // Patched to load either true or false. 1905 // Patched to load either true or false.
1905 __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); 1906 __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex);
1906 #ifdef DEBUG 1907 #ifdef DEBUG
1907 // Check that the code size between patch label and patch sites is invariant. 1908 // Check that the code size between patch label and patch sites is invariant.
1908 Label end_of_patched_code; 1909 Label end_of_patched_code;
1909 __ bind(&end_of_patched_code); 1910 __ bind(&end_of_patched_code);
1910 ASSERT(true); 1911 ASSERT(true);
1911 #endif 1912 #endif
1912 __ jmp(&done); 1913 __ jmp(&done);
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after
4329 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4330 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4330 ASSERT(osr_pc_offset_ == -1); 4331 ASSERT(osr_pc_offset_ == -1);
4331 osr_pc_offset_ = masm()->pc_offset(); 4332 osr_pc_offset_ = masm()->pc_offset();
4332 } 4333 }
4333 4334
4334 #undef __ 4335 #undef __
4335 4336
4336 } } // namespace v8::internal 4337 } } // namespace v8::internal
4337 4338
4338 #endif // V8_TARGET_ARCH_X64 4339 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698