| 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 2437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 CheckPrototypes(object, eax, last, ebx, edx, edi, name, &miss); | 2448 CheckPrototypes(object, eax, last, ebx, edx, edi, name, &miss); |
| 2449 | 2449 |
| 2450 // If the last object in the prototype chain is a global object, | 2450 // If the last object in the prototype chain is a global object, |
| 2451 // check that the global property cell is empty. | 2451 // check that the global property cell is empty. |
| 2452 if (last->IsGlobalObject()) { | 2452 if (last->IsGlobalObject()) { |
| 2453 Object* cell = GenerateCheckPropertyCell(masm(), | 2453 Object* cell = GenerateCheckPropertyCell(masm(), |
| 2454 GlobalObject::cast(last), | 2454 GlobalObject::cast(last), |
| 2455 name, | 2455 name, |
| 2456 edx, | 2456 edx, |
| 2457 &miss); | 2457 &miss); |
| 2458 if (cell->IsFailure()) return cell; | 2458 if (cell->IsFailure()) { |
| 2459 miss.Unuse(); |
| 2460 return cell; |
| 2461 } |
| 2459 } | 2462 } |
| 2460 | 2463 |
| 2461 // Return undefined if maps of the full prototype chain are still the | 2464 // Return undefined if maps of the full prototype chain are still the |
| 2462 // same and no global property with this name contains a value. | 2465 // same and no global property with this name contains a value. |
| 2463 __ mov(eax, Factory::undefined_value()); | 2466 __ mov(eax, Factory::undefined_value()); |
| 2464 __ ret(0); | 2467 __ ret(0); |
| 2465 | 2468 |
| 2466 __ bind(&miss); | 2469 __ bind(&miss); |
| 2467 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2470 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2468 | 2471 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2498 // ----------- S t a t e ------------- | 2501 // ----------- S t a t e ------------- |
| 2499 // -- eax : receiver | 2502 // -- eax : receiver |
| 2500 // -- ecx : name | 2503 // -- ecx : name |
| 2501 // -- esp[0] : return address | 2504 // -- esp[0] : return address |
| 2502 // ----------------------------------- | 2505 // ----------------------------------- |
| 2503 Label miss; | 2506 Label miss; |
| 2504 | 2507 |
| 2505 Failure* failure = Failure::InternalError(); | 2508 Failure* failure = Failure::InternalError(); |
| 2506 bool success = GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, edi, | 2509 bool success = GenerateLoadCallback(object, holder, eax, ecx, ebx, edx, edi, |
| 2507 callback, name, &miss, &failure); | 2510 callback, name, &miss, &failure); |
| 2508 if (!success) return failure; | 2511 if (!success) { |
| 2512 miss.Unuse(); |
| 2513 return failure; |
| 2514 } |
| 2509 | 2515 |
| 2510 __ bind(&miss); | 2516 __ bind(&miss); |
| 2511 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2517 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2512 | 2518 |
| 2513 // Return the generated code. | 2519 // Return the generated code. |
| 2514 return GetCode(CALLBACKS, name); | 2520 return GetCode(CALLBACKS, name); |
| 2515 } | 2521 } |
| 2516 | 2522 |
| 2517 | 2523 |
| 2518 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, | 2524 Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 | 2665 |
| 2660 __ IncrementCounter(&Counters::keyed_load_callback, 1); | 2666 __ IncrementCounter(&Counters::keyed_load_callback, 1); |
| 2661 | 2667 |
| 2662 // Check that the name has not changed. | 2668 // Check that the name has not changed. |
| 2663 __ cmp(Operand(eax), Immediate(Handle<String>(name))); | 2669 __ cmp(Operand(eax), Immediate(Handle<String>(name))); |
| 2664 __ j(not_equal, &miss, not_taken); | 2670 __ j(not_equal, &miss, not_taken); |
| 2665 | 2671 |
| 2666 Failure* failure = Failure::InternalError(); | 2672 Failure* failure = Failure::InternalError(); |
| 2667 bool success = GenerateLoadCallback(receiver, holder, edx, eax, ebx, ecx, edi, | 2673 bool success = GenerateLoadCallback(receiver, holder, edx, eax, ebx, ecx, edi, |
| 2668 callback, name, &miss, &failure); | 2674 callback, name, &miss, &failure); |
| 2669 if (!success) return failure; | 2675 if (!success) { |
| 2676 miss.Unuse(); |
| 2677 return failure; |
| 2678 } |
| 2670 | 2679 |
| 2671 __ bind(&miss); | 2680 __ bind(&miss); |
| 2681 |
| 2672 __ DecrementCounter(&Counters::keyed_load_callback, 1); | 2682 __ DecrementCounter(&Counters::keyed_load_callback, 1); |
| 2673 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 2683 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 2674 | 2684 |
| 2675 // Return the generated code. | 2685 // Return the generated code. |
| 2676 return GetCode(CALLBACKS, name); | 2686 return GetCode(CALLBACKS, name); |
| 2677 } | 2687 } |
| 2678 | 2688 |
| 2679 | 2689 |
| 2680 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | 2690 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
| 2681 JSObject* receiver, | 2691 JSObject* receiver, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2951 // Return the generated code. | 2961 // Return the generated code. |
| 2952 return GetCode(); | 2962 return GetCode(); |
| 2953 } | 2963 } |
| 2954 | 2964 |
| 2955 | 2965 |
| 2956 #undef __ | 2966 #undef __ |
| 2957 | 2967 |
| 2958 } } // namespace v8::internal | 2968 } } // namespace v8::internal |
| 2959 | 2969 |
| 2960 #endif // V8_TARGET_ARCH_IA32 | 2970 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |