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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 Label* miss) { | 691 Label* miss) { |
692 ASSERT(holder->HasNamedInterceptor()); | 692 ASSERT(holder->HasNamedInterceptor()); |
693 ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined()); | 693 ASSERT(!holder->GetNamedInterceptor()->getter()->IsUndefined()); |
694 | 694 |
695 // Check that the receiver isn't a smi. | 695 // Check that the receiver isn't a smi. |
696 __ test(receiver, Immediate(kSmiTagMask)); | 696 __ test(receiver, Immediate(kSmiTagMask)); |
697 __ j(zero, miss, not_taken); | 697 __ j(zero, miss, not_taken); |
698 | 698 |
699 CallOptimization optimization(lookup); | 699 CallOptimization optimization(lookup); |
700 | 700 |
701 if (optimization.is_constant_call() && | 701 if (optimization.is_constant_call()) { |
702 !Top::CanHaveSpecialFunctions(holder)) { | |
703 CompileCacheable(masm, | 702 CompileCacheable(masm, |
704 object, | 703 object, |
705 receiver, | 704 receiver, |
706 scratch1, | 705 scratch1, |
707 scratch2, | 706 scratch2, |
708 holder, | 707 holder, |
709 lookup, | 708 lookup, |
710 name, | 709 name, |
711 optimization, | 710 optimization, |
712 miss); | 711 miss); |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 // Check that the maps starting from the prototype haven't changed. | 1325 // Check that the maps starting from the prototype haven't changed. |
1327 GenerateLoadGlobalFunctionPrototype(masm(), | 1326 GenerateLoadGlobalFunctionPrototype(masm(), |
1328 Context::BOOLEAN_FUNCTION_INDEX, | 1327 Context::BOOLEAN_FUNCTION_INDEX, |
1329 eax); | 1328 eax); |
1330 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, | 1329 CheckPrototypes(JSObject::cast(object->GetPrototype()), eax, holder, |
1331 ebx, edx, name, &miss); | 1330 ebx, edx, name, &miss); |
1332 } | 1331 } |
1333 break; | 1332 break; |
1334 } | 1333 } |
1335 | 1334 |
1336 case JSARRAY_HAS_FAST_ELEMENTS_CHECK: | |
1337 CheckPrototypes(JSObject::cast(object), edx, holder, | |
1338 ebx, eax, name, &miss); | |
1339 // Make sure object->HasFastElements(). | |
1340 // Get the elements array of the object. | |
1341 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | |
1342 // Check that the object is in fast mode (not dictionary). | |
1343 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), | |
1344 Immediate(Factory::fixed_array_map())); | |
1345 __ j(not_equal, &miss, not_taken); | |
1346 break; | |
1347 | |
1348 default: | 1335 default: |
1349 UNREACHABLE(); | 1336 UNREACHABLE(); |
1350 } | 1337 } |
1351 | 1338 |
1352 if (depth != kInvalidProtoDepth) { | 1339 if (depth != kInvalidProtoDepth) { |
1353 GenerateFastApiCall(masm(), optimization, argc); | 1340 GenerateFastApiCall(masm(), optimization, argc); |
1354 } else { | 1341 } else { |
1355 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); | 1342 __ InvokeFunction(function, arguments(), JUMP_FUNCTION); |
1356 } | 1343 } |
1357 | 1344 |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 2186 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
2200 | 2187 |
2201 // Return the generated code. | 2188 // Return the generated code. |
2202 return GetCode(); | 2189 return GetCode(); |
2203 } | 2190 } |
2204 | 2191 |
2205 | 2192 |
2206 #undef __ | 2193 #undef __ |
2207 | 2194 |
2208 } } // namespace v8::internal | 2195 } } // namespace v8::internal |
OLD | NEW |