| OLD | NEW |
| 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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1437 | 1437 |
| 1438 void LCodeGen::DoDateField(LDateField* instr) { | 1438 void LCodeGen::DoDateField(LDateField* instr) { |
| 1439 Register object = ToRegister(instr->InputAt(0)); | 1439 Register object = ToRegister(instr->InputAt(0)); |
| 1440 Register result = ToRegister(instr->result()); | 1440 Register result = ToRegister(instr->result()); |
| 1441 Register scratch = ToRegister(instr->TempAt(0)); | 1441 Register scratch = ToRegister(instr->TempAt(0)); |
| 1442 Smi* index = instr->index(); | 1442 Smi* index = instr->index(); |
| 1443 Label runtime, done; | 1443 Label runtime, done; |
| 1444 ASSERT(object.is(result)); | 1444 ASSERT(object.is(result)); |
| 1445 ASSERT(object.is(eax)); | 1445 ASSERT(object.is(eax)); |
| 1446 | 1446 |
| 1447 #ifdef DEBUG | 1447 __ test(object, Immediate(kSmiTagMask)); |
| 1448 __ AbortIfSmi(object); | 1448 DeoptimizeIf(zero, instr->environment()); |
| 1449 __ CmpObjectType(object, JS_DATE_TYPE, scratch); | 1449 __ CmpObjectType(object, JS_DATE_TYPE, scratch); |
| 1450 __ Assert(equal, "Trying to get date field from non-date."); | 1450 DeoptimizeIf(not_equal, instr->environment()); |
| 1451 #endif | |
| 1452 | 1451 |
| 1453 if (index->value() == 0) { | 1452 if (index->value() == 0) { |
| 1454 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); | 1453 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); |
| 1455 } else { | 1454 } else { |
| 1456 if (index->value() < JSDate::kFirstUncachedField) { | 1455 if (index->value() < JSDate::kFirstUncachedField) { |
| 1457 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1456 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1458 __ mov(scratch, Operand::StaticVariable(stamp)); | 1457 __ mov(scratch, Operand::StaticVariable(stamp)); |
| 1459 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); | 1458 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); |
| 1460 __ j(not_equal, &runtime, Label::kNear); | 1459 __ j(not_equal, &runtime, Label::kNear); |
| 1461 __ mov(result, FieldOperand(object, JSDate::kValueOffset + | 1460 __ mov(result, FieldOperand(object, JSDate::kValueOffset + |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 | 2062 |
| 2064 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); | 2063 __ CmpObjectType(input, TestType(instr->hydrogen()), temp); |
| 2065 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); | 2064 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); |
| 2066 } | 2065 } |
| 2067 | 2066 |
| 2068 | 2067 |
| 2069 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | 2068 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
| 2070 Register input = ToRegister(instr->InputAt(0)); | 2069 Register input = ToRegister(instr->InputAt(0)); |
| 2071 Register result = ToRegister(instr->result()); | 2070 Register result = ToRegister(instr->result()); |
| 2072 | 2071 |
| 2073 if (FLAG_debug_code) { | 2072 __ AbortIfNotString(input); |
| 2074 __ AbortIfNotString(input); | |
| 2075 } | |
| 2076 | 2073 |
| 2077 __ mov(result, FieldOperand(input, String::kHashFieldOffset)); | 2074 __ mov(result, FieldOperand(input, String::kHashFieldOffset)); |
| 2078 __ IndexFromHash(result, result); | 2075 __ IndexFromHash(result, result); |
| 2079 } | 2076 } |
| 2080 | 2077 |
| 2081 | 2078 |
| 2082 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 2079 void LCodeGen::DoHasCachedArrayIndexAndBranch( |
| 2083 LHasCachedArrayIndexAndBranch* instr) { | 2080 LHasCachedArrayIndexAndBranch* instr) { |
| 2084 Register input = ToRegister(instr->InputAt(0)); | 2081 Register input = ToRegister(instr->InputAt(0)); |
| 2085 | 2082 |
| (...skipping 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5511 FixedArray::kHeaderSize - kPointerSize)); | 5508 FixedArray::kHeaderSize - kPointerSize)); |
| 5512 __ bind(&done); | 5509 __ bind(&done); |
| 5513 } | 5510 } |
| 5514 | 5511 |
| 5515 | 5512 |
| 5516 #undef __ | 5513 #undef __ |
| 5517 | 5514 |
| 5518 } } // namespace v8::internal | 5515 } } // namespace v8::internal |
| 5519 | 5516 |
| 5520 #endif // V8_TARGET_ARCH_IA32 | 5517 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |