OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 // Clients of this interface shouldn't depend on lots of compiler internals. | 10 // Clients of this interface shouldn't depend on lots of compiler internals. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Macros | 257 // Macros |
258 // =========================================================================== | 258 // =========================================================================== |
259 | 259 |
260 // Tag a Word as a Smi value. | 260 // Tag a Word as a Smi value. |
261 Node* SmiTag(Node* value); | 261 Node* SmiTag(Node* value); |
262 // Untag a Smi value as a Word. | 262 // Untag a Smi value as a Word. |
263 Node* SmiUntag(Node* value); | 263 Node* SmiUntag(Node* value); |
264 | 264 |
265 // Smi conversions. | 265 // Smi conversions. |
266 Node* SmiToFloat64(Node* value); | 266 Node* SmiToFloat64(Node* value); |
267 Node* SmiToInt32(Node* value); | 267 Node* SmiToWord32(Node* value); |
268 | 268 |
269 // Smi operations. | 269 // Smi operations. |
270 Node* SmiAdd(Node* a, Node* b); | 270 Node* SmiAdd(Node* a, Node* b); |
271 Node* SmiAddWithOverflow(Node* a, Node* b); | 271 Node* SmiAddWithOverflow(Node* a, Node* b); |
272 Node* SmiSub(Node* a, Node* b); | 272 Node* SmiSub(Node* a, Node* b); |
273 Node* SmiSubWithOverflow(Node* a, Node* b); | 273 Node* SmiSubWithOverflow(Node* a, Node* b); |
274 Node* SmiEqual(Node* a, Node* b); | 274 Node* SmiEqual(Node* a, Node* b); |
275 Node* SmiLessThan(Node* a, Node* b); | 275 Node* SmiLessThan(Node* a, Node* b); |
276 Node* SmiLessThanOrEqual(Node* a, Node* b); | 276 Node* SmiLessThanOrEqual(Node* a, Node* b); |
277 Node* SmiMin(Node* a, Node* b); | 277 Node* SmiMin(Node* a, Node* b); |
(...skipping 11 matching lines...) Expand all Loading... |
289 Node* LoadBufferObject(Node* buffer, int offset, | 289 Node* LoadBufferObject(Node* buffer, int offset, |
290 MachineType rep = MachineType::AnyTagged()); | 290 MachineType rep = MachineType::AnyTagged()); |
291 // Load a field from an object on the heap. | 291 // Load a field from an object on the heap. |
292 Node* LoadObjectField(Node* object, int offset, | 292 Node* LoadObjectField(Node* object, int offset, |
293 MachineType rep = MachineType::AnyTagged()); | 293 MachineType rep = MachineType::AnyTagged()); |
294 // Load the floating point value of a HeapNumber. | 294 // Load the floating point value of a HeapNumber. |
295 Node* LoadHeapNumberValue(Node* object); | 295 Node* LoadHeapNumberValue(Node* object); |
296 // Store the floating point value of a HeapNumber. | 296 // Store the floating point value of a HeapNumber. |
297 Node* StoreHeapNumberValue(Node* object, Node* value); | 297 Node* StoreHeapNumberValue(Node* object, Node* value); |
298 // Truncate the floating point value of a HeapNumber to an Int32. | 298 // Truncate the floating point value of a HeapNumber to an Int32. |
299 Node* TruncateHeapNumberValueToInt32(Node* object); | 299 Node* TruncateHeapNumberValueToWord32(Node* object); |
300 // Load the bit field of a Map. | 300 // Load the bit field of a Map. |
301 Node* LoadMapBitField(Node* map); | 301 Node* LoadMapBitField(Node* map); |
302 // Load the instance type of a Map. | 302 // Load the instance type of a Map. |
303 Node* LoadMapInstanceType(Node* map); | 303 Node* LoadMapInstanceType(Node* map); |
304 | 304 |
305 // Load an array element from a FixedArray. | 305 // Load an array element from a FixedArray. |
306 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, | 306 Node* LoadFixedArrayElementSmiIndex(Node* object, Node* smi_index, |
307 int additional_offset = 0); | 307 int additional_offset = 0); |
308 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); | 308 Node* LoadFixedArrayElementConstantIndex(Node* object, int index); |
309 | 309 |
(...skipping 17 matching lines...) Expand all Loading... |
327 // Returns a node that is true if the given bit is set in |word32|. | 327 // Returns a node that is true if the given bit is set in |word32|. |
328 template <typename T> | 328 template <typename T> |
329 Node* BitFieldDecode(Node* word32) { | 329 Node* BitFieldDecode(Node* word32) { |
330 return BitFieldDecode(word32, T::kShift, T::kMask); | 330 return BitFieldDecode(word32, T::kShift, T::kMask); |
331 } | 331 } |
332 | 332 |
333 Node* BitFieldDecode(Node* word32, uint32_t shift, uint32_t mask); | 333 Node* BitFieldDecode(Node* word32, uint32_t shift, uint32_t mask); |
334 | 334 |
335 // Conversions. | 335 // Conversions. |
336 Node* ChangeInt32ToTagged(Node* value); | 336 Node* ChangeInt32ToTagged(Node* value); |
| 337 Node* TruncateTaggedToFloat64(Node* context, Node* value); |
| 338 Node* TruncateTaggedToWord32(Node* context, Node* value); |
337 | 339 |
338 // Branching helpers. | 340 // Branching helpers. |
339 // TODO(danno): Can we be more cleverish wrt. edge-split? | 341 // TODO(danno): Can we be more cleverish wrt. edge-split? |
340 void BranchIf(Node* condition, Label* if_true, Label* if_false); | 342 void BranchIf(Node* condition, Label* if_true, Label* if_false); |
341 | 343 |
342 #define BRANCH_HELPER(name) \ | 344 #define BRANCH_HELPER(name) \ |
343 void BranchIf##name(Node* a, Node* b, Label* if_true, Label* if_false) { \ | 345 void BranchIf##name(Node* a, Node* b, Label* if_true, Label* if_false) { \ |
344 BranchIf(name(a, b), if_true, if_false); \ | 346 BranchIf(name(a, b), if_true, if_false); \ |
345 } | 347 } |
346 CODE_STUB_ASSEMBLER_COMPARE_BINARY_OP_LIST(BRANCH_HELPER) | 348 CODE_STUB_ASSEMBLER_COMPARE_BINARY_OP_LIST(BRANCH_HELPER) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 // Map of variables to the list of value nodes that have been added from each | 437 // Map of variables to the list of value nodes that have been added from each |
436 // merge path in their order of merging. | 438 // merge path in their order of merging. |
437 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; | 439 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; |
438 }; | 440 }; |
439 | 441 |
440 } // namespace compiler | 442 } // namespace compiler |
441 } // namespace internal | 443 } // namespace internal |
442 } // namespace v8 | 444 } // namespace v8 |
443 | 445 |
444 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ | 446 #endif // V8_COMPILER_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |