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_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
7 | 7 |
8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/ast/ast-type-bounds.h" | 10 #include "src/ast/ast-type-bounds.h" |
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 Handle<Object> constant() { return constant_; } | 2507 Handle<Object> constant() { return constant_; } |
2508 Handle<Map> transition() { return transition_; } | 2508 Handle<Map> transition() { return transition_; } |
2509 SmallMapList* field_maps() { return &field_maps_; } | 2509 SmallMapList* field_maps() { return &field_maps_; } |
2510 HType field_type() const { return field_type_; } | 2510 HType field_type() const { return field_type_; } |
2511 HObjectAccess access() { return access_; } | 2511 HObjectAccess access() { return access_; } |
2512 | 2512 |
2513 bool IsFound() const { return lookup_type_ != NOT_FOUND; } | 2513 bool IsFound() const { return lookup_type_ != NOT_FOUND; } |
2514 bool IsProperty() const { return IsFound() && !IsTransition(); } | 2514 bool IsProperty() const { return IsFound() && !IsTransition(); } |
2515 bool IsTransition() const { return lookup_type_ == TRANSITION_TYPE; } | 2515 bool IsTransition() const { return lookup_type_ == TRANSITION_TYPE; } |
2516 bool IsData() const { | 2516 bool IsData() const { |
2517 return lookup_type_ == DESCRIPTOR_TYPE && details_.type() == DATA; | 2517 return lookup_type_ == DESCRIPTOR_TYPE && details_.kind() == kData && |
| 2518 details_.location() == kField; |
2518 } | 2519 } |
2519 bool IsDataConstant() const { | 2520 bool IsDataConstant() const { |
2520 return lookup_type_ == DESCRIPTOR_TYPE && | 2521 return lookup_type_ == DESCRIPTOR_TYPE && details_.kind() == kData && |
2521 details_.type() == DATA_CONSTANT; | 2522 details_.location() == kDescriptor; |
2522 } | 2523 } |
2523 bool IsAccessorConstant() const { | 2524 bool IsAccessorConstant() const { |
2524 return !IsTransition() && details_.type() == ACCESSOR_CONSTANT; | 2525 return !IsTransition() && details_.kind() == kAccessor && |
| 2526 details_.location() == kDescriptor; |
2525 } | 2527 } |
2526 bool IsConfigurable() const { return details_.IsConfigurable(); } | 2528 bool IsConfigurable() const { return details_.IsConfigurable(); } |
2527 bool IsReadOnly() const { return details_.IsReadOnly(); } | 2529 bool IsReadOnly() const { return details_.IsReadOnly(); } |
2528 | 2530 |
2529 bool IsStringType() { return map_->instance_type() < FIRST_NONSTRING_TYPE; } | 2531 bool IsStringType() { return map_->instance_type() < FIRST_NONSTRING_TYPE; } |
2530 bool IsNumberType() { return map_->instance_type() == HEAP_NUMBER_TYPE; } | 2532 bool IsNumberType() { return map_->instance_type() == HEAP_NUMBER_TYPE; } |
2531 bool IsValueWrapped() { return IsStringType() || IsNumberType(); } | 2533 bool IsValueWrapped() { return IsStringType() || IsNumberType(); } |
2532 bool IsArrayType() { return map_->instance_type() == JS_ARRAY_TYPE; } | 2534 bool IsArrayType() { return map_->instance_type() == JS_ARRAY_TYPE; } |
2533 | 2535 |
2534 private: | 2536 private: |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2573 } | 2575 } |
2574 void NotFound() { | 2576 void NotFound() { |
2575 lookup_type_ = NOT_FOUND; | 2577 lookup_type_ = NOT_FOUND; |
2576 details_ = PropertyDetails::Empty(); | 2578 details_ = PropertyDetails::Empty(); |
2577 } | 2579 } |
2578 Representation representation() const { | 2580 Representation representation() const { |
2579 DCHECK(IsFound()); | 2581 DCHECK(IsFound()); |
2580 return details_.representation(); | 2582 return details_.representation(); |
2581 } | 2583 } |
2582 bool IsTransitionToData() const { | 2584 bool IsTransitionToData() const { |
2583 return IsTransition() && details_.type() == DATA; | 2585 return IsTransition() && details_.kind() == kData && |
| 2586 details_.location() == kField; |
2584 } | 2587 } |
2585 | 2588 |
2586 Zone* zone() { return builder_->zone(); } | 2589 Zone* zone() { return builder_->zone(); } |
2587 CompilationInfo* top_info() { return builder_->top_info(); } | 2590 CompilationInfo* top_info() { return builder_->top_info(); } |
2588 CompilationInfo* current_info() { return builder_->current_info(); } | 2591 CompilationInfo* current_info() { return builder_->current_info(); } |
2589 | 2592 |
2590 bool LoadResult(Handle<Map> map); | 2593 bool LoadResult(Handle<Map> map); |
2591 bool LoadFieldMaps(Handle<Map> map); | 2594 bool LoadFieldMaps(Handle<Map> map); |
2592 bool LookupDescriptor(); | 2595 bool LookupDescriptor(); |
2593 bool LookupInPrototypes(); | 2596 bool LookupInPrototypes(); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2979 } | 2982 } |
2980 | 2983 |
2981 private: | 2984 private: |
2982 HOptimizedGraphBuilder* builder_; | 2985 HOptimizedGraphBuilder* builder_; |
2983 }; | 2986 }; |
2984 | 2987 |
2985 } // namespace internal | 2988 } // namespace internal |
2986 } // namespace v8 | 2989 } // namespace v8 |
2987 | 2990 |
2988 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 2991 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |