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

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

Issue 6614015: Add new ARM macro assembler function CompareRoot left out of previous commit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 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/arm/macro-assembler-arm.h ('k') | no next file » | 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 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 1530
1531 1531
1532 void MacroAssembler::CompareInstanceType(Register map, 1532 void MacroAssembler::CompareInstanceType(Register map,
1533 Register type_reg, 1533 Register type_reg,
1534 InstanceType type) { 1534 InstanceType type) {
1535 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); 1535 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
1536 cmp(type_reg, Operand(type)); 1536 cmp(type_reg, Operand(type));
1537 } 1537 }
1538 1538
1539 1539
1540 void MacroAssembler::CompareRoot(Register obj,
1541 Heap::RootListIndex index) {
1542 ASSERT(!obj.is(ip));
1543 LoadRoot(ip, index);
1544 cmp(obj, ip);
1545 }
1546
1547
1540 void MacroAssembler::CheckMap(Register obj, 1548 void MacroAssembler::CheckMap(Register obj,
1541 Register scratch, 1549 Register scratch,
1542 Handle<Map> map, 1550 Handle<Map> map,
1543 Label* fail, 1551 Label* fail,
1544 bool is_heap_object) { 1552 bool is_heap_object) {
1545 if (!is_heap_object) { 1553 if (!is_heap_object) {
1546 JumpIfSmi(obj, fail); 1554 JumpIfSmi(obj, fail);
1547 } 1555 }
1548 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 1556 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
1549 mov(ip, Operand(map)); 1557 mov(ip, Operand(map));
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2335 CompareInstanceType(object, object, FIRST_NONSTRING_TYPE); 2343 CompareInstanceType(object, object, FIRST_NONSTRING_TYPE);
2336 pop(object); 2344 pop(object);
2337 Assert(lo, "Operand is not a string"); 2345 Assert(lo, "Operand is not a string");
2338 } 2346 }
2339 2347
2340 2348
2341 2349
2342 void MacroAssembler::AbortIfNotRootValue(Register src, 2350 void MacroAssembler::AbortIfNotRootValue(Register src,
2343 Heap::RootListIndex root_value_index, 2351 Heap::RootListIndex root_value_index,
2344 const char* message) { 2352 const char* message) {
2345 ASSERT(!src.is(ip)); 2353 CompareRoot(src, root_value_index);
2346 LoadRoot(ip, root_value_index);
2347 cmp(src, ip);
2348 Assert(eq, message); 2354 Assert(eq, message);
2349 } 2355 }
2350 2356
2351 2357
2352 void MacroAssembler::JumpIfNotHeapNumber(Register object, 2358 void MacroAssembler::JumpIfNotHeapNumber(Register object,
2353 Register heap_number_map, 2359 Register heap_number_map,
2354 Register scratch, 2360 Register scratch,
2355 Label* on_not_heap_number) { 2361 Label* on_not_heap_number) {
2356 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 2362 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
2357 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); 2363 AssertRegisterIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex);
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 void CodePatcher::EmitCondition(Condition cond) { 2700 void CodePatcher::EmitCondition(Condition cond) {
2695 Instr instr = Assembler::instr_at(masm_.pc_); 2701 Instr instr = Assembler::instr_at(masm_.pc_);
2696 instr = (instr & ~kCondMask) | cond; 2702 instr = (instr & ~kCondMask) | cond;
2697 masm_.emit(instr); 2703 masm_.emit(instr);
2698 } 2704 }
2699 2705
2700 2706
2701 } } // namespace v8::internal 2707 } } // namespace v8::internal
2702 2708
2703 #endif // V8_TARGET_ARCH_ARM 2709 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698