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

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
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 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 Register object = ToRegister(instr->InputAt(0)); 1585 Register object = ToRegister(instr->InputAt(0));
1586 Register result = ToRegister(instr->result()); 1586 Register result = ToRegister(instr->result());
1587 Register scratch = ToRegister(instr->TempAt(0)); 1587 Register scratch = ToRegister(instr->TempAt(0));
1588 Smi* index = instr->index(); 1588 Smi* index = instr->index();
1589 Label runtime, done; 1589 Label runtime, done;
1590 ASSERT(object.is(result)); 1590 ASSERT(object.is(result));
1591 ASSERT(object.is(r0)); 1591 ASSERT(object.is(r0));
1592 ASSERT(!scratch.is(scratch0())); 1592 ASSERT(!scratch.is(scratch0()));
1593 ASSERT(!scratch.is(object)); 1593 ASSERT(!scratch.is(object));
1594 1594
1595 #ifdef DEBUG 1595 __ tst(object, Operand(kSmiTagMask));
1596 __ AbortIfSmi(object); 1596 DeoptimizeIf(eq, instr->environment());
1597 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE); 1597 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE);
1598 __ Assert(eq, "Trying to get date field from non-date."); 1598 DeoptimizeIf(ne, instr->environment());
1599 #endif
1600 1599
1601 if (index->value() == 0) { 1600 if (index->value() == 0) {
1602 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); 1601 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset));
1603 } else { 1602 } else {
1604 if (index->value() < JSDate::kFirstUncachedField) { 1603 if (index->value() < JSDate::kFirstUncachedField) {
1605 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); 1604 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
1606 __ mov(scratch, Operand(stamp)); 1605 __ mov(scratch, Operand(stamp));
1607 __ ldr(scratch, MemOperand(scratch)); 1606 __ ldr(scratch, MemOperand(scratch));
1608 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); 1607 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset));
1609 __ cmp(scratch, scratch0()); 1608 __ cmp(scratch, scratch0());
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 2224
2226 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); 2225 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen()));
2227 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); 2226 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
2228 } 2227 }
2229 2228
2230 2229
2231 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 2230 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2232 Register input = ToRegister(instr->InputAt(0)); 2231 Register input = ToRegister(instr->InputAt(0));
2233 Register result = ToRegister(instr->result()); 2232 Register result = ToRegister(instr->result());
2234 2233
2235 if (FLAG_debug_code) { 2234 __ AbortIfNotString(input);
2236 __ AbortIfNotString(input);
2237 }
2238 2235
2239 __ ldr(result, FieldMemOperand(input, String::kHashFieldOffset)); 2236 __ ldr(result, FieldMemOperand(input, String::kHashFieldOffset));
2240 __ IndexFromHash(result, result); 2237 __ IndexFromHash(result, result);
2241 } 2238 }
2242 2239
2243 2240
2244 void LCodeGen::DoHasCachedArrayIndexAndBranch( 2241 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2245 LHasCachedArrayIndexAndBranch* instr) { 2242 LHasCachedArrayIndexAndBranch* instr) {
2246 Register input = ToRegister(instr->InputAt(0)); 2243 Register input = ToRegister(instr->InputAt(0));
2247 Register scratch = scratch0(); 2244 Register scratch = scratch0();
(...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5613 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5617 __ ldr(result, FieldMemOperand(scratch, 5614 __ ldr(result, FieldMemOperand(scratch,
5618 FixedArray::kHeaderSize - kPointerSize)); 5615 FixedArray::kHeaderSize - kPointerSize));
5619 __ bind(&done); 5616 __ bind(&done);
5620 } 5617 }
5621 5618
5622 5619
5623 #undef __ 5620 #undef __
5624 5621
5625 } } // namespace v8::internal 5622 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/date.js » ('j') | src/messages.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698