| 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 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 } | 1939 } |
| 1940 | 1940 |
| 1941 GenerateNameCheck(name, &name_miss); | 1941 GenerateNameCheck(name, &name_miss); |
| 1942 | 1942 |
| 1943 // Check that the maps starting from the prototype haven't changed. | 1943 // Check that the maps starting from the prototype haven't changed. |
| 1944 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 1944 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| 1945 Context::STRING_FUNCTION_INDEX, | 1945 Context::STRING_FUNCTION_INDEX, |
| 1946 v0, | 1946 v0, |
| 1947 &miss); | 1947 &miss); |
| 1948 ASSERT(!object.is_identical_to(holder)); | 1948 ASSERT(!object.is_identical_to(holder)); |
| 1949 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 1949 CheckPrototypes( |
| 1950 v0, holder, a1, a3, t0, name, &miss); | 1950 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 1951 v0, holder, a1, a3, t0, name, &miss); |
| 1951 | 1952 |
| 1952 Register receiver = a1; | 1953 Register receiver = a1; |
| 1953 Register index = t1; | 1954 Register index = t1; |
| 1954 Register result = v0; | 1955 Register result = v0; |
| 1955 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); | 1956 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); |
| 1956 if (argc > 0) { | 1957 if (argc > 0) { |
| 1957 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); | 1958 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); |
| 1958 } else { | 1959 } else { |
| 1959 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); | 1960 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); |
| 1960 } | 1961 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2019 index_out_of_range_label = &miss; | 2020 index_out_of_range_label = &miss; |
| 2020 } | 2021 } |
| 2021 GenerateNameCheck(name, &name_miss); | 2022 GenerateNameCheck(name, &name_miss); |
| 2022 | 2023 |
| 2023 // Check that the maps starting from the prototype haven't changed. | 2024 // Check that the maps starting from the prototype haven't changed. |
| 2024 GenerateDirectLoadGlobalFunctionPrototype(masm(), | 2025 GenerateDirectLoadGlobalFunctionPrototype(masm(), |
| 2025 Context::STRING_FUNCTION_INDEX, | 2026 Context::STRING_FUNCTION_INDEX, |
| 2026 v0, | 2027 v0, |
| 2027 &miss); | 2028 &miss); |
| 2028 ASSERT(!object.is_identical_to(holder)); | 2029 ASSERT(!object.is_identical_to(holder)); |
| 2029 CheckPrototypes(Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2030 CheckPrototypes( |
| 2030 v0, holder, a1, a3, t0, name, &miss); | 2031 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2032 v0, holder, a1, a3, t0, name, &miss); |
| 2031 | 2033 |
| 2032 Register receiver = v0; | 2034 Register receiver = v0; |
| 2033 Register index = t1; | 2035 Register index = t1; |
| 2034 Register scratch = a3; | 2036 Register scratch = a3; |
| 2035 Register result = v0; | 2037 Register result = v0; |
| 2036 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); | 2038 __ lw(receiver, MemOperand(sp, argc * kPointerSize)); |
| 2037 if (argc > 0) { | 2039 if (argc > 0) { |
| 2038 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); | 2040 __ lw(index, MemOperand(sp, (argc - 1) * kPointerSize)); |
| 2039 } else { | 2041 } else { |
| 2040 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); | 2042 __ LoadRoot(index, Heap::kUndefinedValueRootIndex); |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 break; | 2478 break; |
| 2477 | 2479 |
| 2478 case STRING_CHECK: | 2480 case STRING_CHECK: |
| 2479 // Check that the object is a two-byte string or a symbol. | 2481 // Check that the object is a two-byte string or a symbol. |
| 2480 __ GetObjectType(a1, a3, a3); | 2482 __ GetObjectType(a1, a3, a3); |
| 2481 __ Branch(&miss, Ugreater_equal, a3, Operand(FIRST_NONSTRING_TYPE)); | 2483 __ Branch(&miss, Ugreater_equal, a3, Operand(FIRST_NONSTRING_TYPE)); |
| 2482 // Check that the maps starting from the prototype haven't changed. | 2484 // Check that the maps starting from the prototype haven't changed. |
| 2483 GenerateDirectLoadGlobalFunctionPrototype( | 2485 GenerateDirectLoadGlobalFunctionPrototype( |
| 2484 masm(), Context::STRING_FUNCTION_INDEX, a0, &miss); | 2486 masm(), Context::STRING_FUNCTION_INDEX, a0, &miss); |
| 2485 CheckPrototypes( | 2487 CheckPrototypes( |
| 2486 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2488 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2487 a0, holder, a3, a1, t0, name, &miss); | 2489 a0, holder, a3, a1, t0, name, &miss); |
| 2488 break; | 2490 break; |
| 2489 | 2491 |
| 2490 case NUMBER_CHECK: { | 2492 case NUMBER_CHECK: { |
| 2491 Label fast; | 2493 Label fast; |
| 2492 // Check that the object is a smi or a heap number. | 2494 // Check that the object is a smi or a heap number. |
| 2493 __ JumpIfSmi(a1, &fast); | 2495 __ JumpIfSmi(a1, &fast); |
| 2494 __ GetObjectType(a1, a0, a0); | 2496 __ GetObjectType(a1, a0, a0); |
| 2495 __ Branch(&miss, ne, a0, Operand(HEAP_NUMBER_TYPE)); | 2497 __ Branch(&miss, ne, a0, Operand(HEAP_NUMBER_TYPE)); |
| 2496 __ bind(&fast); | 2498 __ bind(&fast); |
| 2497 // Check that the maps starting from the prototype haven't changed. | 2499 // Check that the maps starting from the prototype haven't changed. |
| 2498 GenerateDirectLoadGlobalFunctionPrototype( | 2500 GenerateDirectLoadGlobalFunctionPrototype( |
| 2499 masm(), Context::NUMBER_FUNCTION_INDEX, a0, &miss); | 2501 masm(), Context::NUMBER_FUNCTION_INDEX, a0, &miss); |
| 2500 CheckPrototypes( | 2502 CheckPrototypes( |
| 2501 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2503 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2502 a0, holder, a3, a1, t0, name, &miss); | 2504 a0, holder, a3, a1, t0, name, &miss); |
| 2503 break; | 2505 break; |
| 2504 } | 2506 } |
| 2505 case BOOLEAN_CHECK: { | 2507 case BOOLEAN_CHECK: { |
| 2506 Label fast; | 2508 Label fast; |
| 2507 // Check that the object is a boolean. | 2509 // Check that the object is a boolean. |
| 2508 __ LoadRoot(t0, Heap::kTrueValueRootIndex); | 2510 __ LoadRoot(t0, Heap::kTrueValueRootIndex); |
| 2509 __ Branch(&fast, eq, a1, Operand(t0)); | 2511 __ Branch(&fast, eq, a1, Operand(t0)); |
| 2510 __ LoadRoot(t0, Heap::kFalseValueRootIndex); | 2512 __ LoadRoot(t0, Heap::kFalseValueRootIndex); |
| 2511 __ Branch(&miss, ne, a1, Operand(t0)); | 2513 __ Branch(&miss, ne, a1, Operand(t0)); |
| 2512 __ bind(&fast); | 2514 __ bind(&fast); |
| 2513 // Check that the maps starting from the prototype haven't changed. | 2515 // Check that the maps starting from the prototype haven't changed. |
| 2514 GenerateDirectLoadGlobalFunctionPrototype( | 2516 GenerateDirectLoadGlobalFunctionPrototype( |
| 2515 masm(), Context::BOOLEAN_FUNCTION_INDEX, a0, &miss); | 2517 masm(), Context::BOOLEAN_FUNCTION_INDEX, a0, &miss); |
| 2516 CheckPrototypes( | 2518 CheckPrototypes( |
| 2517 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2519 Handle<JSObject>(JSObject::cast(object->GetPrototype(isolate()))), |
| 2518 a0, holder, a3, a1, t0, name, &miss); | 2520 a0, holder, a3, a1, t0, name, &miss); |
| 2519 break; | 2521 break; |
| 2520 } | 2522 } |
| 2521 } | 2523 } |
| 2522 | 2524 |
| 2523 __ jmp(success); | 2525 __ jmp(success); |
| 2524 | 2526 |
| 2525 // Handle call cache miss. | 2527 // Handle call cache miss. |
| 2526 __ bind(&miss); | 2528 __ bind(&miss); |
| 2527 | 2529 |
| (...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4226 __ Jump(ic_slow, RelocInfo::CODE_TARGET); | 4228 __ Jump(ic_slow, RelocInfo::CODE_TARGET); |
| 4227 } | 4229 } |
| 4228 } | 4230 } |
| 4229 | 4231 |
| 4230 | 4232 |
| 4231 #undef __ | 4233 #undef __ |
| 4232 | 4234 |
| 4233 } } // namespace v8::internal | 4235 } } // namespace v8::internal |
| 4234 | 4236 |
| 4235 #endif // V8_TARGET_ARCH_MIPS | 4237 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |