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

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

Issue 13923003: Always require exact maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 str(mantissa_reg, MemOperand(scratch1, 0)); 2058 str(mantissa_reg, MemOperand(scratch1, 0));
2059 str(exponent_reg, MemOperand(scratch1, Register::kSizeInBytes)); 2059 str(exponent_reg, MemOperand(scratch1, Register::kSizeInBytes));
2060 } 2060 }
2061 bind(&done); 2061 bind(&done);
2062 } 2062 }
2063 2063
2064 2064
2065 void MacroAssembler::CompareMap(Register obj, 2065 void MacroAssembler::CompareMap(Register obj,
2066 Register scratch, 2066 Register scratch,
2067 Handle<Map> map, 2067 Handle<Map> map,
2068 Label* early_success, 2068 Label* early_success) {
2069 CompareMapMode mode) {
2070 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 2069 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
2071 CompareMap(scratch, map, early_success, mode); 2070 CompareMap(scratch, map, early_success);
2072 } 2071 }
2073 2072
2074 2073
2075 void MacroAssembler::CompareMap(Register obj_map, 2074 void MacroAssembler::CompareMap(Register obj_map,
2076 Handle<Map> map, 2075 Handle<Map> map,
2077 Label* early_success, 2076 Label* early_success) {
2078 CompareMapMode mode) {
2079 cmp(obj_map, Operand(map)); 2077 cmp(obj_map, Operand(map));
2080 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) {
2081 ElementsKind kind = map->elements_kind();
2082 if (IsFastElementsKind(kind)) {
2083 bool packed = IsFastPackedElementsKind(kind);
2084 Map* current_map = *map;
2085 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) {
2086 kind = GetNextMoreGeneralFastElementsKind(kind, packed);
2087 current_map = current_map->LookupElementsTransitionMap(kind);
2088 if (!current_map) break;
2089 b(eq, early_success);
2090 cmp(obj_map, Operand(Handle<Map>(current_map)));
2091 }
2092 }
2093 }
2094 } 2078 }
2095 2079
2096 2080
2097 void MacroAssembler::CheckMap(Register obj, 2081 void MacroAssembler::CheckMap(Register obj,
2098 Register scratch, 2082 Register scratch,
2099 Handle<Map> map, 2083 Handle<Map> map,
2100 Label* fail, 2084 Label* fail,
2101 SmiCheckType smi_check_type, 2085 SmiCheckType smi_check_type) {
2102 CompareMapMode mode) {
2103 if (smi_check_type == DO_SMI_CHECK) { 2086 if (smi_check_type == DO_SMI_CHECK) {
2104 JumpIfSmi(obj, fail); 2087 JumpIfSmi(obj, fail);
2105 } 2088 }
2106 2089
2107 Label success; 2090 Label success;
2108 CompareMap(obj, scratch, map, &success, mode); 2091 CompareMap(obj, scratch, map, &success);
2109 b(ne, fail); 2092 b(ne, fail);
2110 bind(&success); 2093 bind(&success);
2111 } 2094 }
2112 2095
2113 2096
2114 void MacroAssembler::CheckMap(Register obj, 2097 void MacroAssembler::CheckMap(Register obj,
2115 Register scratch, 2098 Register scratch,
2116 Heap::RootListIndex index, 2099 Heap::RootListIndex index,
2117 Label* fail, 2100 Label* fail,
2118 SmiCheckType smi_check_type) { 2101 SmiCheckType smi_check_type) {
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
3862 void CodePatcher::EmitCondition(Condition cond) { 3845 void CodePatcher::EmitCondition(Condition cond) {
3863 Instr instr = Assembler::instr_at(masm_.pc_); 3846 Instr instr = Assembler::instr_at(masm_.pc_);
3864 instr = (instr & ~kCondMask) | cond; 3847 instr = (instr & ~kCondMask) | cond;
3865 masm_.emit(instr); 3848 masm_.emit(instr);
3866 } 3849 }
3867 3850
3868 3851
3869 } } // namespace v8::internal 3852 } } // namespace v8::internal
3870 3853
3871 #endif // V8_TARGET_ARCH_ARM 3854 #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