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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 7039004: Add enumeration to specify if smi check needed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: move to common header Created 9 years, 7 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 | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.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 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { 271 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) {
272 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), 272 cmpb(FieldOperand(map, Map::kInstanceTypeOffset),
273 static_cast<int8_t>(type)); 273 static_cast<int8_t>(type));
274 } 274 }
275 275
276 276
277 void MacroAssembler::CheckMap(Register obj, 277 void MacroAssembler::CheckMap(Register obj,
278 Handle<Map> map, 278 Handle<Map> map,
279 Label* fail, 279 Label* fail,
280 bool is_heap_object) { 280 SmiCheckType smi_check_type) {
281 if (!is_heap_object) { 281 if (smi_check_type == DONT_DO_SMI_CHECK) {
282 test(obj, Immediate(kSmiTagMask)); 282 JumpIfSmi(obj, fail);
283 j(zero, fail);
284 } 283 }
285 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); 284 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map));
286 j(not_equal, fail); 285 j(not_equal, fail);
287 } 286 }
288 287
289 288
290 Condition MacroAssembler::IsObjectStringType(Register heap_object, 289 Condition MacroAssembler::IsObjectStringType(Register heap_object,
291 Register map, 290 Register map,
292 Register instance_type) { 291 Register instance_type) {
293 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); 292 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 mov(function, Operand(function, Context::SlotOffset(index))); 1734 mov(function, Operand(function, Context::SlotOffset(index)));
1736 } 1735 }
1737 1736
1738 1737
1739 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, 1738 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
1740 Register map) { 1739 Register map) {
1741 // Load the initial map. The global functions all have initial maps. 1740 // Load the initial map. The global functions all have initial maps.
1742 mov(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 1741 mov(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
1743 if (emit_debug_code()) { 1742 if (emit_debug_code()) {
1744 Label ok, fail; 1743 Label ok, fail;
1745 CheckMap(map, isolate()->factory()->meta_map(), &fail, false); 1744 CheckMap(map, isolate()->factory()->meta_map(), &fail, DO_SMI_CHECK);
1746 jmp(&ok); 1745 jmp(&ok);
1747 bind(&fail); 1746 bind(&fail);
1748 Abort("Global functions must have initial map"); 1747 Abort("Global functions must have initial map");
1749 bind(&ok); 1748 bind(&ok);
1750 } 1749 }
1751 } 1750 }
1752 1751
1753 1752
1754 // Store the value in register src in the safepoint register stack 1753 // Store the value in register src in the safepoint register stack
1755 // slot for register dst. 1754 // slot for register dst.
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 2068
2070 // Check that the code was patched as expected. 2069 // Check that the code was patched as expected.
2071 ASSERT(masm_.pc_ == address_ + size_); 2070 ASSERT(masm_.pc_ == address_ + size_);
2072 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2071 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2073 } 2072 }
2074 2073
2075 2074
2076 } } // namespace v8::internal 2075 } } // namespace v8::internal
2077 2076
2078 #endif // V8_TARGET_ARCH_IA32 2077 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698