| 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 #define __ masm()-> | 461 #define __ masm()-> |
| 462 | 462 |
| 463 | 463 |
| 464 // TODO(1241006): Avoid having lazy compile stubs specialized by the | 464 // TODO(1241006): Avoid having lazy compile stubs specialized by the |
| 465 // number of arguments. It is not needed anymore. | 465 // number of arguments. It is not needed anymore. |
| 466 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { | 466 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { |
| 467 HandleScope scope; | 467 HandleScope scope; |
| 468 | 468 |
| 469 // Enter an internal frame. | 469 // Enter an internal frame. |
| 470 __ EnterFrame(StackFrame::INTERNAL); | 470 __ EnterInternalFrame(); |
| 471 | 471 |
| 472 // Push a copy of the function onto the stack. | 472 // Push a copy of the function onto the stack. |
| 473 __ push(edi); | 473 __ push(edi); |
| 474 | 474 |
| 475 __ push(edi); // function is also the parameter to the runtime call | 475 __ push(edi); // function is also the parameter to the runtime call |
| 476 __ CallRuntime(Runtime::kLazyCompile, 1); | 476 __ CallRuntime(Runtime::kLazyCompile, 1); |
| 477 __ pop(edi); | 477 __ pop(edi); |
| 478 | 478 |
| 479 __ ExitFrame(StackFrame::INTERNAL); | 479 __ ExitInternalFrame(); |
| 480 | 480 |
| 481 // Do a tail-call of the compiled function. | 481 // Do a tail-call of the compiled function. |
| 482 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); | 482 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); |
| 483 __ jmp(Operand(ecx)); | 483 __ jmp(Operand(ecx)); |
| 484 | 484 |
| 485 return GetCodeWithFlags(flags); | 485 return GetCodeWithFlags(flags); |
| 486 } | 486 } |
| 487 | 487 |
| 488 | 488 |
| 489 Object* CallStubCompiler::CompileCallField(Object* object, | 489 Object* CallStubCompiler::CompileCallField(Object* object, |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 659 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
| 660 // Check that the receiver isn't a smi. | 660 // Check that the receiver isn't a smi. |
| 661 __ test(edx, Immediate(kSmiTagMask)); | 661 __ test(edx, Immediate(kSmiTagMask)); |
| 662 __ j(zero, &miss, not_taken); | 662 __ j(zero, &miss, not_taken); |
| 663 | 663 |
| 664 // Check that maps have not changed and compute the holder register. | 664 // Check that maps have not changed and compute the holder register. |
| 665 Register reg = | 665 Register reg = |
| 666 __ CheckMaps(JSObject::cast(object), edx, holder, ebx, ecx, &miss); | 666 __ CheckMaps(JSObject::cast(object), edx, holder, ebx, ecx, &miss); |
| 667 | 667 |
| 668 // Enter an internal frame. | 668 // Enter an internal frame. |
| 669 __ EnterFrame(StackFrame::INTERNAL); | 669 __ EnterInternalFrame(); |
| 670 | 670 |
| 671 // Push arguments on the expression stack. | 671 // Push arguments on the expression stack. |
| 672 __ push(edx); // receiver | 672 __ push(edx); // receiver |
| 673 __ push(reg); // holder | 673 __ push(reg); // holder |
| 674 __ push(Operand(ebp, (argc + 3) * kPointerSize)); // name | 674 __ push(Operand(ebp, (argc + 3) * kPointerSize)); // name |
| 675 | 675 |
| 676 // Perform call. | 676 // Perform call. |
| 677 ExternalReference load_interceptor = | 677 ExternalReference load_interceptor = |
| 678 ExternalReference(IC_Utility(IC::kLoadInterceptorProperty)); | 678 ExternalReference(IC_Utility(IC::kLoadInterceptorProperty)); |
| 679 __ mov(Operand(eax), Immediate(3)); | 679 __ mov(Operand(eax), Immediate(3)); |
| 680 __ mov(Operand(ebx), Immediate(load_interceptor)); | 680 __ mov(Operand(ebx), Immediate(load_interceptor)); |
| 681 | 681 |
| 682 CEntryStub stub; | 682 CEntryStub stub; |
| 683 __ CallStub(&stub); | 683 __ CallStub(&stub); |
| 684 | 684 |
| 685 // Move result to edi and restore receiver. | 685 // Move result to edi and restore receiver. |
| 686 __ mov(Operand(edi), eax); | 686 __ mov(Operand(edi), eax); |
| 687 __ mov(edx, Operand(ebp, (argc + 2) * kPointerSize)); // receiver | 687 __ mov(edx, Operand(ebp, (argc + 2) * kPointerSize)); // receiver |
| 688 | 688 |
| 689 // Exit frame. | 689 // Exit frame. |
| 690 __ ExitFrame(StackFrame::INTERNAL); | 690 __ ExitInternalFrame(); |
| 691 | 691 |
| 692 // Check that the function really is a function. | 692 // Check that the function really is a function. |
| 693 __ test(edi, Immediate(kSmiTagMask)); | 693 __ test(edi, Immediate(kSmiTagMask)); |
| 694 __ j(zero, &miss, not_taken); | 694 __ j(zero, &miss, not_taken); |
| 695 __ mov(ebx, FieldOperand(edi, HeapObject::kMapOffset)); | 695 __ mov(ebx, FieldOperand(edi, HeapObject::kMapOffset)); |
| 696 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); | 696 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); |
| 697 __ cmp(ebx, JS_FUNCTION_TYPE); | 697 __ cmp(ebx, JS_FUNCTION_TYPE); |
| 698 __ j(not_equal, &miss, not_taken); | 698 __ j(not_equal, &miss, not_taken); |
| 699 | 699 |
| 700 // Invoke the function. | 700 // Invoke the function. |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1232 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1233 | 1233 |
| 1234 // Return the generated code. | 1234 // Return the generated code. |
| 1235 return GetCode(CALLBACKS); | 1235 return GetCode(CALLBACKS); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 | 1238 |
| 1239 #undef __ | 1239 #undef __ |
| 1240 | 1240 |
| 1241 } } // namespace v8::internal | 1241 } } // namespace v8::internal |
| OLD | NEW |