| 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 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 *access = HObjectAccess::ForStringLength(); | 2331 *access = HObjectAccess::ForStringLength(); |
| 2332 } else { | 2332 } else { |
| 2333 *access = HObjectAccess::ForMapAndOffset(map(), offset); | 2333 *access = HObjectAccess::ForMapAndOffset(map(), offset); |
| 2334 } | 2334 } |
| 2335 return true; | 2335 return true; |
| 2336 } | 2336 } |
| 2337 return false; | 2337 return false; |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 bool has_holder() { return !holder_.is_null(); } | 2340 bool has_holder() { return !holder_.is_null(); } |
| 2341 bool IsLoad() const { return access_type_ == LOAD; } |
| 2341 | 2342 |
| 2342 LookupResult* lookup() { return &lookup_; } | 2343 LookupResult* lookup() { return &lookup_; } |
| 2343 Handle<JSObject> holder() { return holder_; } | 2344 Handle<JSObject> holder() { return holder_; } |
| 2344 Handle<JSFunction> accessor() { return accessor_; } | 2345 Handle<JSFunction> accessor() { return accessor_; } |
| 2345 Handle<Object> constant() { return constant_; } | 2346 Handle<Object> constant() { return constant_; } |
| 2346 Handle<Object> transition() { return transition_; } | 2347 Handle<Object> transition() { return transition_; } |
| 2347 HObjectAccess access() { return access_; } | 2348 HObjectAccess access() { return access_; } |
| 2348 | 2349 |
| 2349 private: | 2350 private: |
| 2350 Type* ToType(Handle<Map> map) { return builder_->ToType(map); } | 2351 Type* ToType(Handle<Map> map) { return builder_->ToType(map); } |
| 2351 Isolate* isolate() { return lookup_.isolate(); } | 2352 Isolate* isolate() { return lookup_.isolate(); } |
| 2352 CompilationInfo* current_info() { return builder_->current_info(); } | 2353 CompilationInfo* current_info() { return builder_->current_info(); } |
| 2353 | 2354 |
| 2354 bool IsArrayLength() { | 2355 bool IsArrayLength() { |
| 2355 return map()->instance_type() == JS_ARRAY_TYPE && | 2356 return map()->instance_type() == JS_ARRAY_TYPE && |
| 2356 name_->Equals(isolate()->heap()->length_string()); | 2357 name_->Equals(isolate()->heap()->length_string()); |
| 2357 } | 2358 } |
| 2358 | 2359 |
| 2359 bool LoadResult(Handle<Map> map); | 2360 bool LoadResult(Handle<Map> map); |
| 2360 bool LookupDescriptor(); | 2361 bool LookupDescriptor(); |
| 2361 bool LookupInPrototypes(); | 2362 bool LookupInPrototypes(); |
| 2362 bool IsCompatible(PropertyAccessInfo* other); | 2363 bool IsCompatible(PropertyAccessInfo* other); |
| 2363 bool IsLoad() const { return access_type_ == LOAD; } | |
| 2364 | 2364 |
| 2365 void GeneralizeRepresentation(Representation r) { | 2365 void GeneralizeRepresentation(Representation r) { |
| 2366 access_ = access_.WithRepresentation( | 2366 access_ = access_.WithRepresentation( |
| 2367 access_.representation().generalize(r)); | 2367 access_.representation().generalize(r)); |
| 2368 } | 2368 } |
| 2369 | 2369 |
| 2370 LookupResult lookup_; | 2370 LookupResult lookup_; |
| 2371 HOptimizedGraphBuilder* builder_; | 2371 HOptimizedGraphBuilder* builder_; |
| 2372 PropertyAccessType access_type_; | 2372 PropertyAccessType access_type_; |
| 2373 Type* type_; | 2373 Type* type_; |
| 2374 Handle<String> name_; | 2374 Handle<String> name_; |
| 2375 Handle<JSObject> holder_; | 2375 Handle<JSObject> holder_; |
| 2376 Handle<JSFunction> accessor_; | 2376 Handle<JSFunction> accessor_; |
| 2377 Handle<Object> constant_; | 2377 Handle<Object> constant_; |
| 2378 Handle<Map> transition_; | 2378 Handle<Map> transition_; |
| 2379 HObjectAccess access_; | 2379 HObjectAccess access_; |
| 2380 }; | 2380 }; |
| 2381 | 2381 |
| 2382 HInstruction* BuildLoadMonomorphic(PropertyAccessInfo* info, | 2382 HInstruction* BuildMonomorphicAccess(PropertyAccessInfo* info, |
| 2383 HValue* object, | 2383 HValue* object, |
| 2384 HValue* checked_object, | 2384 HValue* checked_object, |
| 2385 BailoutId ast_id, | 2385 HValue* value, |
| 2386 BailoutId return_id, | 2386 BailoutId ast_id, |
| 2387 bool can_inline_accessor = true); | 2387 BailoutId return_id, |
| 2388 | 2388 bool can_inline_accessor = true); |
| 2389 HInstruction* BuildStoreMonomorphic(PropertyAccessInfo* info, | |
| 2390 HValue* checked_object, | |
| 2391 HValue* value, | |
| 2392 BailoutId ast_id, | |
| 2393 BailoutId return_id, | |
| 2394 bool can_inline_accessor = true); | |
| 2395 | 2389 |
| 2396 void HandlePolymorphicCallNamed(Call* expr, | 2390 void HandlePolymorphicCallNamed(Call* expr, |
| 2397 HValue* receiver, | 2391 HValue* receiver, |
| 2398 SmallMapList* types, | 2392 SmallMapList* types, |
| 2399 Handle<String> name); | 2393 Handle<String> name); |
| 2400 void HandleLiteralCompareTypeof(CompareOperation* expr, | 2394 void HandleLiteralCompareTypeof(CompareOperation* expr, |
| 2401 Expression* sub_expr, | 2395 Expression* sub_expr, |
| 2402 Handle<String> check); | 2396 Handle<String> check); |
| 2403 void HandleLiteralCompareNil(CompareOperation* expr, | 2397 void HandleLiteralCompareNil(CompareOperation* expr, |
| 2404 Expression* sub_expr, | 2398 Expression* sub_expr, |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2721 } | 2715 } |
| 2722 | 2716 |
| 2723 private: | 2717 private: |
| 2724 HGraphBuilder* builder_; | 2718 HGraphBuilder* builder_; |
| 2725 }; | 2719 }; |
| 2726 | 2720 |
| 2727 | 2721 |
| 2728 } } // namespace v8::internal | 2722 } } // namespace v8::internal |
| 2729 | 2723 |
| 2730 #endif // V8_HYDROGEN_H_ | 2724 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |