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 #include "src/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 2606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2617 Node* cache_type = __ LoadRegister(cache_type_reg); | 2617 Node* cache_type = __ LoadRegister(cache_type_reg); |
2618 Node* cache_array_reg = __ NextRegister(cache_type_reg); | 2618 Node* cache_array_reg = __ NextRegister(cache_type_reg); |
2619 Node* cache_array = __ LoadRegister(cache_array_reg); | 2619 Node* cache_array = __ LoadRegister(cache_array_reg); |
2620 | 2620 |
2621 // Load the next key from the enumeration array. | 2621 // Load the next key from the enumeration array. |
2622 Node* key = __ LoadFixedArrayElement(cache_array, index, 0, | 2622 Node* key = __ LoadFixedArrayElement(cache_array, index, 0, |
2623 CodeStubAssembler::SMI_PARAMETERS); | 2623 CodeStubAssembler::SMI_PARAMETERS); |
2624 | 2624 |
2625 // Check if we can use the for-in fast path potentially using the enum cache. | 2625 // Check if we can use the for-in fast path potentially using the enum cache. |
2626 Label if_fast(assembler), if_slow(assembler, Label::kDeferred); | 2626 Label if_fast(assembler), if_slow(assembler, Label::kDeferred); |
2627 Node* receiver_map = __ LoadObjectField(receiver, HeapObject::kMapOffset); | 2627 Node* receiver_map = __ LoadMap(receiver); |
2628 __ Branch(__ WordEqual(receiver_map, cache_type), &if_fast, &if_slow); | 2628 __ Branch(__ WordEqual(receiver_map, cache_type), &if_fast, &if_slow); |
2629 __ Bind(&if_fast); | 2629 __ Bind(&if_fast); |
2630 { | 2630 { |
2631 // Enum cache in use for {receiver}, the {key} is definitely valid. | 2631 // Enum cache in use for {receiver}, the {key} is definitely valid. |
2632 __ SetAccumulator(key); | 2632 __ SetAccumulator(key); |
2633 __ Dispatch(); | 2633 __ Dispatch(); |
2634 } | 2634 } |
2635 __ Bind(&if_slow); | 2635 __ Bind(&if_slow); |
2636 { | 2636 { |
2637 // Record the fact that we hit the for-in slow path. | 2637 // Record the fact that we hit the for-in slow path. |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2777 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2777 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2778 __ SmiTag(new_state)); | 2778 __ SmiTag(new_state)); |
2779 __ SetAccumulator(old_state); | 2779 __ SetAccumulator(old_state); |
2780 | 2780 |
2781 __ Dispatch(); | 2781 __ Dispatch(); |
2782 } | 2782 } |
2783 | 2783 |
2784 } // namespace interpreter | 2784 } // namespace interpreter |
2785 } // namespace internal | 2785 } // namespace internal |
2786 } // namespace v8 | 2786 } // namespace v8 |
OLD | NEW |