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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-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 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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 1442
1443 void LCodeGen::DoDateField(LDateField* instr) { 1443 void LCodeGen::DoDateField(LDateField* instr) {
1444 Register object = ToRegister(instr->InputAt(0)); 1444 Register object = ToRegister(instr->InputAt(0));
1445 Register result = ToRegister(instr->result()); 1445 Register result = ToRegister(instr->result());
1446 Register scratch = ToRegister(instr->TempAt(0)); 1446 Register scratch = ToRegister(instr->TempAt(0));
1447 Smi* index = instr->index(); 1447 Smi* index = instr->index();
1448 Label runtime, done; 1448 Label runtime, done;
1449 ASSERT(object.is(result)); 1449 ASSERT(object.is(result));
1450 ASSERT(object.is(eax)); 1450 ASSERT(object.is(eax));
1451 1451
1452 #ifdef DEBUG 1452 __ test(object, Immediate(kSmiTagMask));
1453 __ AbortIfSmi(object); 1453 DeoptimizeIf(zero, instr->environment());
1454 __ CmpObjectType(object, JS_DATE_TYPE, scratch); 1454 __ CmpObjectType(object, JS_DATE_TYPE, scratch);
1455 __ Assert(equal, "Trying to get date field from non-date."); 1455 DeoptimizeIf(not_equal, instr->environment());
1456 #endif
1457 1456
1458 if (index->value() == 0) { 1457 if (index->value() == 0) {
1459 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); 1458 __ mov(result, FieldOperand(object, JSDate::kValueOffset));
1460 } else { 1459 } else {
1461 if (index->value() < JSDate::kFirstUncachedField) { 1460 if (index->value() < JSDate::kFirstUncachedField) {
1462 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); 1461 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
1463 __ mov(scratch, Operand::StaticVariable(stamp)); 1462 __ mov(scratch, Operand::StaticVariable(stamp));
1464 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); 1463 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset));
1465 __ j(not_equal, &runtime, Label::kNear); 1464 __ j(not_equal, &runtime, Label::kNear);
1466 __ mov(result, FieldOperand(object, JSDate::kValueOffset + 1465 __ mov(result, FieldOperand(object, JSDate::kValueOffset +
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 2067
2069 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); 2068 __ CmpObjectType(input, TestType(instr->hydrogen()), temp);
2070 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); 2069 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen()));
2071 } 2070 }
2072 2071
2073 2072
2074 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { 2073 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) {
2075 Register input = ToRegister(instr->InputAt(0)); 2074 Register input = ToRegister(instr->InputAt(0));
2076 Register result = ToRegister(instr->result()); 2075 Register result = ToRegister(instr->result());
2077 2076
2078 if (FLAG_debug_code) { 2077 __ AbortIfNotString(input);
2079 __ AbortIfNotString(input);
2080 }
2081 2078
2082 __ mov(result, FieldOperand(input, String::kHashFieldOffset)); 2079 __ mov(result, FieldOperand(input, String::kHashFieldOffset));
2083 __ IndexFromHash(result, result); 2080 __ IndexFromHash(result, result);
2084 } 2081 }
2085 2082
2086 2083
2087 void LCodeGen::DoHasCachedArrayIndexAndBranch( 2084 void LCodeGen::DoHasCachedArrayIndexAndBranch(
2088 LHasCachedArrayIndexAndBranch* instr) { 2085 LHasCachedArrayIndexAndBranch* instr) {
2089 Register input = ToRegister(instr->InputAt(0)); 2086 Register input = ToRegister(instr->InputAt(0));
2090 2087
(...skipping 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after
5516 FixedArray::kHeaderSize - kPointerSize)); 5513 FixedArray::kHeaderSize - kPointerSize));
5517 __ bind(&done); 5514 __ bind(&done);
5518 } 5515 }
5519 5516
5520 5517
5521 #undef __ 5518 #undef __
5522 5519
5523 } } // namespace v8::internal 5520 } } // namespace v8::internal
5524 5521
5525 #endif // V8_TARGET_ARCH_IA32 5522 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698