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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 10915062: Add checks to runtime functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/lithium-arm.cc ('k') | src/date.js » ('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 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 Register object = ToRegister(instr->InputAt(0)); 1590 Register object = ToRegister(instr->InputAt(0));
1591 Register result = ToRegister(instr->result()); 1591 Register result = ToRegister(instr->result());
1592 Register scratch = ToRegister(instr->TempAt(0)); 1592 Register scratch = ToRegister(instr->TempAt(0));
1593 Smi* index = instr->index(); 1593 Smi* index = instr->index();
1594 Label runtime, done; 1594 Label runtime, done;
1595 ASSERT(object.is(result)); 1595 ASSERT(object.is(result));
1596 ASSERT(object.is(r0)); 1596 ASSERT(object.is(r0));
1597 ASSERT(!scratch.is(scratch0())); 1597 ASSERT(!scratch.is(scratch0()));
1598 ASSERT(!scratch.is(object)); 1598 ASSERT(!scratch.is(object));
1599 1599
1600 #ifdef DEBUG 1600 __ tst(object, Operand(kSmiTagMask));
1601 __ AbortIfSmi(object); 1601 DeoptimizeIf(eq, instr->environment());
1602 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE); 1602 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE);
1603 __ Assert(eq, "Trying to get date field from non-date."); 1603 DeoptimizeIf(ne, instr->environment());
1604 #endif
1605 1604
1606 if (index->value() == 0) { 1605 if (index->value() == 0) {
1607 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); 1606 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
1608 } else { 1607 } else {
1609 if (index->value() < JSDate::kFirstUncachedField) { 1608 if (index->value() < JSDate::kFirstUncachedField) {
1610 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); 1609 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
1611 __ mov(scratch, Operand(stamp)); 1610 __ mov(scratch, Operand(stamp));
1612 __ ldr(scratch, MemOperand(scratch)); 1611 __ ldr(scratch, MemOperand(scratch));
1613 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); 1612 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset));
1614 __ cmp(scratch, scratch0()); 1613 __ cmp(scratch, scratch0());
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 2229
2231 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2230 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2232 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); 2231 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
2233 } 2232 }
2234 2233
2235 2234
2236 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 2235 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2237 Register input = ToRegister(instr->InputAt(0)); 2236 Register input = ToRegister(instr->InputAt(0));
2238 Register result = ToRegister(instr->result()); 2237 Register result = ToRegister(instr->result());
2239 2238
2240 if (FLAG_debug_code) { 2239 __ AbortIfNotString(input);
2241 __ AbortIfNotString(input);
2242 }
2243 2240
2244 __ ldr(result, FieldMemOperand(input, String::kHashFieldOffset)); 2241 __ ldr(result, FieldMemOperand(input, String::kHashFieldOffset));
2245 __ IndexFromHash(result, result); 2242 __ IndexFromHash(result, result);
2246 } 2243 }
2247 2244
2248 2245
2249 void LCodeGen::DoHasCachedArrayIndexAndBranch( 2246 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2250 LHasCachedArrayIndexAndBranch* instr) { 2247 LHasCachedArrayIndexAndBranch* instr) {
2251 Register input = ToRegister(instr->InputAt(0)); 2248 Register input = ToRegister(instr->InputAt(0));
2252 Register scratch = scratch0(); 2249 Register scratch = scratch0();
(...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after
5621 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5618 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5622 __ ldr(result, FieldMemOperand(scratch, 5619 __ ldr(result, FieldMemOperand(scratch,
5623 FixedArray::kHeaderSize - kPointerSize)); 5620 FixedArray::kHeaderSize - kPointerSize));
5624 __ bind(&done); 5621 __ bind(&done);
5625 } 5622 }
5626 5623
5627 5624
5628 #undef __ 5625 #undef __
5629 5626
5630 } } // namespace v8::internal 5627 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698