| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 2969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2980 if (FLAG_debug_code) { | 2980 if (FLAG_debug_code) { |
| 2981 // Verify this is really an Smi. | 2981 // Verify this is really an Smi. |
| 2982 Register scratch = scratch0(); | 2982 Register scratch = scratch0(); |
| 2983 __ Load(scratch, FieldMemOperand(object, offset), representation); | 2983 __ Load(scratch, FieldMemOperand(object, offset), representation); |
| 2984 __ AssertSmi(scratch); | 2984 __ AssertSmi(scratch); |
| 2985 } | 2985 } |
| 2986 | 2986 |
| 2987 // Read int value directly from upper half of the smi. | 2987 // Read int value directly from upper half of the smi. |
| 2988 STATIC_ASSERT(kSmiTag == 0); | 2988 STATIC_ASSERT(kSmiTag == 0); |
| 2989 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); | 2989 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); |
| 2990 offset += kPointerSize / 2; | 2990 offset = SmiWordOffset(offset); |
| 2991 representation = Representation::Integer32(); | 2991 representation = Representation::Integer32(); |
| 2992 } | 2992 } |
| 2993 __ Load(result, FieldMemOperand(object, offset), representation); | 2993 __ Load(result, FieldMemOperand(object, offset), representation); |
| 2994 } | 2994 } |
| 2995 | 2995 |
| 2996 | 2996 |
| 2997 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 2997 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| 2998 DCHECK(ToRegister(instr->context()).is(cp)); | 2998 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2999 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 2999 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
| 3000 DCHECK(ToRegister(instr->result()).is(v0)); | 3000 DCHECK(ToRegister(instr->result()).is(v0)); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3254 DCHECK(!hinstr->RequiresHoleCheck()); | 3254 DCHECK(!hinstr->RequiresHoleCheck()); |
| 3255 if (FLAG_debug_code) { | 3255 if (FLAG_debug_code) { |
| 3256 Register temp = scratch1(); | 3256 Register temp = scratch1(); |
| 3257 __ Load(temp, MemOperand(store_base, offset), Representation::Smi()); | 3257 __ Load(temp, MemOperand(store_base, offset), Representation::Smi()); |
| 3258 __ AssertSmi(temp); | 3258 __ AssertSmi(temp); |
| 3259 } | 3259 } |
| 3260 | 3260 |
| 3261 // Read int value directly from upper half of the smi. | 3261 // Read int value directly from upper half of the smi. |
| 3262 STATIC_ASSERT(kSmiTag == 0); | 3262 STATIC_ASSERT(kSmiTag == 0); |
| 3263 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); | 3263 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); |
| 3264 offset += kPointerSize / 2; | 3264 offset = SmiWordOffset(offset); |
| 3265 } | 3265 } |
| 3266 | 3266 |
| 3267 __ Load(result, MemOperand(store_base, offset), representation); | 3267 __ Load(result, MemOperand(store_base, offset), representation); |
| 3268 | 3268 |
| 3269 // Check for the hole value. | 3269 // Check for the hole value. |
| 3270 if (hinstr->RequiresHoleCheck()) { | 3270 if (hinstr->RequiresHoleCheck()) { |
| 3271 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3271 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
| 3272 __ SmiTst(result, scratch); | 3272 __ SmiTst(result, scratch); |
| 3273 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, | 3273 DeoptimizeIf(ne, instr, Deoptimizer::kNotASmi, scratch, |
| 3274 Operand(zero_reg)); | 3274 Operand(zero_reg)); |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4201 } | 4201 } |
| 4202 | 4202 |
| 4203 if (representation.IsSmi() && SmiValuesAre32Bits() && | 4203 if (representation.IsSmi() && SmiValuesAre32Bits() && |
| 4204 instr->hydrogen()->value()->representation().IsInteger32()) { | 4204 instr->hydrogen()->value()->representation().IsInteger32()) { |
| 4205 DCHECK(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); | 4205 DCHECK(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY); |
| 4206 if (FLAG_debug_code) { | 4206 if (FLAG_debug_code) { |
| 4207 __ Load(scratch2, FieldMemOperand(destination, offset), representation); | 4207 __ Load(scratch2, FieldMemOperand(destination, offset), representation); |
| 4208 __ AssertSmi(scratch2); | 4208 __ AssertSmi(scratch2); |
| 4209 } | 4209 } |
| 4210 // Store int value directly to upper half of the smi. | 4210 // Store int value directly to upper half of the smi. |
| 4211 offset += kPointerSize / 2; | 4211 offset = SmiWordOffset(offset); |
| 4212 representation = Representation::Integer32(); | 4212 representation = Representation::Integer32(); |
| 4213 } | 4213 } |
| 4214 MemOperand operand = FieldMemOperand(destination, offset); | 4214 MemOperand operand = FieldMemOperand(destination, offset); |
| 4215 | 4215 |
| 4216 if (FLAG_unbox_double_fields && representation.IsDouble()) { | 4216 if (FLAG_unbox_double_fields && representation.IsDouble()) { |
| 4217 DCHECK(access.IsInobject()); | 4217 DCHECK(access.IsInobject()); |
| 4218 DoubleRegister value = ToDoubleRegister(instr->value()); | 4218 DoubleRegister value = ToDoubleRegister(instr->value()); |
| 4219 __ sdc1(value, operand); | 4219 __ sdc1(value, operand); |
| 4220 } else { | 4220 } else { |
| 4221 DCHECK(instr->value()->IsRegister()); | 4221 DCHECK(instr->value()->IsRegister()); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4467 DCHECK(instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS); | 4467 DCHECK(instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS); |
| 4468 if (FLAG_debug_code) { | 4468 if (FLAG_debug_code) { |
| 4469 Register temp = scratch1(); | 4469 Register temp = scratch1(); |
| 4470 __ Load(temp, MemOperand(store_base, offset), Representation::Smi()); | 4470 __ Load(temp, MemOperand(store_base, offset), Representation::Smi()); |
| 4471 __ AssertSmi(temp); | 4471 __ AssertSmi(temp); |
| 4472 } | 4472 } |
| 4473 | 4473 |
| 4474 // Store int value directly to upper half of the smi. | 4474 // Store int value directly to upper half of the smi. |
| 4475 STATIC_ASSERT(kSmiTag == 0); | 4475 STATIC_ASSERT(kSmiTag == 0); |
| 4476 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); | 4476 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); |
| 4477 offset += kPointerSize / 2; | 4477 offset = SmiWordOffset(offset); |
| 4478 representation = Representation::Integer32(); | 4478 representation = Representation::Integer32(); |
| 4479 } | 4479 } |
| 4480 | 4480 |
| 4481 __ Store(value, MemOperand(store_base, offset), representation); | 4481 __ Store(value, MemOperand(store_base, offset), representation); |
| 4482 | 4482 |
| 4483 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4483 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4484 SmiCheck check_needed = | 4484 SmiCheck check_needed = |
| 4485 instr->hydrogen()->value()->type().IsHeapObject() | 4485 instr->hydrogen()->value()->type().IsHeapObject() |
| 4486 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4486 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 4487 // Compute address of modified element and store it into key register. | 4487 // Compute address of modified element and store it into key register. |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6091 __ Push(at, ToRegister(instr->function())); | 6091 __ Push(at, ToRegister(instr->function())); |
| 6092 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6092 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6093 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6093 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6094 } | 6094 } |
| 6095 | 6095 |
| 6096 | 6096 |
| 6097 #undef __ | 6097 #undef __ |
| 6098 | 6098 |
| 6099 } // namespace internal | 6099 } // namespace internal |
| 6100 } // namespace v8 | 6100 } // namespace v8 |
| OLD | NEW |