OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // Check that the receiver is a valid JS object. | 462 // Check that the receiver is a valid JS object. |
463 __ mov(eax, FieldOperand(edx, HeapObject::kMapOffset)); | 463 __ mov(eax, FieldOperand(edx, HeapObject::kMapOffset)); |
464 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); | 464 __ movzx_b(eax, FieldOperand(eax, Map::kInstanceTypeOffset)); |
465 __ cmp(eax, FIRST_JS_OBJECT_TYPE); | 465 __ cmp(eax, FIRST_JS_OBJECT_TYPE); |
466 __ j(less, &miss, not_taken); | 466 __ j(less, &miss, not_taken); |
467 | 467 |
468 // If this assert fails, we have to check upper bound too. | 468 // If this assert fails, we have to check upper bound too. |
469 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); | 469 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); |
470 | 470 |
471 // Check for access to global object. | 471 // Check for access to global object. |
472 __ cmp(eax, JS_GLOBAL_OBJECT_TYPE); | 472 __ cmp(eax, JS_GLOBAL_PROXY_TYPE); |
473 __ j(equal, &global, not_taken); | 473 __ j(equal, &global, not_taken); |
474 | 474 |
475 // Search the dictionary placing the result in edx. | 475 // Search the dictionary placing the result in edx. |
476 __ bind(&probe); | 476 __ bind(&probe); |
477 GenerateDictionaryLoad(masm, &miss, eax, edx, ebx, ecx); | 477 GenerateDictionaryLoad(masm, &miss, eax, edx, ebx, ecx); |
478 | 478 |
479 // Move the result to register edi and check that it isn't a smi. | 479 // Move the result to register edi and check that it isn't a smi. |
480 __ mov(edi, Operand(edx)); | 480 __ mov(edi, Operand(edx)); |
481 __ test(edx, Immediate(kSmiTagMask)); | 481 __ test(edx, Immediate(kSmiTagMask)); |
482 __ j(zero, &miss, not_taken); | 482 __ j(zero, &miss, not_taken); |
483 | 483 |
484 // Check that the value is a JavaScript function. | 484 // Check that the value is a JavaScript function. |
485 __ mov(edx, FieldOperand(edx, HeapObject::kMapOffset)); | 485 __ mov(edx, FieldOperand(edx, HeapObject::kMapOffset)); |
486 __ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset)); | 486 __ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset)); |
487 __ cmp(edx, JS_FUNCTION_TYPE); | 487 __ cmp(edx, JS_FUNCTION_TYPE); |
488 __ j(not_equal, &miss, not_taken); | 488 __ j(not_equal, &miss, not_taken); |
489 | 489 |
490 // Invoke the function. | 490 // Invoke the function. |
491 ParameterCount actual(argc); | 491 ParameterCount actual(argc); |
492 __ InvokeFunction(edi, actual, JUMP_FUNCTION); | 492 __ InvokeFunction(edi, actual, JUMP_FUNCTION); |
493 | 493 |
494 // Global object access: Check access rights. | 494 // Global object access: Check access rights. |
495 __ bind(&global); | 495 __ bind(&global); |
496 __ CheckAccessGlobal(edx, eax, &miss); | 496 __ CheckAccessGlobalProxy(edx, eax, &miss); |
497 __ jmp(&probe); | 497 __ jmp(&probe); |
498 | 498 |
499 // Cache miss: Jump to runtime. | 499 // Cache miss: Jump to runtime. |
500 __ bind(&miss); | 500 __ bind(&miss); |
501 Generate(masm, argc, ExternalReference(IC_Utility(kCallIC_Miss))); | 501 Generate(masm, argc, ExternalReference(IC_Utility(kCallIC_Miss))); |
502 } | 502 } |
503 | 503 |
504 | 504 |
505 void CallIC::Generate(MacroAssembler* masm, | 505 void CallIC::Generate(MacroAssembler* masm, |
506 int argc, | 506 int argc, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // Check that the receiver is a valid JS object. | 576 // Check that the receiver is a valid JS object. |
577 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); | 577 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); |
578 __ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset)); | 578 __ movzx_b(edx, FieldOperand(edx, Map::kInstanceTypeOffset)); |
579 __ cmp(edx, FIRST_JS_OBJECT_TYPE); | 579 __ cmp(edx, FIRST_JS_OBJECT_TYPE); |
580 __ j(less, &miss, not_taken); | 580 __ j(less, &miss, not_taken); |
581 | 581 |
582 // If this assert fails, we have to check upper bound too. | 582 // If this assert fails, we have to check upper bound too. |
583 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); | 583 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); |
584 | 584 |
585 // Check for access to global object (unlikely). | 585 // Check for access to global object (unlikely). |
586 __ cmp(edx, JS_GLOBAL_OBJECT_TYPE); | 586 __ cmp(edx, JS_GLOBAL_PROXY_TYPE); |
587 __ j(equal, &global, not_taken); | 587 __ j(equal, &global, not_taken); |
588 | 588 |
589 // Search the dictionary placing the result in eax. | 589 // Search the dictionary placing the result in eax. |
590 __ bind(&probe); | 590 __ bind(&probe); |
591 GenerateDictionaryLoad(masm, &miss, edx, eax, ebx, ecx); | 591 GenerateDictionaryLoad(masm, &miss, edx, eax, ebx, ecx); |
592 __ ret(0); | 592 __ ret(0); |
593 | 593 |
594 // Global object access: Check access rights. | 594 // Global object access: Check access rights. |
595 __ bind(&global); | 595 __ bind(&global); |
596 __ CheckAccessGlobal(eax, edx, &miss); | 596 __ CheckAccessGlobalProxy(eax, edx, &miss); |
597 __ jmp(&probe); | 597 __ jmp(&probe); |
598 | 598 |
599 // Cache miss: Restore receiver from stack and jump to runtime. | 599 // Cache miss: Restore receiver from stack and jump to runtime. |
600 __ bind(&miss); | 600 __ bind(&miss); |
601 __ mov(eax, Operand(esp, 1 * kPointerSize)); | 601 __ mov(eax, Operand(esp, 1 * kPointerSize)); |
602 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 602 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
603 } | 603 } |
604 | 604 |
605 | 605 |
606 void LoadIC::GenerateMiss(MacroAssembler* masm) { | 606 void LoadIC::GenerateMiss(MacroAssembler* masm) { |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 769 |
770 // Do tail-call to runtime routine. | 770 // Do tail-call to runtime routine. |
771 __ TailCallRuntime( | 771 __ TailCallRuntime( |
772 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); | 772 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
773 } | 773 } |
774 | 774 |
775 #undef __ | 775 #undef __ |
776 | 776 |
777 | 777 |
778 } } // namespace v8::internal | 778 } } // namespace v8::internal |
OLD | NEW |