| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 #include "src/frames.h" | 8 #include "src/frames.h" |
| 9 #include "src/ic/handler-configuration.h" | 9 #include "src/ic/handler-configuration.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 | 272 |
| 273 Bind(&return_minus_x); | 273 Bind(&return_minus_x); |
| 274 var_x.Bind(Float64Neg(var_x.value())); | 274 var_x.Bind(Float64Neg(var_x.value())); |
| 275 Goto(&return_x); | 275 Goto(&return_x); |
| 276 | 276 |
| 277 Bind(&return_x); | 277 Bind(&return_x); |
| 278 return var_x.value(); | 278 return var_x.value(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 Node* CodeStubAssembler::SmiShiftBitsConstant() { |
| 282 return IntPtrConstant(kSmiShiftSize + kSmiTagSize); |
| 283 } |
| 284 |
| 281 Node* CodeStubAssembler::SmiFromWord32(Node* value) { | 285 Node* CodeStubAssembler::SmiFromWord32(Node* value) { |
| 282 value = ChangeInt32ToIntPtr(value); | 286 value = ChangeInt32ToIntPtr(value); |
| 283 return WordShl(value, SmiShiftBitsConstant()); | 287 return WordShl(value, SmiShiftBitsConstant()); |
| 284 } | 288 } |
| 285 | 289 |
| 286 Node* CodeStubAssembler::SmiTag(Node* value) { | 290 Node* CodeStubAssembler::SmiTag(Node* value) { |
| 287 int32_t constant_value; | 291 int32_t constant_value; |
| 288 if (ToInt32Constant(value, constant_value) && Smi::IsValid(constant_value)) { | 292 if (ToInt32Constant(value, constant_value) && Smi::IsValid(constant_value)) { |
| 289 return SmiConstant(Smi::FromInt(constant_value)); | 293 return SmiConstant(Smi::FromInt(constant_value)); |
| 290 } | 294 } |
| (...skipping 3702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3993 Node* enum_length = EnumLength(current_map.value()); | 3997 Node* enum_length = EnumLength(current_map.value()); |
| 3994 Node* zero_constant = SmiConstant(Smi::FromInt(0)); | 3998 Node* zero_constant = SmiConstant(Smi::FromInt(0)); |
| 3995 BranchIf(WordEqual(enum_length, zero_constant), &loop, use_runtime); | 3999 BranchIf(WordEqual(enum_length, zero_constant), &loop, use_runtime); |
| 3996 } | 4000 } |
| 3997 } | 4001 } |
| 3998 | 4002 |
| 3999 Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector, | 4003 Node* CodeStubAssembler::CreateWeakCellInFeedbackVector(Node* feedback_vector, |
| 4000 Node* slot, | 4004 Node* slot, |
| 4001 Node* value) { | 4005 Node* value) { |
| 4002 Node* size = IntPtrConstant(WeakCell::kSize); | 4006 Node* size = IntPtrConstant(WeakCell::kSize); |
| 4003 Node* cell = Allocate(size, compiler::CodeAssembler::kPretenured); | 4007 Node* cell = Allocate(size, CodeStubAssembler::kPretenured); |
| 4004 | 4008 |
| 4005 // Initialize the WeakCell. | 4009 // Initialize the WeakCell. |
| 4006 StoreObjectFieldRoot(cell, WeakCell::kMapOffset, Heap::kWeakCellMapRootIndex); | 4010 StoreObjectFieldRoot(cell, WeakCell::kMapOffset, Heap::kWeakCellMapRootIndex); |
| 4007 StoreObjectField(cell, WeakCell::kValueOffset, value); | 4011 StoreObjectField(cell, WeakCell::kValueOffset, value); |
| 4008 StoreObjectFieldRoot(cell, WeakCell::kNextOffset, | 4012 StoreObjectFieldRoot(cell, WeakCell::kNextOffset, |
| 4009 Heap::kTheHoleValueRootIndex); | 4013 Heap::kTheHoleValueRootIndex); |
| 4010 | 4014 |
| 4011 // Store the WeakCell in the feedback vector. | 4015 // Store the WeakCell in the feedback vector. |
| 4012 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, | 4016 StoreFixedArrayElement(feedback_vector, slot, cell, UPDATE_WRITE_BARRIER, |
| 4013 CodeStubAssembler::SMI_PARAMETERS); | 4017 CodeStubAssembler::SMI_PARAMETERS); |
| 4014 return cell; | 4018 return cell; |
| 4015 } | 4019 } |
| 4016 | 4020 |
| 4017 } // namespace internal | 4021 } // namespace internal |
| 4018 } // namespace v8 | 4022 } // namespace v8 |
| OLD | NEW |