OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 1905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 Register map = ToRegister(instr->value()); | 1916 Register map = ToRegister(instr->value()); |
1917 __ EnumLength(result, map); | 1917 __ EnumLength(result, map); |
1918 } | 1918 } |
1919 | 1919 |
1920 | 1920 |
1921 void LCodeGen::DoDateField(LDateField* instr) { | 1921 void LCodeGen::DoDateField(LDateField* instr) { |
1922 Register object = ToRegister(instr->date()); | 1922 Register object = ToRegister(instr->date()); |
1923 Register result = ToRegister(instr->result()); | 1923 Register result = ToRegister(instr->result()); |
1924 Register scratch = ToRegister(instr->temp()); | 1924 Register scratch = ToRegister(instr->temp()); |
1925 Smi* index = instr->index(); | 1925 Smi* index = instr->index(); |
1926 Label runtime, done; | |
1927 DCHECK(object.is(result)); | 1926 DCHECK(object.is(result)); |
1928 DCHECK(object.is(r3)); | 1927 DCHECK(object.is(r3)); |
1929 DCHECK(!scratch.is(scratch0())); | 1928 DCHECK(!scratch.is(scratch0())); |
1930 DCHECK(!scratch.is(object)); | 1929 DCHECK(!scratch.is(object)); |
1931 | 1930 |
1932 __ TestIfSmi(object, r0); | |
1933 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, cr0); | |
1934 __ CompareObjectType(object, scratch, scratch, JS_DATE_TYPE); | |
1935 DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject); | |
1936 | |
1937 if (index->value() == 0) { | 1931 if (index->value() == 0) { |
1938 __ LoadP(result, FieldMemOperand(object, JSDate::kValueOffset)); | 1932 __ LoadP(result, FieldMemOperand(object, JSDate::kValueOffset)); |
1939 } else { | 1933 } else { |
| 1934 Label runtime, done; |
1940 if (index->value() < JSDate::kFirstUncachedField) { | 1935 if (index->value() < JSDate::kFirstUncachedField) { |
1941 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1936 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1942 __ mov(scratch, Operand(stamp)); | 1937 __ mov(scratch, Operand(stamp)); |
1943 __ LoadP(scratch, MemOperand(scratch)); | 1938 __ LoadP(scratch, MemOperand(scratch)); |
1944 __ LoadP(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | 1939 __ LoadP(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
1945 __ cmp(scratch, scratch0()); | 1940 __ cmp(scratch, scratch0()); |
1946 __ bne(&runtime); | 1941 __ bne(&runtime); |
1947 __ LoadP(result, | 1942 __ LoadP(result, |
1948 FieldMemOperand(object, JSDate::kValueOffset + | 1943 FieldMemOperand(object, JSDate::kValueOffset + |
1949 kPointerSize * index->value())); | 1944 kPointerSize * index->value())); |
(...skipping 4325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6275 __ Push(scope_info); | 6270 __ Push(scope_info); |
6276 __ push(ToRegister(instr->function())); | 6271 __ push(ToRegister(instr->function())); |
6277 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6272 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6278 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6273 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6279 } | 6274 } |
6280 | 6275 |
6281 | 6276 |
6282 #undef __ | 6277 #undef __ |
6283 } // namespace internal | 6278 } // namespace internal |
6284 } // namespace v8 | 6279 } // namespace v8 |
OLD | NEW |