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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 __ ldr(ip, MemOperand(ip, offset, LSL, 1)); | 54 __ ldr(ip, MemOperand(ip, offset, LSL, 1)); |
55 __ cmp(name, Operand(ip)); | 55 __ cmp(name, Operand(ip)); |
56 __ b(ne, &miss); | 56 __ b(ne, &miss); |
57 | 57 |
58 // Get the code entry from the cache. | 58 // Get the code entry from the cache. |
59 __ mov(ip, Operand(value_offset)); | 59 __ mov(ip, Operand(value_offset)); |
60 __ ldr(offset, MemOperand(ip, offset, LSL, 1)); | 60 __ ldr(offset, MemOperand(ip, offset, LSL, 1)); |
61 | 61 |
62 // Check that the flags match what we're looking for. | 62 // Check that the flags match what we're looking for. |
63 __ ldr(offset, FieldMemOperand(offset, Code::kFlagsOffset)); | 63 __ ldr(offset, FieldMemOperand(offset, Code::kFlagsOffset)); |
64 __ and_(offset, offset, Operand(~Code::kFlagsTypeMask)); | 64 __ and_(offset, |
65 offset, | |
66 Operand(~(Code::kFlagsTypeMask | Code::kFlagsICInLoopMask))); | |
Kasper Lund
2009/05/25 09:45:42
Why not have a constant mask for the combination o
| |
65 __ cmp(offset, Operand(flags)); | 67 __ cmp(offset, Operand(flags)); |
66 __ b(ne, &miss); | 68 __ b(ne, &miss); |
67 | 69 |
68 // Restore offset and re-load code entry from cache. | 70 // Restore offset and re-load code entry from cache. |
69 __ pop(offset); | 71 __ pop(offset); |
70 __ mov(ip, Operand(value_offset)); | 72 __ mov(ip, Operand(value_offset)); |
71 __ ldr(offset, MemOperand(ip, offset, LSL, 1)); | 73 __ ldr(offset, MemOperand(ip, offset, LSL, 1)); |
72 | 74 |
73 // Jump to the first instruction in the code stub. | 75 // Jump to the first instruction in the code stub. |
74 __ add(offset, offset, Operand(Code::kHeaderSize - kHeapObjectTag)); | 76 __ add(offset, offset, Operand(Code::kHeaderSize - kHeapObjectTag)); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
487 // Do a tail-call of the compiled function. | 489 // Do a tail-call of the compiled function. |
488 __ Jump(r2); | 490 __ Jump(r2); |
489 | 491 |
490 return GetCodeWithFlags(flags, "LazyCompileStub"); | 492 return GetCodeWithFlags(flags, "LazyCompileStub"); |
491 } | 493 } |
492 | 494 |
493 | 495 |
494 Object* CallStubCompiler::CompileCallField(Object* object, | 496 Object* CallStubCompiler::CompileCallField(Object* object, |
495 JSObject* holder, | 497 JSObject* holder, |
496 int index, | 498 int index, |
497 String* name) { | 499 String* name, |
500 Code::Flags flags) { | |
Kevin Millikin (Chromium)
2009/05/25 11:00:42
Since you've generalized the call site to take fla
| |
498 // ----------- S t a t e ------------- | 501 // ----------- S t a t e ------------- |
499 // -- lr: return address | 502 // -- lr: return address |
500 // ----------------------------------- | 503 // ----------------------------------- |
501 Label miss; | 504 Label miss; |
502 | 505 |
503 const int argc = arguments().immediate(); | 506 const int argc = arguments().immediate(); |
504 | 507 |
505 // Get the receiver of the function from the stack into r0. | 508 // Get the receiver of the function from the stack into r0. |
506 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 509 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
507 // Check that the receiver isn't a smi. | 510 // Check that the receiver isn't a smi. |
(...skipping 23 matching lines...) Expand all Loading... | |
531 | 534 |
532 // Invoke the function. | 535 // Invoke the function. |
533 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); | 536 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); |
534 | 537 |
535 // Handle call cache miss. | 538 // Handle call cache miss. |
536 __ bind(&miss); | 539 __ bind(&miss); |
537 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 540 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
538 __ Jump(ic, RelocInfo::CODE_TARGET); | 541 __ Jump(ic, RelocInfo::CODE_TARGET); |
539 | 542 |
540 // Return the generated code. | 543 // Return the generated code. |
541 return GetCode(FIELD, name); | 544 return GetCodeWithFlags(flags, name); |
542 } | 545 } |
543 | 546 |
544 | 547 |
545 Object* CallStubCompiler::CompileCallConstant(Object* object, | 548 Object* CallStubCompiler::CompileCallConstant(Object* object, |
546 JSObject* holder, | 549 JSObject* holder, |
547 JSFunction* function, | 550 JSFunction* function, |
548 CheckType check) { | 551 CheckType check, |
552 Code::Flags flags) { | |
Kevin Millikin (Chromium)
2009/05/25 11:00:42
Same as above with type CONSTANT_FUNCTION.
| |
549 // ----------- S t a t e ------------- | 553 // ----------- S t a t e ------------- |
550 // -- lr: return address | 554 // -- lr: return address |
551 // ----------------------------------- | 555 // ----------------------------------- |
552 Label miss; | 556 Label miss; |
553 | 557 |
554 // Get the receiver from the stack | 558 // Get the receiver from the stack |
555 const int argc = arguments().immediate(); | 559 const int argc = arguments().immediate(); |
556 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 560 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
557 | 561 |
558 // Check that the receiver isn't a smi. | 562 // Check that the receiver isn't a smi. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 // Handle call cache miss. | 660 // Handle call cache miss. |
657 __ bind(&miss); | 661 __ bind(&miss); |
658 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 662 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
659 __ Jump(ic, RelocInfo::CODE_TARGET); | 663 __ Jump(ic, RelocInfo::CODE_TARGET); |
660 | 664 |
661 // Return the generated code. | 665 // Return the generated code. |
662 String* function_name = NULL; | 666 String* function_name = NULL; |
663 if (function->shared()->name()->IsString()) { | 667 if (function->shared()->name()->IsString()) { |
664 function_name = String::cast(function->shared()->name()); | 668 function_name = String::cast(function->shared()->name()); |
665 } | 669 } |
666 return GetCode(CONSTANT_FUNCTION, function_name); | 670 return GetCodeWithFlags(flags, function_name); |
667 } | 671 } |
668 | 672 |
669 | 673 |
670 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 674 Object* CallStubCompiler::CompileCallInterceptor(Object* object, |
671 JSObject* holder, | 675 JSObject* holder, |
672 String* name) { | 676 String* name) { |
673 // ----------- S t a t e ------------- | 677 // ----------- S t a t e ------------- |
674 // -- lr: return address | 678 // -- lr: return address |
675 // ----------------------------------- | 679 // ----------------------------------- |
676 Label miss; | 680 Label miss; |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1115 __ Jump(ic, RelocInfo::CODE_TARGET); | 1119 __ Jump(ic, RelocInfo::CODE_TARGET); |
1116 | 1120 |
1117 // Return the generated code. | 1121 // Return the generated code. |
1118 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 1122 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
1119 } | 1123 } |
1120 | 1124 |
1121 | 1125 |
1122 #undef __ | 1126 #undef __ |
1123 | 1127 |
1124 } } // namespace v8::internal | 1128 } } // namespace v8::internal |
OLD | NEW |