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

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

Issue 2586001: Add test_b(Operand, immediate) to ia32 assembler, and use it where possible. ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 Register map, 289 Register map,
290 Register instance_type) { 290 Register instance_type) {
291 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); 291 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
292 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); 292 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset));
293 ASSERT(kNotStringTag != 0); 293 ASSERT(kNotStringTag != 0);
294 test(instance_type, Immediate(kIsNotStringMask)); 294 test(instance_type, Immediate(kIsNotStringMask));
295 return zero; 295 return zero;
296 } 296 }
297 297
298 298
299 void MacroAssembler::IsObjectJSObjectType(Register heap_object,
300 Register map,
301 Register scratch,
302 Label* fail) {
303 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset));
304 IsInstanceJSObjectType(map, scratch, fail);
305 }
306
307
308 void MacroAssembler::IsInstanceJSObjectType(Register map,
309 Register scratch,
310 Label* fail) {
311 movzx_b(scratch, FieldOperand(map, Map::kInstanceTypeOffset));
312 sub(Operand(scratch), Immediate(FIRST_JS_OBJECT_TYPE));
313 cmp(scratch, LAST_JS_OBJECT_TYPE - FIRST_JS_OBJECT_TYPE);
314 j(above, fail);
315 }
316
317
299 void MacroAssembler::FCmp() { 318 void MacroAssembler::FCmp() {
300 if (CpuFeatures::IsSupported(CMOV)) { 319 if (CpuFeatures::IsSupported(CMOV)) {
301 fucomip(); 320 fucomip();
302 ffree(0); 321 ffree(0);
303 fincstp(); 322 fincstp();
304 } else { 323 } else {
305 fucompp(); 324 fucompp();
306 push(eax); 325 push(eax);
307 fnstsw_ax(); 326 fnstsw_ax();
308 sahf(); 327 sahf();
(...skipping 1334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 1662
1644 // Check that the code was patched as expected. 1663 // Check that the code was patched as expected.
1645 ASSERT(masm_.pc_ == address_ + size_); 1664 ASSERT(masm_.pc_ == address_ + size_);
1646 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 1665 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
1647 } 1666 }
1648 1667
1649 1668
1650 } } // namespace v8::internal 1669 } } // namespace v8::internal
1651 1670
1652 #endif // V8_TARGET_ARCH_IA32 1671 #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