| 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 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 | 2546 |
| 2547 void LookupDescriptor(Map* map, Name* name) { | 2547 void LookupDescriptor(Map* map, Name* name) { |
| 2548 DescriptorArray* descriptors = map->instance_descriptors(); | 2548 DescriptorArray* descriptors = map->instance_descriptors(); |
| 2549 int number = descriptors->SearchWithCache(name, map); | 2549 int number = descriptors->SearchWithCache(name, map); |
| 2550 if (number == DescriptorArray::kNotFound) return NotFound(); | 2550 if (number == DescriptorArray::kNotFound) return NotFound(); |
| 2551 lookup_type_ = DESCRIPTOR_TYPE; | 2551 lookup_type_ = DESCRIPTOR_TYPE; |
| 2552 details_ = descriptors->GetDetails(number); | 2552 details_ = descriptors->GetDetails(number); |
| 2553 number_ = number; | 2553 number_ = number; |
| 2554 } | 2554 } |
| 2555 void LookupTransition(Map* map, Name* name, PropertyAttributes attributes) { | 2555 void LookupTransition(Map* map, Name* name, PropertyAttributes attributes) { |
| 2556 Map* target = | 2556 int transition_index = map->SearchTransition(kData, name, attributes); |
| 2557 TransitionArray::SearchTransition(map, kData, name, attributes); | 2557 if (transition_index == TransitionArray::kNotFound) return NotFound(); |
| 2558 if (target == NULL) return NotFound(); | |
| 2559 lookup_type_ = TRANSITION_TYPE; | 2558 lookup_type_ = TRANSITION_TYPE; |
| 2560 transition_ = handle(target); | 2559 transition_ = handle(map->GetTransition(transition_index)); |
| 2561 number_ = transition_->LastAdded(); | 2560 number_ = transition_->LastAdded(); |
| 2562 details_ = transition_->instance_descriptors()->GetDetails(number_); | 2561 details_ = transition_->instance_descriptors()->GetDetails(number_); |
| 2563 } | 2562 } |
| 2564 void NotFound() { | 2563 void NotFound() { |
| 2565 lookup_type_ = NOT_FOUND; | 2564 lookup_type_ = NOT_FOUND; |
| 2566 details_ = PropertyDetails(NONE, DATA, 0); | 2565 details_ = PropertyDetails(NONE, DATA, 0); |
| 2567 } | 2566 } |
| 2568 Representation representation() const { | 2567 Representation representation() const { |
| 2569 DCHECK(IsFound()); | 2568 DCHECK(IsFound()); |
| 2570 return details_.representation(); | 2569 return details_.representation(); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2964 } | 2963 } |
| 2965 | 2964 |
| 2966 private: | 2965 private: |
| 2967 HGraphBuilder* builder_; | 2966 HGraphBuilder* builder_; |
| 2968 }; | 2967 }; |
| 2969 | 2968 |
| 2970 | 2969 |
| 2971 } } // namespace v8::internal | 2970 } } // namespace v8::internal |
| 2972 | 2971 |
| 2973 #endif // V8_HYDROGEN_H_ | 2972 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |