| 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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 Word32Equal(LoadInstanceType(result.value()), Int32Constant(MAP_TYPE)); | 1194 Word32Equal(LoadInstanceType(result.value()), Int32Constant(MAP_TYPE)); |
| 1195 GotoUnless(is_map_type, &done); | 1195 GotoUnless(is_map_type, &done); |
| 1196 result.Bind( | 1196 result.Bind( |
| 1197 LoadObjectField(result.value(), Map::kConstructorOrBackPointerOffset)); | 1197 LoadObjectField(result.value(), Map::kConstructorOrBackPointerOffset)); |
| 1198 Goto(&loop); | 1198 Goto(&loop); |
| 1199 } | 1199 } |
| 1200 Bind(&done); | 1200 Bind(&done); |
| 1201 return result.value(); | 1201 return result.value(); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 Node* CodeStubAssembler::LoadSharedFunctionInfoSpecialField( |
| 1205 Node* shared, int offset, ParameterMode mode) { |
| 1206 if (Is64()) { |
| 1207 Node* result = LoadObjectField(shared, offset, MachineType::Int32()); |
| 1208 if (mode == SMI_PARAMETERS) { |
| 1209 result = SmiTag(result); |
| 1210 } else { |
| 1211 result = ChangeUint32ToWord(result); |
| 1212 } |
| 1213 return result; |
| 1214 } else { |
| 1215 Node* result = LoadObjectField(shared, offset); |
| 1216 if (mode != SMI_PARAMETERS) { |
| 1217 result = SmiUntag(result); |
| 1218 } |
| 1219 return result; |
| 1220 } |
| 1221 } |
| 1222 |
| 1204 Node* CodeStubAssembler::LoadNameHashField(Node* name) { | 1223 Node* CodeStubAssembler::LoadNameHashField(Node* name) { |
| 1205 CSA_ASSERT(this, IsName(name)); | 1224 CSA_ASSERT(this, IsName(name)); |
| 1206 return LoadObjectField(name, Name::kHashFieldOffset, MachineType::Uint32()); | 1225 return LoadObjectField(name, Name::kHashFieldOffset, MachineType::Uint32()); |
| 1207 } | 1226 } |
| 1208 | 1227 |
| 1209 Node* CodeStubAssembler::LoadNameHash(Node* name, Label* if_hash_not_computed) { | 1228 Node* CodeStubAssembler::LoadNameHash(Node* name, Label* if_hash_not_computed) { |
| 1210 Node* hash_field = LoadNameHashField(name); | 1229 Node* hash_field = LoadNameHashField(name); |
| 1211 if (if_hash_not_computed != nullptr) { | 1230 if (if_hash_not_computed != nullptr) { |
| 1212 GotoIf(Word32Equal( | 1231 GotoIf(Word32Equal( |
| 1213 Word32And(hash_field, Int32Constant(Name::kHashNotComputedMask)), | 1232 Word32And(hash_field, Int32Constant(Name::kHashNotComputedMask)), |
| (...skipping 5121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6335 | 6354 |
| 6336 int increment = IsFastDoubleElementsKind(kind) ? kDoubleSize : kPointerSize; | 6355 int increment = IsFastDoubleElementsKind(kind) ? kDoubleSize : kPointerSize; |
| 6337 BuildFastLoop( | 6356 BuildFastLoop( |
| 6338 vars, MachineType::PointerRepresentation(), start, limit, | 6357 vars, MachineType::PointerRepresentation(), start, limit, |
| 6339 [fixed_array, &body](Node* offset) { body(fixed_array, offset); }, | 6358 [fixed_array, &body](Node* offset) { body(fixed_array, offset); }, |
| 6340 direction == ForEachDirection::kReverse ? -increment : increment, | 6359 direction == ForEachDirection::kReverse ? -increment : increment, |
| 6341 direction == ForEachDirection::kReverse ? IndexAdvanceMode::kPre | 6360 direction == ForEachDirection::kReverse ? IndexAdvanceMode::kPre |
| 6342 : IndexAdvanceMode::kPost); | 6361 : IndexAdvanceMode::kPost); |
| 6343 } | 6362 } |
| 6344 | 6363 |
| 6364 void CodeStubAssembler::GotoIfFixedArraySizeDoesntFitInNewSpace( |
| 6365 Node* element_count, Label* doesnt_fit, int base_size, ParameterMode mode) { |
| 6366 int max_newspace_parameters = |
| 6367 (kMaxRegularHeapObjectSize - base_size) / kPointerSize; |
| 6368 GotoIf(IntPtrOrSmiGreaterThan( |
| 6369 element_count, IntPtrOrSmiConstant(max_newspace_parameters, mode), |
| 6370 mode), |
| 6371 doesnt_fit); |
| 6372 } |
| 6373 |
| 6345 void CodeStubAssembler::InitializeFieldsWithRoot( | 6374 void CodeStubAssembler::InitializeFieldsWithRoot( |
| 6346 Node* object, Node* start_offset, Node* end_offset, | 6375 Node* object, Node* start_offset, Node* end_offset, |
| 6347 Heap::RootListIndex root_index) { | 6376 Heap::RootListIndex root_index) { |
| 6348 start_offset = IntPtrAdd(start_offset, IntPtrConstant(-kHeapObjectTag)); | 6377 start_offset = IntPtrAdd(start_offset, IntPtrConstant(-kHeapObjectTag)); |
| 6349 end_offset = IntPtrAdd(end_offset, IntPtrConstant(-kHeapObjectTag)); | 6378 end_offset = IntPtrAdd(end_offset, IntPtrConstant(-kHeapObjectTag)); |
| 6350 Node* root_value = LoadRoot(root_index); | 6379 Node* root_value = LoadRoot(root_index); |
| 6351 BuildFastLoop(MachineType::PointerRepresentation(), end_offset, start_offset, | 6380 BuildFastLoop(MachineType::PointerRepresentation(), end_offset, start_offset, |
| 6352 [this, object, root_value](Node* current) { | 6381 [this, object, root_value](Node* current) { |
| 6353 StoreNoWriteBarrier(MachineRepresentation::kTagged, object, | 6382 StoreNoWriteBarrier(MachineRepresentation::kTagged, object, |
| 6354 current, root_value); | 6383 current, root_value); |
| (...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8398 formatted.c_str(), TENURED); | 8427 formatted.c_str(), TENURED); |
| 8399 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8428 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
| 8400 HeapConstant(string)); | 8429 HeapConstant(string)); |
| 8401 } | 8430 } |
| 8402 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8431 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
| 8403 #endif | 8432 #endif |
| 8404 } | 8433 } |
| 8405 | 8434 |
| 8406 } // namespace internal | 8435 } // namespace internal |
| 8407 } // namespace v8 | 8436 } // namespace v8 |
| OLD | NEW |