| 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 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 } | 1867 } |
| 1868 | 1868 |
| 1869 GenerateNameCheck(name, &name_miss); | 1869 GenerateNameCheck(name, &name_miss); |
| 1870 | 1870 |
| 1871 // Check that the maps starting from the prototype haven't changed. | 1871 // Check that the maps starting from the prototype haven't changed. |
| 1872 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 1872 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| 1873 Context::STRING_FUNCTION_INDEX, | 1873 Context::STRING_FUNCTION_INDEX, |
| 1874 eax, | 1874 eax, |
| 1875 &miss); | 1875 &miss); |
| 1876 ASSERT(!object.is_identical_to(holder)); | 1876 ASSERT(!object.is_identical_to(holder)); |
| 1877 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 1877 CheckPrototypes( |
| 1878 eax, holder, ebx, edx, edi, name, &miss); | 1878 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 1879 eax, holder, ebx, edx, edi, name, &miss); |
| 1879 | 1880 |
| 1880 Register receiver = ebx; | 1881 Register receiver = ebx; |
| 1881 Register index = edi; | 1882 Register index = edi; |
| 1882 Register result = eax; | 1883 Register result = eax; |
| 1883 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); | 1884 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); |
| 1884 if (argc > 0) { | 1885 if (argc > 0) { |
| 1885 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); | 1886 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); |
| 1886 } else { | 1887 } else { |
| 1887 __ Set(index, Immediate(factory()->undefined_value())); | 1888 __ Set(index, Immediate(factory()->undefined_value())); |
| 1888 } | 1889 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 } | 1951 } |
| 1951 | 1952 |
| 1952 GenerateNameCheck(name, &name_miss); | 1953 GenerateNameCheck(name, &name_miss); |
| 1953 | 1954 |
| 1954 // Check that the maps starting from the prototype haven't changed. | 1955 // Check that the maps starting from the prototype haven't changed. |
| 1955 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 1956 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| 1956 Context::STRING_FUNCTION_INDEX, | 1957 Context::STRING_FUNCTION_INDEX, |
| 1957 eax, | 1958 eax, |
| 1958 &miss); | 1959 &miss); |
| 1959 ASSERT(!object.is_identical_to(holder)); | 1960 ASSERT(!object.is_identical_to(holder)); |
| 1960 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 1961 CheckPrototypes( |
| 1961 eax, holder, ebx, edx, edi, name, &miss); | 1962 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 1963 eax, holder, ebx, edx, edi, name, &miss); |
| 1962 | 1964 |
| 1963 Register receiver = eax; | 1965 Register receiver = eax; |
| 1964 Register index = edi; | 1966 Register index = edi; |
| 1965 Register scratch = edx; | 1967 Register scratch = edx; |
| 1966 Register result = eax; | 1968 Register result = eax; |
| 1967 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); | 1969 __ mov(receiver, Operand(esp, (argc + 1) * kPointerSize)); |
| 1968 if (argc > 0) { | 1970 if (argc > 0) { |
| 1969 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); | 1971 __ mov(index, Operand(esp, (argc - 0) * kPointerSize)); |
| 1970 } else { | 1972 } else { |
| 1971 __ Set(index, Immediate(factory()->undefined_value())); | 1973 __ Set(index, Immediate(factory()->undefined_value())); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2415 break; | 2417 break; |
| 2416 | 2418 |
| 2417 case STRING_CHECK: | 2419 case STRING_CHECK: |
| 2418 // Check that the object is a string or a symbol. | 2420 // Check that the object is a string or a symbol. |
| 2419 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); | 2421 __ CmpObjectType(edx, FIRST_NONSTRING_TYPE, eax); |
| 2420 __ j(above_equal, &miss); | 2422 __ j(above_equal, &miss); |
| 2421 // Check that the maps starting from the prototype haven't changed. | 2423 // Check that the maps starting from the prototype haven't changed. |
| 2422 GenerateDirectLoadGlobalFunctionPrototype( | 2424 GenerateDirectLoadGlobalFunctionPrototype( |
| 2423 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); | 2425 masm(), Context::STRING_FUNCTION_INDEX, eax, &miss); |
| 2424 CheckPrototypes( | 2426 CheckPrototypes( |
| 2425 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2427 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2426 eax, holder, ebx, edx, edi, name, &miss); | 2428 eax, holder, ebx, edx, edi, name, &miss); |
| 2427 break; | 2429 break; |
| 2428 | 2430 |
| 2429 case NUMBER_CHECK: { | 2431 case NUMBER_CHECK: { |
| 2430 Label fast; | 2432 Label fast; |
| 2431 // Check that the object is a smi or a heap number. | 2433 // Check that the object is a smi or a heap number. |
| 2432 __ JumpIfSmi(edx, &fast); | 2434 __ JumpIfSmi(edx, &fast); |
| 2433 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); | 2435 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, eax); |
| 2434 __ j(not_equal, &miss); | 2436 __ j(not_equal, &miss); |
| 2435 __ bind(&fast); | 2437 __ bind(&fast); |
| 2436 // Check that the maps starting from the prototype haven't changed. | 2438 // Check that the maps starting from the prototype haven't changed. |
| 2437 GenerateDirectLoadGlobalFunctionPrototype( | 2439 GenerateDirectLoadGlobalFunctionPrototype( |
| 2438 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); | 2440 masm(), Context::NUMBER_FUNCTION_INDEX, eax, &miss); |
| 2439 CheckPrototypes( | 2441 CheckPrototypes( |
| 2440 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2442 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2441 eax, holder, ebx, edx, edi, name, &miss); | 2443 eax, holder, ebx, edx, edi, name, &miss); |
| 2442 break; | 2444 break; |
| 2443 } | 2445 } |
| 2444 case BOOLEAN_CHECK: { | 2446 case BOOLEAN_CHECK: { |
| 2445 Label fast; | 2447 Label fast; |
| 2446 // Check that the object is a boolean. | 2448 // Check that the object is a boolean. |
| 2447 __ cmp(edx, factory()->true_value()); | 2449 __ cmp(edx, factory()->true_value()); |
| 2448 __ j(equal, &fast); | 2450 __ j(equal, &fast); |
| 2449 __ cmp(edx, factory()->false_value()); | 2451 __ cmp(edx, factory()->false_value()); |
| 2450 __ j(not_equal, &miss); | 2452 __ j(not_equal, &miss); |
| 2451 __ bind(&fast); | 2453 __ bind(&fast); |
| 2452 // Check that the maps starting from the prototype haven't changed. | 2454 // Check that the maps starting from the prototype haven't changed. |
| 2453 GenerateDirectLoadGlobalFunctionPrototype( | 2455 GenerateDirectLoadGlobalFunctionPrototype( |
| 2454 masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss); | 2456 masm(), Context::BOOLEAN_FUNCTION_INDEX, eax, &miss); |
| 2455 CheckPrototypes( | 2457 CheckPrototypes( |
| 2456 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2458 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2457 eax, holder, ebx, edx, edi, name, &miss); | 2459 eax, holder, ebx, edx, edi, name, &miss); |
| 2458 break; | 2460 break; |
| 2459 } | 2461 } |
| 2460 } | 2462 } |
| 2461 | 2463 |
| 2462 __ jmp(success); | 2464 __ jmp(success); |
| 2463 | 2465 |
| 2464 // Handle call cache miss. | 2466 // Handle call cache miss. |
| 2465 __ bind(&miss); | 2467 __ bind(&miss); |
| 2466 GenerateMissBranch(); | 2468 GenerateMissBranch(); |
| (...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3925 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 3927 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 3926 } | 3928 } |
| 3927 } | 3929 } |
| 3928 | 3930 |
| 3929 | 3931 |
| 3930 #undef __ | 3932 #undef __ |
| 3931 | 3933 |
| 3932 } } // namespace v8::internal | 3934 } } // namespace v8::internal |
| 3933 | 3935 |
| 3934 #endif // V8_TARGET_ARCH_IA32 | 3936 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |