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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 // Do a tail-call of the compiled function. | 489 // Do a tail-call of the compiled function. |
490 __ Jump(r2); | 490 __ Jump(r2); |
491 | 491 |
492 return GetCodeWithFlags(flags, "LazyCompileStub"); | 492 return GetCodeWithFlags(flags, "LazyCompileStub"); |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 Object* CallStubCompiler::CompileCallField(Object* object, | 496 Object* CallStubCompiler::CompileCallField(Object* object, |
497 JSObject* holder, | 497 JSObject* holder, |
498 int index, | 498 int index, |
499 String* name, | 499 String* name) { |
500 Code::Flags flags) { | |
501 ASSERT_EQ(FIELD, Code::ExtractTypeFromFlags(flags)); | |
502 // ----------- S t a t e ------------- | 500 // ----------- S t a t e ------------- |
503 // -- lr: return address | 501 // -- lr: return address |
504 // ----------------------------------- | 502 // ----------------------------------- |
505 Label miss; | 503 Label miss; |
506 | 504 |
507 const int argc = arguments().immediate(); | 505 const int argc = arguments().immediate(); |
508 | 506 |
509 // Get the receiver of the function from the stack into r0. | 507 // Get the receiver of the function from the stack into r0. |
510 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); | 508 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); |
511 // Check that the receiver isn't a smi. | 509 // Check that the receiver isn't a smi. |
(...skipping 21 matching lines...) Expand all Loading... |
533 | 531 |
534 // Invoke the function. | 532 // Invoke the function. |
535 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); | 533 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION); |
536 | 534 |
537 // Handle call cache miss. | 535 // Handle call cache miss. |
538 __ bind(&miss); | 536 __ bind(&miss); |
539 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 537 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
540 __ Jump(ic, RelocInfo::CODE_TARGET); | 538 __ Jump(ic, RelocInfo::CODE_TARGET); |
541 | 539 |
542 // Return the generated code. | 540 // Return the generated code. |
543 return GetCodeWithFlags(flags, name); | 541 return GetCode(FIELD, name); |
544 } | 542 } |
545 | 543 |
546 | 544 |
547 Object* CallStubCompiler::CompileCallConstant(Object* object, | 545 Object* CallStubCompiler::CompileCallConstant(Object* object, |
548 JSObject* holder, | 546 JSObject* holder, |
549 JSFunction* function, | 547 JSFunction* function, |
550 CheckType check, | 548 CheckType check) { |
551 Code::Flags flags) { | |
552 ASSERT_EQ(CONSTANT_FUNCTION, Code::ExtractTypeFromFlags(flags)); | |
553 // ----------- S t a t e ------------- | 549 // ----------- S t a t e ------------- |
554 // -- lr: return address | 550 // -- lr: return address |
555 // ----------------------------------- | 551 // ----------------------------------- |
556 Label miss; | 552 Label miss; |
557 | 553 |
558 // Get the receiver from the stack | 554 // Get the receiver from the stack |
559 const int argc = arguments().immediate(); | 555 const int argc = arguments().immediate(); |
560 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 556 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
561 | 557 |
562 // Check that the receiver isn't a smi. | 558 // Check that the receiver isn't a smi. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 // Handle call cache miss. | 653 // Handle call cache miss. |
658 __ bind(&miss); | 654 __ bind(&miss); |
659 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 655 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
660 __ Jump(ic, RelocInfo::CODE_TARGET); | 656 __ Jump(ic, RelocInfo::CODE_TARGET); |
661 | 657 |
662 // Return the generated code. | 658 // Return the generated code. |
663 String* function_name = NULL; | 659 String* function_name = NULL; |
664 if (function->shared()->name()->IsString()) { | 660 if (function->shared()->name()->IsString()) { |
665 function_name = String::cast(function->shared()->name()); | 661 function_name = String::cast(function->shared()->name()); |
666 } | 662 } |
667 return GetCodeWithFlags(flags, function_name); | 663 return GetCode(CONSTANT_FUNCTION, function_name); |
668 } | 664 } |
669 | 665 |
670 | 666 |
671 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 667 Object* CallStubCompiler::CompileCallInterceptor(Object* object, |
672 JSObject* holder, | 668 JSObject* holder, |
673 String* name) { | 669 String* name) { |
674 // ----------- S t a t e ------------- | 670 // ----------- S t a t e ------------- |
675 // -- lr: return address | 671 // -- lr: return address |
676 // ----------------------------------- | 672 // ----------------------------------- |
677 Label miss; | 673 Label miss; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 __ bind(&miss); | 1007 __ bind(&miss); |
1012 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1008 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1013 | 1009 |
1014 // Return the generated code. | 1010 // Return the generated code. |
1015 return GetCode(INTERCEPTOR, name); | 1011 return GetCode(INTERCEPTOR, name); |
1016 } | 1012 } |
1017 | 1013 |
1018 | 1014 |
1019 Object* LoadStubCompiler::CompileLoadGlobal(JSGlobalObject* object, | 1015 Object* LoadStubCompiler::CompileLoadGlobal(JSGlobalObject* object, |
1020 JSGlobalPropertyCell* cell, | 1016 JSGlobalPropertyCell* cell, |
1021 String* name) { | 1017 String* name, |
| 1018 bool is_dont_delete) { |
1022 // ----------- S t a t e ------------- | 1019 // ----------- S t a t e ------------- |
1023 // -- r2 : name | 1020 // -- r2 : name |
1024 // -- lr : return address | 1021 // -- lr : return address |
1025 // -- [sp] : receiver | 1022 // -- [sp] : receiver |
1026 // ----------------------------------- | 1023 // ----------------------------------- |
1027 Label miss; | 1024 Label miss; |
1028 | 1025 |
1029 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); | 1026 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3); |
1030 | 1027 |
1031 // Check that the map of the global has not changed. | 1028 // Check that the map of the global has not changed. |
1032 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); | 1029 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); |
1033 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); | 1030 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); |
1034 __ cmp(r3, Operand(Handle<Map>(object->map()))); | 1031 __ cmp(r3, Operand(Handle<Map>(object->map()))); |
1035 __ b(ne, &miss); | 1032 __ b(ne, &miss); |
1036 | 1033 |
1037 // Get the value from the cell. | 1034 // Get the value from the cell. |
1038 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); | 1035 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); |
1039 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); | 1036 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); |
1040 | 1037 |
1041 // Check for deleted property. | 1038 // Check for deleted property if property can actually be deleted. |
1042 __ cmp(r0, Operand(Factory::the_hole_value())); | 1039 if (!is_dont_delete) { |
1043 __ b(eq, &miss); | 1040 __ cmp(r0, Operand(Factory::the_hole_value())); |
| 1041 __ b(eq, &miss); |
| 1042 } |
1044 | 1043 |
1045 __ Ret(); | 1044 __ Ret(); |
1046 | 1045 |
1047 __ bind(&miss); | 1046 __ bind(&miss); |
1048 __ DecrementCounter(&Counters::named_load_global_inline, 1, r1, r3); | 1047 __ DecrementCounter(&Counters::named_load_global_inline, 1, r1, r3); |
1049 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); | 1048 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); |
1050 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1049 GenerateLoadMiss(masm(), Code::LOAD_IC); |
1051 | 1050 |
1052 // Return the generated code. | 1051 // Return the generated code. |
1053 return GetCode(NORMAL, name); | 1052 return GetCode(NORMAL, name); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 __ Jump(ic, RelocInfo::CODE_TARGET); | 1263 __ Jump(ic, RelocInfo::CODE_TARGET); |
1265 | 1264 |
1266 // Return the generated code. | 1265 // Return the generated code. |
1267 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 1266 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
1268 } | 1267 } |
1269 | 1268 |
1270 | 1269 |
1271 #undef __ | 1270 #undef __ |
1272 | 1271 |
1273 } } // namespace v8::internal | 1272 } } // namespace v8::internal |
OLD | NEW |