OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 Register map = ToRegister(instr->value()); | 1923 Register map = ToRegister(instr->value()); |
1924 __ EnumLength(result, map); | 1924 __ EnumLength(result, map); |
1925 } | 1925 } |
1926 | 1926 |
1927 | 1927 |
1928 void LCodeGen::DoDateField(LDateField* instr) { | 1928 void LCodeGen::DoDateField(LDateField* instr) { |
1929 Register object = ToRegister(instr->date()); | 1929 Register object = ToRegister(instr->date()); |
1930 Register result = ToRegister(instr->result()); | 1930 Register result = ToRegister(instr->result()); |
1931 Register scratch = ToRegister(instr->temp()); | 1931 Register scratch = ToRegister(instr->temp()); |
1932 Smi* index = instr->index(); | 1932 Smi* index = instr->index(); |
1933 Label runtime, done; | |
1934 DCHECK(object.is(result)); | 1933 DCHECK(object.is(result)); |
1935 DCHECK(object.is(r0)); | 1934 DCHECK(object.is(r0)); |
1936 DCHECK(!scratch.is(scratch0())); | 1935 DCHECK(!scratch.is(scratch0())); |
1937 DCHECK(!scratch.is(object)); | 1936 DCHECK(!scratch.is(object)); |
1938 | 1937 |
1939 __ SmiTst(object); | |
1940 DeoptimizeIf(eq, instr, Deoptimizer::kSmi); | |
1941 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE); | |
1942 DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject); | |
1943 | |
1944 if (index->value() == 0) { | 1938 if (index->value() == 0) { |
1945 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); | 1939 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); |
1946 } else { | 1940 } else { |
| 1941 Label runtime, done; |
1947 if (index->value() < JSDate::kFirstUncachedField) { | 1942 if (index->value() < JSDate::kFirstUncachedField) { |
1948 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1943 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1949 __ mov(scratch, Operand(stamp)); | 1944 __ mov(scratch, Operand(stamp)); |
1950 __ ldr(scratch, MemOperand(scratch)); | 1945 __ ldr(scratch, MemOperand(scratch)); |
1951 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | 1946 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
1952 __ cmp(scratch, scratch0()); | 1947 __ cmp(scratch, scratch0()); |
1953 __ b(ne, &runtime); | 1948 __ b(ne, &runtime); |
1954 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset + | 1949 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset + |
1955 kPointerSize * index->value())); | 1950 kPointerSize * index->value())); |
1956 __ jmp(&done); | 1951 __ jmp(&done); |
(...skipping 4056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6013 __ push(ToRegister(instr->function())); | 6008 __ push(ToRegister(instr->function())); |
6014 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6009 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6015 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6010 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6016 } | 6011 } |
6017 | 6012 |
6018 | 6013 |
6019 #undef __ | 6014 #undef __ |
6020 | 6015 |
6021 } // namespace internal | 6016 } // namespace internal |
6022 } // namespace v8 | 6017 } // namespace v8 |
OLD | NEW |