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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 return ReferenceError("not_defined", name); | 321 return ReferenceError("not_defined", name); |
322 } | 322 } |
323 return TypeError("undefined_method", object, name); | 323 return TypeError("undefined_method", object, name); |
324 } | 324 } |
325 | 325 |
326 // Lookup is valid: Update inline cache and stub cache. | 326 // Lookup is valid: Update inline cache and stub cache. |
327 if (FLAG_use_ic && lookup.IsLoaded()) { | 327 if (FLAG_use_ic && lookup.IsLoaded()) { |
328 UpdateCaches(&lookup, state, object, name); | 328 UpdateCaches(&lookup, state, object, name); |
329 } | 329 } |
330 | 330 |
| 331 // Get the property. |
| 332 PropertyAttributes attr; |
| 333 result = object->GetProperty(*object, &lookup, *name, &attr); |
| 334 if (result->IsFailure()) return result; |
331 if (lookup.type() == INTERCEPTOR) { | 335 if (lookup.type() == INTERCEPTOR) { |
332 // Get the property. | |
333 PropertyAttributes attr; | |
334 result = object->GetProperty(*name, &attr); | |
335 if (result->IsFailure()) return result; | |
336 // If the object does not have the requested property, check which | 336 // If the object does not have the requested property, check which |
337 // exception we need to throw. | 337 // exception we need to throw. |
338 if (attr == ABSENT) { | 338 if (attr == ABSENT) { |
339 if (is_contextual()) { | 339 if (is_contextual()) { |
340 return ReferenceError("not_defined", name); | 340 return ReferenceError("not_defined", name); |
341 } | 341 } |
342 return TypeError("undefined_method", object, name); | 342 return TypeError("undefined_method", object, name); |
343 } | 343 } |
344 } else { | |
345 // Lookup is valid and no interceptors are involved. Get the | |
346 // property. | |
347 result = object->GetProperty(*name); | |
348 if (result->IsFailure()) return result; | |
349 } | 344 } |
350 | 345 |
351 ASSERT(result != Heap::the_hole_value()); | 346 ASSERT(result != Heap::the_hole_value()); |
352 | 347 |
353 if (result->IsJSFunction()) { | 348 if (result->IsJSFunction()) { |
354 // Check if there is an optimized (builtin) version of the function. | 349 // Check if there is an optimized (builtin) version of the function. |
355 // Ignored this will degrade performance for Array.prototype.{push,pop}. | 350 // Ignored this will degrade performance for Array.prototype.{push,pop}. |
356 // Please note we only return the optimized function iff | 351 // Please note we only return the optimized function iff |
357 // the JSObject has FastElements. | 352 // the JSObject has FastElements. |
358 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { | 353 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 #undef ADDR | 1318 #undef ADDR |
1324 }; | 1319 }; |
1325 | 1320 |
1326 | 1321 |
1327 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1322 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1328 return IC_utilities[id]; | 1323 return IC_utilities[id]; |
1329 } | 1324 } |
1330 | 1325 |
1331 | 1326 |
1332 } } // namespace v8::internal | 1327 } } // namespace v8::internal |
OLD | NEW |