| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
| 6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 HValue* payload); | 1855 HValue* payload); |
| 1856 | 1856 |
| 1857 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); | 1857 HInstruction* BuildConstantMapCheck(Handle<JSObject> constant); |
| 1858 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, | 1858 HInstruction* BuildCheckPrototypeMaps(Handle<JSObject> prototype, |
| 1859 Handle<JSObject> holder); | 1859 Handle<JSObject> holder); |
| 1860 | 1860 |
| 1861 HInstruction* BuildGetNativeContext(HValue* closure); | 1861 HInstruction* BuildGetNativeContext(HValue* closure); |
| 1862 HInstruction* BuildGetNativeContext(); | 1862 HInstruction* BuildGetNativeContext(); |
| 1863 HInstruction* BuildGetScriptContext(int context_index); | 1863 HInstruction* BuildGetScriptContext(int context_index); |
| 1864 HInstruction* BuildGetArrayFunction(); | 1864 HInstruction* BuildGetArrayFunction(); |
| 1865 HValue* BuildArrayBufferViewFieldAccessor(HValue* object, |
| 1866 HValue* checked_object, |
| 1867 FieldIndex index); |
| 1868 |
| 1865 | 1869 |
| 1866 protected: | 1870 protected: |
| 1867 void SetSourcePosition(int position) { | 1871 void SetSourcePosition(int position) { |
| 1868 if (position != RelocInfo::kNoPosition) { | 1872 if (position != RelocInfo::kNoPosition) { |
| 1869 position_.set_position(position - start_position_); | 1873 position_.set_position(position - start_position_); |
| 1870 } | 1874 } |
| 1871 // Otherwise position remains unknown. | 1875 // Otherwise position remains unknown. |
| 1872 } | 1876 } |
| 1873 | 1877 |
| 1874 void EnterInlinedSource(int start_position, int id) { | 1878 void EnterInlinedSource(int start_position, int id) { |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); | 2551 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
| 2548 *access = HObjectAccess::ForArrayLength(map_->elements_kind()); | 2552 *access = HObjectAccess::ForArrayLength(map_->elements_kind()); |
| 2549 } else { | 2553 } else { |
| 2550 *access = HObjectAccess::ForMapAndOffset(map_, offset); | 2554 *access = HObjectAccess::ForMapAndOffset(map_, offset); |
| 2551 } | 2555 } |
| 2552 return true; | 2556 return true; |
| 2553 } | 2557 } |
| 2554 return false; | 2558 return false; |
| 2555 } | 2559 } |
| 2556 | 2560 |
| 2561 bool IsJSArrayBufferViewFieldAccessor() { |
| 2562 int offset; // unused |
| 2563 return Accessors::IsJSArrayBufferViewFieldAccessor(map_, name_, &offset); |
| 2564 } |
| 2565 |
| 2566 bool GetJSArrayBufferViewFieldAccess(HObjectAccess* access) { |
| 2567 int offset; |
| 2568 if (Accessors::IsJSArrayBufferViewFieldAccessor(map_, name_, &offset)) { |
| 2569 *access = HObjectAccess::ForMapAndOffset(map_, offset); |
| 2570 return true; |
| 2571 } |
| 2572 return false; |
| 2573 } |
| 2574 |
| 2557 bool has_holder() { return !holder_.is_null(); } | 2575 bool has_holder() { return !holder_.is_null(); } |
| 2558 bool IsLoad() const { return access_type_ == LOAD; } | 2576 bool IsLoad() const { return access_type_ == LOAD; } |
| 2559 | 2577 |
| 2560 Isolate* isolate() const { return builder_->isolate(); } | 2578 Isolate* isolate() const { return builder_->isolate(); } |
| 2561 Handle<JSObject> holder() { return holder_; } | 2579 Handle<JSObject> holder() { return holder_; } |
| 2562 Handle<JSFunction> accessor() { return accessor_; } | 2580 Handle<JSFunction> accessor() { return accessor_; } |
| 2563 Handle<Object> constant() { return constant_; } | 2581 Handle<Object> constant() { return constant_; } |
| 2564 Handle<Map> transition() { return transition_; } | 2582 Handle<Map> transition() { return transition_; } |
| 2565 SmallMapList* field_maps() { return &field_maps_; } | 2583 SmallMapList* field_maps() { return &field_maps_; } |
| 2566 HType field_type() const { return field_type_; } | 2584 HType field_type() const { return field_type_; } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2671 SmallMapList field_maps_; | 2689 SmallMapList field_maps_; |
| 2672 HType field_type_; | 2690 HType field_type_; |
| 2673 HObjectAccess access_; | 2691 HObjectAccess access_; |
| 2674 | 2692 |
| 2675 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; | 2693 enum { NOT_FOUND, DESCRIPTOR_TYPE, TRANSITION_TYPE } lookup_type_; |
| 2676 Handle<Map> transition_; | 2694 Handle<Map> transition_; |
| 2677 int number_; | 2695 int number_; |
| 2678 PropertyDetails details_; | 2696 PropertyDetails details_; |
| 2679 }; | 2697 }; |
| 2680 | 2698 |
| 2681 HInstruction* BuildMonomorphicAccess(PropertyAccessInfo* info, | 2699 HValue* BuildMonomorphicAccess(PropertyAccessInfo* info, HValue* object, |
| 2682 HValue* object, | 2700 HValue* checked_object, HValue* value, |
| 2683 HValue* checked_object, | 2701 BailoutId ast_id, BailoutId return_id, |
| 2684 HValue* value, | 2702 bool can_inline_accessor = true); |
| 2685 BailoutId ast_id, | |
| 2686 BailoutId return_id, | |
| 2687 bool can_inline_accessor = true); | |
| 2688 | 2703 |
| 2689 HInstruction* BuildNamedAccess(PropertyAccessType access, | 2704 HValue* BuildNamedAccess(PropertyAccessType access, BailoutId ast_id, |
| 2690 BailoutId ast_id, | 2705 BailoutId reutrn_id, Expression* expr, |
| 2691 BailoutId reutrn_id, | 2706 HValue* object, Handle<String> name, HValue* value, |
| 2692 Expression* expr, | 2707 bool is_uninitialized = false); |
| 2693 HValue* object, | |
| 2694 Handle<String> name, | |
| 2695 HValue* value, | |
| 2696 bool is_uninitialized = false); | |
| 2697 | 2708 |
| 2698 void HandlePolymorphicCallNamed(Call* expr, | 2709 void HandlePolymorphicCallNamed(Call* expr, |
| 2699 HValue* receiver, | 2710 HValue* receiver, |
| 2700 SmallMapList* types, | 2711 SmallMapList* types, |
| 2701 Handle<String> name); | 2712 Handle<String> name); |
| 2702 void HandleLiteralCompareTypeof(CompareOperation* expr, | 2713 void HandleLiteralCompareTypeof(CompareOperation* expr, |
| 2703 Expression* sub_expr, | 2714 Expression* sub_expr, |
| 2704 Handle<String> check); | 2715 Handle<String> check); |
| 2705 void HandleLiteralCompareNil(CompareOperation* expr, | 2716 void HandleLiteralCompareNil(CompareOperation* expr, |
| 2706 Expression* sub_expr, | 2717 Expression* sub_expr, |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3036 } | 3047 } |
| 3037 | 3048 |
| 3038 private: | 3049 private: |
| 3039 HGraphBuilder* builder_; | 3050 HGraphBuilder* builder_; |
| 3040 }; | 3051 }; |
| 3041 | 3052 |
| 3042 | 3053 |
| 3043 } } // namespace v8::internal | 3054 } } // namespace v8::internal |
| 3044 | 3055 |
| 3045 #endif // V8_HYDROGEN_H_ | 3056 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |