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 5381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5392 } | 5392 } |
5393 return ast_context()->ReturnValue(Pop()); | 5393 return ast_context()->ReturnValue(Pop()); |
5394 } | 5394 } |
5395 | 5395 |
5396 | 5396 |
5397 // Sets the lookup result and returns true if the load/store can be inlined. | 5397 // Sets the lookup result and returns true if the load/store can be inlined. |
5398 static bool ComputeLoadStoreField(Handle<Map> type, | 5398 static bool ComputeLoadStoreField(Handle<Map> type, |
5399 Handle<String> name, | 5399 Handle<String> name, |
5400 LookupResult* lookup, | 5400 LookupResult* lookup, |
5401 bool is_store) { | 5401 bool is_store) { |
| 5402 if (type->has_named_interceptor()) { |
| 5403 lookup->InterceptorResult(NULL); |
| 5404 return false; |
| 5405 } |
5402 // If we directly find a field, the access can be inlined. | 5406 // If we directly find a field, the access can be inlined. |
5403 type->LookupDescriptor(NULL, *name, lookup); | 5407 type->LookupDescriptor(NULL, *name, lookup); |
5404 if (lookup->IsField()) return true; | 5408 if (lookup->IsField()) return true; |
5405 | 5409 |
5406 // For a load, we are out of luck if there is no such field. | 5410 // For a load, we are out of luck if there is no such field. |
5407 if (!is_store) return false; | 5411 if (!is_store) return false; |
5408 | 5412 |
5409 // 2nd chance: A store into a non-existent field can still be inlined if we | 5413 // 2nd chance: A store into a non-existent field can still be inlined if we |
5410 // have a matching transition and some room left in the object. | 5414 // have a matching transition and some room left in the object. |
5411 type->LookupTransition(NULL, *name, lookup); | 5415 type->LookupTransition(NULL, *name, lookup); |
(...skipping 4785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10197 } | 10201 } |
10198 } | 10202 } |
10199 | 10203 |
10200 #ifdef DEBUG | 10204 #ifdef DEBUG |
10201 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10205 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10202 if (allocator_ != NULL) allocator_->Verify(); | 10206 if (allocator_ != NULL) allocator_->Verify(); |
10203 #endif | 10207 #endif |
10204 } | 10208 } |
10205 | 10209 |
10206 } } // namespace v8::internal | 10210 } } // namespace v8::internal |
OLD | NEW |