| 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 __ movq(result, FieldOperand(input, JSValue::kValueOffset)); | 1325 __ movq(result, FieldOperand(input, JSValue::kValueOffset)); |
| 1326 | 1326 |
| 1327 __ bind(&done); | 1327 __ bind(&done); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 | 1330 |
| 1331 void LCodeGen::DoDateField(LDateField* instr) { | 1331 void LCodeGen::DoDateField(LDateField* instr) { |
| 1332 Register object = ToRegister(instr->InputAt(0)); | 1332 Register object = ToRegister(instr->InputAt(0)); |
| 1333 Register result = ToRegister(instr->result()); | 1333 Register result = ToRegister(instr->result()); |
| 1334 Smi* index = instr->index(); | 1334 Smi* index = instr->index(); |
| 1335 Label runtime, done; | 1335 Label runtime, done, not_date_object; |
| 1336 ASSERT(object.is(result)); | 1336 ASSERT(object.is(result)); |
| 1337 ASSERT(object.is(rax)); | 1337 ASSERT(object.is(rax)); |
| 1338 | 1338 |
| 1339 #ifdef DEBUG | 1339 Condition cc = masm()->CheckSmi(object); |
| 1340 __ AbortIfSmi(object); | 1340 DeoptimizeIf(cc, instr->environment()); |
| 1341 __ CmpObjectType(object, JS_DATE_TYPE, kScratchRegister); | 1341 __ CmpObjectType(object, JS_DATE_TYPE, kScratchRegister); |
| 1342 __ Assert(equal, "Trying to get date field from non-date."); | 1342 DeoptimizeIf(not_equal, instr->environment()); |
| 1343 #endif | |
| 1344 | 1343 |
| 1345 if (index->value() == 0) { | 1344 if (index->value() == 0) { |
| 1346 __ movq(result, FieldOperand(object, JSDate::kValueOffset)); | 1345 __ movq(result, FieldOperand(object, JSDate::kValueOffset)); |
| 1347 } else { | 1346 } else { |
| 1348 if (index->value() < JSDate::kFirstUncachedField) { | 1347 if (index->value() < JSDate::kFirstUncachedField) { |
| 1349 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1348 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1350 __ movq(kScratchRegister, stamp); | 1349 __ movq(kScratchRegister, stamp); |
| 1351 __ cmpq(kScratchRegister, FieldOperand(object, | 1350 __ cmpq(kScratchRegister, FieldOperand(object, |
| 1352 JSDate::kCacheStampOffset)); | 1351 JSDate::kCacheStampOffset)); |
| 1353 __ j(not_equal, &runtime, Label::kNear); | 1352 __ j(not_equal, &runtime, Label::kNear); |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 | 1951 |
| 1953 __ CmpObjectType(input, TestType(instr->hydrogen()), kScratchRegister); | 1952 __ CmpObjectType(input, TestType(instr->hydrogen()), kScratchRegister); |
| 1954 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); | 1953 EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); |
| 1955 } | 1954 } |
| 1956 | 1955 |
| 1957 | 1956 |
| 1958 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | 1957 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { |
| 1959 Register input = ToRegister(instr->InputAt(0)); | 1958 Register input = ToRegister(instr->InputAt(0)); |
| 1960 Register result = ToRegister(instr->result()); | 1959 Register result = ToRegister(instr->result()); |
| 1961 | 1960 |
| 1962 if (FLAG_debug_code) { | 1961 __ AbortIfNotString(input); |
| 1963 __ AbortIfNotString(input); | |
| 1964 } | |
| 1965 | 1962 |
| 1966 __ movl(result, FieldOperand(input, String::kHashFieldOffset)); | 1963 __ movl(result, FieldOperand(input, String::kHashFieldOffset)); |
| 1967 ASSERT(String::kHashShift >= kSmiTagSize); | 1964 ASSERT(String::kHashShift >= kSmiTagSize); |
| 1968 __ IndexFromHash(result, result); | 1965 __ IndexFromHash(result, result); |
| 1969 } | 1966 } |
| 1970 | 1967 |
| 1971 | 1968 |
| 1972 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 1969 void LCodeGen::DoHasCachedArrayIndexAndBranch( |
| 1973 LHasCachedArrayIndexAndBranch* instr) { | 1970 LHasCachedArrayIndexAndBranch* instr) { |
| 1974 Register input = ToRegister(instr->InputAt(0)); | 1971 Register input = ToRegister(instr->InputAt(0)); |
| (...skipping 3309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 FixedArray::kHeaderSize - kPointerSize)); | 5281 FixedArray::kHeaderSize - kPointerSize)); |
| 5285 __ bind(&done); | 5282 __ bind(&done); |
| 5286 } | 5283 } |
| 5287 | 5284 |
| 5288 | 5285 |
| 5289 #undef __ | 5286 #undef __ |
| 5290 | 5287 |
| 5291 } } // namespace v8::internal | 5288 } } // namespace v8::internal |
| 5292 | 5289 |
| 5293 #endif // V8_TARGET_ARCH_X64 | 5290 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |