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 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 // PropertyAccessInfo is built for types->first(). | 2455 // PropertyAccessInfo is built for types->first(). |
2456 bool CanAccessAsMonomorphic(SmallMapList* types); | 2456 bool CanAccessAsMonomorphic(SmallMapList* types); |
2457 | 2457 |
2458 bool NeedsWrappingFor(Handle<JSFunction> target) const; | 2458 bool NeedsWrappingFor(Handle<JSFunction> target) const; |
2459 | 2459 |
2460 Handle<Map> map(); | 2460 Handle<Map> map(); |
2461 Handle<String> name() const { return name_; } | 2461 Handle<String> name() const { return name_; } |
2462 | 2462 |
2463 bool IsJSObjectFieldAccessor() { | 2463 bool IsJSObjectFieldAccessor() { |
2464 int offset; // unused | 2464 int offset; // unused |
2465 return Accessors::IsJSObjectFieldAccessor(map(), name_, &offset); | 2465 return Accessors::IsJSObjectFieldAccessor(map_, name_, &offset); |
2466 } | 2466 } |
2467 | 2467 |
2468 bool GetJSObjectFieldAccess(HObjectAccess* access) { | 2468 bool GetJSObjectFieldAccess(HObjectAccess* access) { |
2469 int offset; | 2469 int offset; |
2470 if (Accessors::IsJSObjectFieldAccessor(map(), name_, &offset)) { | 2470 if (Accessors::IsJSObjectFieldAccessor(map_, name_, &offset)) { |
2471 if (IsStringType()) { | 2471 if (IsStringType()) { |
2472 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); | 2472 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
2473 *access = HObjectAccess::ForStringLength(); | 2473 *access = HObjectAccess::ForStringLength(); |
2474 } else if (IsArrayType()) { | 2474 } else if (IsArrayType()) { |
2475 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); | 2475 DCHECK(String::Equals(isolate()->factory()->length_string(), name_)); |
2476 *access = HObjectAccess::ForArrayLength(map()->elements_kind()); | 2476 *access = HObjectAccess::ForArrayLength(map_->elements_kind()); |
2477 } else { | 2477 } else { |
2478 *access = HObjectAccess::ForMapAndOffset(map(), offset); | 2478 *access = HObjectAccess::ForMapAndOffset(map_, offset); |
2479 } | 2479 } |
2480 return true; | 2480 return true; |
2481 } | 2481 } |
2482 return false; | 2482 return false; |
2483 } | 2483 } |
2484 | 2484 |
2485 bool has_holder() { return !holder_.is_null(); } | 2485 bool has_holder() { return !holder_.is_null(); } |
2486 bool IsLoad() const { return access_type_ == LOAD; } | 2486 bool IsLoad() const { return access_type_ == LOAD; } |
2487 | 2487 |
2488 Isolate* isolate() const { return lookup_.isolate(); } | 2488 Isolate* isolate() const { return lookup_.isolate(); } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2917 } | 2917 } |
2918 | 2918 |
2919 private: | 2919 private: |
2920 HGraphBuilder* builder_; | 2920 HGraphBuilder* builder_; |
2921 }; | 2921 }; |
2922 | 2922 |
2923 | 2923 |
2924 } } // namespace v8::internal | 2924 } } // namespace v8::internal |
2925 | 2925 |
2926 #endif // V8_HYDROGEN_H_ | 2926 #endif // V8_HYDROGEN_H_ |
OLD | NEW |