OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 // an instance of any of the types. | 2284 // an instance of any of the types. |
2285 // This method skips the first type in types, assuming that this | 2285 // This method skips the first type in types, assuming that this |
2286 // PropertyAccessInfo is built for types->first(). | 2286 // PropertyAccessInfo is built for types->first(). |
2287 bool CanLoadAsMonomorphic(SmallMapList* types); | 2287 bool CanLoadAsMonomorphic(SmallMapList* types); |
2288 | 2288 |
2289 Handle<Map> map() { | 2289 Handle<Map> map() { |
2290 if (type_->Is(HeapType::Number())) { | 2290 if (type_->Is(HeapType::Number())) { |
2291 Context* context = current_info()->closure()->context(); | 2291 Context* context = current_info()->closure()->context(); |
2292 context = context->native_context(); | 2292 context = context->native_context(); |
2293 return handle(context->number_function()->initial_map()); | 2293 return handle(context->number_function()->initial_map()); |
| 2294 } else if (type_->Is(HeapType::Boolean())) { |
| 2295 Context* context = current_info()->closure()->context(); |
| 2296 context = context->native_context(); |
| 2297 return handle(context->boolean_function()->initial_map()); |
2294 } else if (type_->Is(HeapType::String())) { | 2298 } else if (type_->Is(HeapType::String())) { |
2295 Context* context = current_info()->closure()->context(); | 2299 Context* context = current_info()->closure()->context(); |
2296 context = context->native_context(); | 2300 context = context->native_context(); |
2297 return handle(context->string_function()->initial_map()); | 2301 return handle(context->string_function()->initial_map()); |
2298 } else { | 2302 } else { |
2299 return type_->AsClass(); | 2303 return type_->AsClass(); |
2300 } | 2304 } |
2301 } | 2305 } |
2302 Handle<HeapType> type() const { return type_; } | 2306 Handle<HeapType> type() const { return type_; } |
2303 Handle<String> name() const { return name_; } | 2307 Handle<String> name() const { return name_; } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 } | 2716 } |
2713 | 2717 |
2714 private: | 2718 private: |
2715 HGraphBuilder* builder_; | 2719 HGraphBuilder* builder_; |
2716 }; | 2720 }; |
2717 | 2721 |
2718 | 2722 |
2719 } } // namespace v8::internal | 2723 } } // namespace v8::internal |
2720 | 2724 |
2721 #endif // V8_HYDROGEN_H_ | 2725 #endif // V8_HYDROGEN_H_ |
OLD | NEW |