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

Side by Side Diff: src/arm/macro-assembler-arm.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/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.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 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 ASSERT(!obj.is(ip)); 1648 ASSERT(!obj.is(ip));
1649 LoadRoot(ip, index); 1649 LoadRoot(ip, index);
1650 cmp(obj, ip); 1650 cmp(obj, ip);
1651 } 1651 }
1652 1652
1653 1653
1654 void MacroAssembler::CheckMap(Register obj, 1654 void MacroAssembler::CheckMap(Register obj,
1655 Register scratch, 1655 Register scratch,
1656 Handle<Map> map, 1656 Handle<Map> map,
1657 Label* fail, 1657 Label* fail,
1658 bool is_heap_object) { 1658 SmiCheckType smi_check_type) {
1659 if (!is_heap_object) { 1659 if (smi_check_type == DO_SMI_CHECK) {
1660 JumpIfSmi(obj, fail); 1660 JumpIfSmi(obj, fail);
1661 } 1661 }
1662 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 1662 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
1663 mov(ip, Operand(map)); 1663 mov(ip, Operand(map));
1664 cmp(scratch, ip); 1664 cmp(scratch, ip);
1665 b(ne, fail); 1665 b(ne, fail);
1666 } 1666 }
1667 1667
1668 1668
1669 void MacroAssembler::CheckMap(Register obj, 1669 void MacroAssembler::CheckMap(Register obj,
1670 Register scratch, 1670 Register scratch,
1671 Heap::RootListIndex index, 1671 Heap::RootListIndex index,
1672 Label* fail, 1672 Label* fail,
1673 bool is_heap_object) { 1673 SmiCheckType smi_check_type) {
1674 if (!is_heap_object) { 1674 if (smi_check_type == DO_SMI_CHECK) {
1675 JumpIfSmi(obj, fail); 1675 JumpIfSmi(obj, fail);
1676 } 1676 }
1677 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 1677 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
1678 LoadRoot(ip, index); 1678 LoadRoot(ip, index);
1679 cmp(scratch, ip); 1679 cmp(scratch, ip);
1680 b(ne, fail); 1680 b(ne, fail);
1681 } 1681 }
1682 1682
1683 1683
1684 void MacroAssembler::TryGetFunctionPrototype(Register function, 1684 void MacroAssembler::TryGetFunctionPrototype(Register function,
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
2514 } 2514 }
2515 2515
2516 2516
2517 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, 2517 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
2518 Register map, 2518 Register map,
2519 Register scratch) { 2519 Register scratch) {
2520 // Load the initial map. The global functions all have initial maps. 2520 // Load the initial map. The global functions all have initial maps.
2521 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 2521 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
2522 if (emit_debug_code()) { 2522 if (emit_debug_code()) {
2523 Label ok, fail; 2523 Label ok, fail;
2524 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, false); 2524 CheckMap(map, scratch, Heap::kMetaMapRootIndex, &fail, DO_SMI_CHECK);
2525 b(&ok); 2525 b(&ok);
2526 bind(&fail); 2526 bind(&fail);
2527 Abort("Global functions must have initial map"); 2527 Abort("Global functions must have initial map");
2528 bind(&ok); 2528 bind(&ok);
2529 } 2529 }
2530 } 2530 }
2531 2531
2532 2532
2533 void MacroAssembler::JumpIfNotPowerOfTwoOrZero( 2533 void MacroAssembler::JumpIfNotPowerOfTwoOrZero(
2534 Register reg, 2534 Register reg,
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 void CodePatcher::EmitCondition(Condition cond) { 3101 void CodePatcher::EmitCondition(Condition cond) {
3102 Instr instr = Assembler::instr_at(masm_.pc_); 3102 Instr instr = Assembler::instr_at(masm_.pc_);
3103 instr = (instr & ~kCondMask) | cond; 3103 instr = (instr & ~kCondMask) | cond;
3104 masm_.emit(instr); 3104 masm_.emit(instr);
3105 } 3105 }
3106 3106
3107 3107
3108 } } // namespace v8::internal 3108 } } // namespace v8::internal
3109 3109
3110 #endif // V8_TARGET_ARCH_ARM 3110 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698