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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 | 1058 |
1059 Node* CodeStubAssembler::LoadInstanceType(Node* object) { | 1059 Node* CodeStubAssembler::LoadInstanceType(Node* object) { |
1060 return LoadMapInstanceType(LoadMap(object)); | 1060 return LoadMapInstanceType(LoadMap(object)); |
1061 } | 1061 } |
1062 | 1062 |
1063 Node* CodeStubAssembler::HasInstanceType(Node* object, | 1063 Node* CodeStubAssembler::HasInstanceType(Node* object, |
1064 InstanceType instance_type) { | 1064 InstanceType instance_type) { |
1065 return Word32Equal(LoadInstanceType(object), Int32Constant(instance_type)); | 1065 return Word32Equal(LoadInstanceType(object), Int32Constant(instance_type)); |
1066 } | 1066 } |
1067 | 1067 |
| 1068 Node* CodeStubAssembler::DoesntHaveInstanceType(Node* object, |
| 1069 InstanceType instance_type) { |
| 1070 return Word32NotEqual(LoadInstanceType(object), Int32Constant(instance_type)); |
| 1071 } |
| 1072 |
1068 Node* CodeStubAssembler::LoadProperties(Node* object) { | 1073 Node* CodeStubAssembler::LoadProperties(Node* object) { |
1069 return LoadObjectField(object, JSObject::kPropertiesOffset); | 1074 return LoadObjectField(object, JSObject::kPropertiesOffset); |
1070 } | 1075 } |
1071 | 1076 |
1072 Node* CodeStubAssembler::LoadElements(Node* object) { | 1077 Node* CodeStubAssembler::LoadElements(Node* object) { |
1073 return LoadObjectField(object, JSObject::kElementsOffset); | 1078 return LoadObjectField(object, JSObject::kElementsOffset); |
1074 } | 1079 } |
1075 | 1080 |
1076 Node* CodeStubAssembler::LoadJSArrayLength(Node* array) { | 1081 Node* CodeStubAssembler::LoadJSArrayLength(Node* array) { |
1077 CSA_ASSERT(this, IsJSArray(array)); | 1082 CSA_ASSERT(this, IsJSArray(array)); |
(...skipping 5268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6346 | 6351 |
6347 int increment = IsFastDoubleElementsKind(kind) ? kDoubleSize : kPointerSize; | 6352 int increment = IsFastDoubleElementsKind(kind) ? kDoubleSize : kPointerSize; |
6348 BuildFastLoop( | 6353 BuildFastLoop( |
6349 MachineType::PointerRepresentation(), start, limit, | 6354 MachineType::PointerRepresentation(), start, limit, |
6350 [fixed_array, &body](Node* offset) { body(fixed_array, offset); }, | 6355 [fixed_array, &body](Node* offset) { body(fixed_array, offset); }, |
6351 direction == ForEachDirection::kReverse ? -increment : increment, | 6356 direction == ForEachDirection::kReverse ? -increment : increment, |
6352 direction == ForEachDirection::kReverse ? IndexAdvanceMode::kPre | 6357 direction == ForEachDirection::kReverse ? IndexAdvanceMode::kPre |
6353 : IndexAdvanceMode::kPost); | 6358 : IndexAdvanceMode::kPost); |
6354 } | 6359 } |
6355 | 6360 |
| 6361 void CodeStubAssembler::InitializeFieldsWithRoot( |
| 6362 Node* object, Node* start_offset, Node* end_offset, |
| 6363 Heap::RootListIndex root_index) { |
| 6364 start_offset = IntPtrAdd(start_offset, IntPtrConstant(-kHeapObjectTag)); |
| 6365 end_offset = IntPtrAdd(end_offset, IntPtrConstant(-kHeapObjectTag)); |
| 6366 Node* root_value = LoadRoot(root_index); |
| 6367 BuildFastLoop(MachineType::PointerRepresentation(), end_offset, start_offset, |
| 6368 [this, object, root_value](Node* current) { |
| 6369 StoreNoWriteBarrier(MachineRepresentation::kTagged, object, |
| 6370 current, root_value); |
| 6371 }, |
| 6372 -kPointerSize, CodeStubAssembler::IndexAdvanceMode::kPre); |
| 6373 } |
| 6374 |
6356 void CodeStubAssembler::BranchIfNumericRelationalComparison( | 6375 void CodeStubAssembler::BranchIfNumericRelationalComparison( |
6357 RelationalComparisonMode mode, Node* lhs, Node* rhs, Label* if_true, | 6376 RelationalComparisonMode mode, Node* lhs, Node* rhs, Label* if_true, |
6358 Label* if_false) { | 6377 Label* if_false) { |
6359 Label end(this); | 6378 Label end(this); |
6360 Variable result(this, MachineRepresentation::kTagged); | 6379 Variable result(this, MachineRepresentation::kTagged); |
6361 | 6380 |
6362 // Shared entry for floating point comparison. | 6381 // Shared entry for floating point comparison. |
6363 Label do_fcmp(this); | 6382 Label do_fcmp(this); |
6364 Variable var_fcmp_lhs(this, MachineRepresentation::kFloat64), | 6383 Variable var_fcmp_lhs(this, MachineRepresentation::kFloat64), |
6365 var_fcmp_rhs(this, MachineRepresentation::kFloat64); | 6384 var_fcmp_rhs(this, MachineRepresentation::kFloat64); |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8336 Heap::kUndefinedValueRootIndex); | 8355 Heap::kUndefinedValueRootIndex); |
8337 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, | 8356 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, |
8338 Heap::kUndefinedValueRootIndex); | 8357 Heap::kUndefinedValueRootIndex); |
8339 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, | 8358 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, |
8340 context); | 8359 context); |
8341 return result; | 8360 return result; |
8342 } | 8361 } |
8343 | 8362 |
8344 } // namespace internal | 8363 } // namespace internal |
8345 } // namespace v8 | 8364 } // namespace v8 |
OLD | NEW |