OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 if (attr == ABSENT && IsContextual(object)) { | 1246 if (attr == ABSENT && IsContextual(object)) { |
1247 return ReferenceError("not_defined", name); | 1247 return ReferenceError("not_defined", name); |
1248 } | 1248 } |
1249 return result; | 1249 return result; |
1250 } | 1250 } |
1251 | 1251 |
1252 return object->GetProperty(*object, &lookup, *name, &attr); | 1252 return object->GetProperty(*object, &lookup, *name, &attr); |
1253 } | 1253 } |
1254 | 1254 |
1255 // Do not use ICs for objects that require access checks (including | 1255 // Do not use ICs for objects that require access checks (including |
1256 // the global object). | 1256 // the global object) nor for non-strict arguments objects. |
1257 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); | 1257 bool use_ic = FLAG_use_ic && !object->IsAccessCheckNeeded(); |
| 1258 if (use_ic && object->IsJSObject()) { |
| 1259 Heap* heap = Handle<JSObject>::cast(object)->GetHeap(); |
| 1260 Map* elements_map = Handle<JSObject>::cast(object)->elements()->map(); |
| 1261 use_ic = (elements_map != heap->non_strict_arguments_elements_map()); |
| 1262 } |
1258 | 1263 |
1259 if (use_ic) { | 1264 if (use_ic) { |
1260 Code* stub = generic_stub(); | 1265 Code* stub = generic_stub(); |
1261 if (state == UNINITIALIZED) { | 1266 if (state == UNINITIALIZED) { |
1262 if (object->IsString() && key->IsNumber()) { | 1267 if (object->IsString() && key->IsNumber()) { |
1263 stub = string_stub(); | 1268 stub = string_stub(); |
1264 } else if (object->IsJSObject()) { | 1269 } else if (object->IsJSObject()) { |
1265 Handle<JSObject> receiver = Handle<JSObject>::cast(object); | 1270 Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
1266 if (receiver->HasExternalArrayElements()) { | 1271 if (receiver->HasExternalArrayElements()) { |
1267 MaybeObject* probe = | 1272 MaybeObject* probe = |
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2376 #undef ADDR | 2381 #undef ADDR |
2377 }; | 2382 }; |
2378 | 2383 |
2379 | 2384 |
2380 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2385 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2381 return IC_utilities[id]; | 2386 return IC_utilities[id]; |
2382 } | 2387 } |
2383 | 2388 |
2384 | 2389 |
2385 } } // namespace v8::internal | 2390 } } // namespace v8::internal |
OLD | NEW |