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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 // A Smi is not an instance of anything. 1972 // A Smi is not an instance of anything.
1973 __ JumpIfSmi(object, &false_result); 1973 __ JumpIfSmi(object, &false_result);
1974 1974
1975 // This is the inlined call site instanceof cache. The two occurences of the 1975 // This is the inlined call site instanceof cache. The two occurences of the
1976 // hole value will be patched to the last map/result pair generated by the 1976 // hole value will be patched to the last map/result pair generated by the
1977 // instanceof stub. 1977 // instanceof stub.
1978 Label cache_miss; 1978 Label cache_miss;
1979 Register map = ToRegister(instr->TempAt(0)); 1979 Register map = ToRegister(instr->TempAt(0));
1980 __ mov(map, FieldOperand(object, HeapObject::kMapOffset)); 1980 __ mov(map, FieldOperand(object, HeapObject::kMapOffset));
1981 __ bind(deferred->map_check()); // Label for calculating code patching. 1981 __ bind(deferred->map_check()); // Label for calculating code patching.
1982 __ cmp(map, factory()->the_hole_value()); // Patched to cached map. 1982 Handle<JSGlobalPropertyCell> cache_cell =
1983 factory()->NewJSGlobalPropertyCell(factory()->the_hole_value());
1984 __ cmp(map, Operand::Cell(cache_cell)); // Patched to cached map.
1983 __ j(not_equal, &cache_miss, Label::kNear); 1985 __ j(not_equal, &cache_miss, Label::kNear);
1984 __ mov(eax, factory()->the_hole_value()); // Patched to either true or false. 1986 __ mov(eax, factory()->the_hole_value()); // Patched to either true or false.
1985 __ jmp(&done); 1987 __ jmp(&done);
1986 1988
1987 // The inlined call site cache did not match. Check for null and string 1989 // The inlined call site cache did not match. Check for null and string
1988 // before calling the deferred code. 1990 // before calling the deferred code.
1989 __ bind(&cache_miss); 1991 __ bind(&cache_miss);
1990 // Null is not an instance of anything. 1992 // Null is not an instance of anything.
1991 __ cmp(object, factory()->null_value()); 1993 __ cmp(object, factory()->null_value());
1992 __ j(equal, &false_result); 1994 __ j(equal, &false_result);
(...skipping 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after
4612 this, pointers, Safepoint::kLazyDeopt); 4614 this, pointers, Safepoint::kLazyDeopt);
4613 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4615 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4614 } 4616 }
4615 4617
4616 4618
4617 #undef __ 4619 #undef __
4618 4620
4619 } } // namespace v8::internal 4621 } } // namespace v8::internal
4620 4622
4621 #endif // V8_TARGET_ARCH_IA32 4623 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698