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

Side by Side Diff: src/mips/lithium-codegen-mips.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/mips/full-codegen-mips.cc ('k') | src/mips/lithium-mips.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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 Register object = ToRegister(instr->InputAt(0)); 1283 Register object = ToRegister(instr->InputAt(0));
1284 Register result = ToRegister(instr->result()); 1284 Register result = ToRegister(instr->result());
1285 Register scratch = ToRegister(instr->TempAt(0)); 1285 Register scratch = ToRegister(instr->TempAt(0));
1286 Smi* index = instr->index(); 1286 Smi* index = instr->index();
1287 Label runtime, done; 1287 Label runtime, done;
1288 ASSERT(object.is(a0)); 1288 ASSERT(object.is(a0));
1289 ASSERT(result.is(v0)); 1289 ASSERT(result.is(v0));
1290 ASSERT(!scratch.is(scratch0())); 1290 ASSERT(!scratch.is(scratch0()));
1291 ASSERT(!scratch.is(object)); 1291 ASSERT(!scratch.is(object));
1292 1292
1293 #ifdef DEBUG 1293 __ And(at, object, Operand(kSmiTagMask));
1294 __ AbortIfSmi(object); 1294 DeoptimizeIf(eq, instr->environment(), at, Operand(zero_reg));
1295 __ GetObjectType(object, scratch, scratch); 1295 __ GetObjectType(object, scratch, scratch);
1296 __ Assert(eq, "Trying to get date field from non-date.", 1296 DeoptimizeIf(ne, instr->environment(), scratch, Operand(JS_DATE_TYPE));
1297 scratch, Operand(JS_DATE_TYPE));
1298 #endif
1299 1297
1300 if (index->value() == 0) { 1298 if (index->value() == 0) {
1301 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); 1299 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset));
1302 } else { 1300 } else {
1303 if (index->value() < JSDate::kFirstUncachedField) { 1301 if (index->value() < JSDate::kFirstUncachedField) {
1304 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); 1302 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
1305 __ li(scratch, Operand(stamp)); 1303 __ li(scratch, Operand(stamp));
1306 __ lw(scratch, MemOperand(scratch)); 1304 __ lw(scratch, MemOperand(scratch));
1307 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); 1305 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset));
1308 __ Branch(&runtime, ne, scratch, Operand(scratch0())); 1306 __ Branch(&runtime, ne, scratch, Operand(scratch0()));
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 BranchCondition(instr->hydrogen()), 1964 BranchCondition(instr->hydrogen()),
1967 scratch, 1965 scratch,
1968 Operand(TestType(instr->hydrogen()))); 1966 Operand(TestType(instr->hydrogen())));
1969 } 1967 }
1970 1968
1971 1969
1972 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 1970 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
1973 Register input = ToRegister(instr->InputAt(0)); 1971 Register input = ToRegister(instr->InputAt(0));
1974 Register result = ToRegister(instr->result()); 1972 Register result = ToRegister(instr->result());
1975 1973
1976 if (FLAG_debug_code) { 1974 __ AbortIfNotString(input);
1977 __ AbortIfNotString(input);
1978 }
1979 1975
1980 __ lw(result, FieldMemOperand(input, String::kHashFieldOffset)); 1976 __ lw(result, FieldMemOperand(input, String::kHashFieldOffset));
1981 __ IndexFromHash(result, result); 1977 __ IndexFromHash(result, result);
1982 } 1978 }
1983 1979
1984 1980
1985 void LCodeGen::DoHasCachedArrayIndexAndBranch( 1981 void LCodeGen::DoHasCachedArrayIndexAndBranch(
1986 LHasCachedArrayIndexAndBranch* instr) { 1982 LHasCachedArrayIndexAndBranch* instr) {
1987 Register input = ToRegister(instr->InputAt(0)); 1983 Register input = ToRegister(instr->InputAt(0));
1988 Register scratch = scratch0(); 1984 Register scratch = scratch0();
(...skipping 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5421 __ Subu(scratch, result, scratch); 5417 __ Subu(scratch, result, scratch);
5422 __ lw(result, FieldMemOperand(scratch, 5418 __ lw(result, FieldMemOperand(scratch,
5423 FixedArray::kHeaderSize - kPointerSize)); 5419 FixedArray::kHeaderSize - kPointerSize));
5424 __ bind(&done); 5420 __ bind(&done);
5425 } 5421 }
5426 5422
5427 5423
5428 #undef __ 5424 #undef __
5429 5425
5430 } } // namespace v8::internal 5426 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698