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

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

Issue 6517010: Fix a potential crash bug in keyed calls for non-string keys. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 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/ia32/ic-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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 Label* fail) { 922 Label* fail) {
923 ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); 923 ldrb(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset));
924 cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE)); 924 cmp(scratch, Operand(FIRST_JS_OBJECT_TYPE));
925 b(lt, fail); 925 b(lt, fail);
926 cmp(scratch, Operand(LAST_JS_OBJECT_TYPE)); 926 cmp(scratch, Operand(LAST_JS_OBJECT_TYPE));
927 b(gt, fail); 927 b(gt, fail);
928 } 928 }
929 929
930 930
931 void MacroAssembler::IsObjectJSStringType(Register object, 931 void MacroAssembler::IsObjectJSStringType(Register object,
932 Register scratch, 932 Register scratch,
933 Label* fail) { 933 Label* fail) {
934 ASSERT(kNotStringTag != 0); 934 ASSERT(kNotStringTag != 0);
935 935
936 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); 936 ldr(scratch, FieldMemOperand(object, HeapObject::kMapOffset));
937 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); 937 ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
938 tst(scratch, Operand(kIsNotStringMask)); 938 tst(scratch, Operand(kIsNotStringMask));
939 b(ne, fail); 939 b(ne, fail);
940 } 940 }
941 941
942 942
943 #ifdef ENABLE_DEBUGGER_SUPPORT 943 #ifdef ENABLE_DEBUGGER_SUPPORT
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 } 2115 }
2116 2116
2117 2117
2118 void MacroAssembler::AbortIfNotSmi(Register object) { 2118 void MacroAssembler::AbortIfNotSmi(Register object) {
2119 STATIC_ASSERT(kSmiTag == 0); 2119 STATIC_ASSERT(kSmiTag == 0);
2120 tst(object, Operand(kSmiTagMask)); 2120 tst(object, Operand(kSmiTagMask));
2121 Assert(eq, "Operand is not smi"); 2121 Assert(eq, "Operand is not smi");
2122 } 2122 }
2123 2123
2124 2124
2125 void MacroAssembler::AbortIfNotString(Register object) {
2126 STATIC_ASSERT(kSmiTag == 0);
2127 tst(object, Operand(kSmiTagMask));
2128 Assert(ne, "Operand is not a string");
2129 push(object);
2130 ldr(object, FieldMemOperand(object, HeapObject::kMapOffset));
2131 CompareInstanceType(object, object, FIRST_NONSTRING_TYPE);
2132 pop(object);
2133 Assert(lo, "Operand is not a string");
2134 }
2135
2136
2137
2125 void MacroAssembler::AbortIfNotRootValue(Register src, 2138 void MacroAssembler::AbortIfNotRootValue(Register src,
2126 Heap::RootListIndex root_value_index, 2139 Heap::RootListIndex root_value_index,
2127 const char* message) { 2140 const char* message) {
2128 ASSERT(!src.is(ip)); 2141 ASSERT(!src.is(ip));
2129 LoadRoot(ip, root_value_index); 2142 LoadRoot(ip, root_value_index);
2130 cmp(src, ip); 2143 cmp(src, ip);
2131 Assert(eq, message); 2144 Assert(eq, message);
2132 } 2145 }
2133 2146
2134 2147
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 void CodePatcher::EmitCondition(Condition cond) { 2436 void CodePatcher::EmitCondition(Condition cond) {
2424 Instr instr = Assembler::instr_at(masm_.pc_); 2437 Instr instr = Assembler::instr_at(masm_.pc_);
2425 instr = (instr & ~kCondMask) | cond; 2438 instr = (instr & ~kCondMask) | cond;
2426 masm_.emit(instr); 2439 masm_.emit(instr);
2427 } 2440 }
2428 2441
2429 2442
2430 } } // namespace v8::internal 2443 } } // namespace v8::internal
2431 2444
2432 #endif // V8_TARGET_ARCH_ARM 2445 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698