Chromium Code Reviews| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 | 51 |
| 52 // Check that the key in the entry matches the name. | 52 // Check that the key in the entry matches the name. |
| 53 __ cmp(name, Operand::StaticArray(offset, times_2, key_offset)); | 53 __ cmp(name, Operand::StaticArray(offset, times_2, key_offset)); |
| 54 __ j(not_equal, &miss, not_taken); | 54 __ j(not_equal, &miss, not_taken); |
| 55 | 55 |
| 56 // Get the code entry from the cache. | 56 // Get the code entry from the cache. |
| 57 __ mov(offset, Operand::StaticArray(offset, times_2, value_offset)); | 57 __ mov(offset, Operand::StaticArray(offset, times_2, value_offset)); |
| 58 | 58 |
| 59 // Check that the flags match what we're looking for. | 59 // Check that the flags match what we're looking for. |
| 60 __ mov(offset, FieldOperand(offset, Code::kFlagsOffset)); | 60 __ mov(offset, FieldOperand(offset, Code::kFlagsOffset)); |
| 61 __ and_(offset, ~Code::kFlagsTypeMask); | 61 __ and_(offset, ~(Code::kFlagsTypeMask | Code::kFlagsICInLoopMask)); |
| 62 __ cmp(offset, flags); | 62 __ cmp(offset, flags); |
| 63 __ j(not_equal, &miss); | 63 __ j(not_equal, &miss); |
| 64 | 64 |
| 65 // Restore offset and re-load code entry from cache. | 65 // Restore offset and re-load code entry from cache. |
| 66 __ pop(offset); | 66 __ pop(offset); |
| 67 __ mov(offset, Operand::StaticArray(offset, times_2, value_offset)); | 67 __ mov(offset, Operand::StaticArray(offset, times_2, value_offset)); |
| 68 | 68 |
| 69 // Jump to the first instruction in the code stub. | 69 // Jump to the first instruction in the code stub. |
| 70 __ add(Operand(offset), Immediate(Code::kHeaderSize - kHeapObjectTag)); | 70 __ add(Operand(offset), Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 71 __ jmp(Operand(offset)); | 71 __ jmp(Operand(offset)); |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 463 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); | 463 __ lea(ecx, FieldOperand(eax, Code::kHeaderSize)); |
| 464 __ jmp(Operand(ecx)); | 464 __ jmp(Operand(ecx)); |
| 465 | 465 |
| 466 return GetCodeWithFlags(flags, "LazyCompileStub"); | 466 return GetCodeWithFlags(flags, "LazyCompileStub"); |
| 467 } | 467 } |
| 468 | 468 |
| 469 | 469 |
| 470 Object* CallStubCompiler::CompileCallField(Object* object, | 470 Object* CallStubCompiler::CompileCallField(Object* object, |
| 471 JSObject* holder, | 471 JSObject* holder, |
| 472 int index, | 472 int index, |
| 473 String* name) { | 473 String* name, |
| 474 Code::Flags flags) { | |
|
Kevin Millikin (Chromium)
2009/05/25 11:00:42
Same comment about ASSERT as in the ARM file.
| |
| 474 // ----------- S t a t e ------------- | 475 // ----------- S t a t e ------------- |
| 475 // ----------------------------------- | 476 // ----------------------------------- |
| 476 Label miss; | 477 Label miss; |
| 477 | 478 |
| 478 // Get the receiver from the stack. | 479 // Get the receiver from the stack. |
| 479 const int argc = arguments().immediate(); | 480 const int argc = arguments().immediate(); |
| 480 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 481 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
| 481 | 482 |
| 482 // Check that the receiver isn't a smi. | 483 // Check that the receiver isn't a smi. |
| 483 __ test(edx, Immediate(kSmiTagMask)); | 484 __ test(edx, Immediate(kSmiTagMask)); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 504 | 505 |
| 505 // Invoke the function. | 506 // Invoke the function. |
| 506 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); | 507 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION); |
| 507 | 508 |
| 508 // Handle call cache miss. | 509 // Handle call cache miss. |
| 509 __ bind(&miss); | 510 __ bind(&miss); |
| 510 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 511 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
| 511 __ jmp(ic, RelocInfo::CODE_TARGET); | 512 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 512 | 513 |
| 513 // Return the generated code. | 514 // Return the generated code. |
| 514 return GetCode(FIELD, name); | 515 return GetCodeWithFlags(flags, name); |
| 515 } | 516 } |
| 516 | 517 |
| 517 | 518 |
| 518 Object* CallStubCompiler::CompileCallConstant(Object* object, | 519 Object* CallStubCompiler::CompileCallConstant(Object* object, |
| 519 JSObject* holder, | 520 JSObject* holder, |
| 520 JSFunction* function, | 521 JSFunction* function, |
| 521 CheckType check) { | 522 CheckType check, |
| 523 Code::Flags flags) { | |
|
Kevin Millikin (Chromium)
2009/05/25 11:00:42
And here.
| |
| 522 // ----------- S t a t e ------------- | 524 // ----------- S t a t e ------------- |
| 523 // ----------------------------------- | 525 // ----------------------------------- |
| 524 Label miss; | 526 Label miss; |
| 525 | 527 |
| 526 // Get the receiver from the stack. | 528 // Get the receiver from the stack. |
| 527 const int argc = arguments().immediate(); | 529 const int argc = arguments().immediate(); |
| 528 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); | 530 __ mov(edx, Operand(esp, (argc + 1) * kPointerSize)); |
| 529 | 531 |
| 530 // Check that the receiver isn't a smi. | 532 // Check that the receiver isn't a smi. |
| 531 if (check != NUMBER_CHECK) { | 533 if (check != NUMBER_CHECK) { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 // Handle call cache miss. | 628 // Handle call cache miss. |
| 627 __ bind(&miss); | 629 __ bind(&miss); |
| 628 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); | 630 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); |
| 629 __ jmp(ic, RelocInfo::CODE_TARGET); | 631 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 630 | 632 |
| 631 // Return the generated code. | 633 // Return the generated code. |
| 632 String* function_name = NULL; | 634 String* function_name = NULL; |
| 633 if (function->shared()->name()->IsString()) { | 635 if (function->shared()->name()->IsString()) { |
| 634 function_name = String::cast(function->shared()->name()); | 636 function_name = String::cast(function->shared()->name()); |
| 635 } | 637 } |
| 636 return GetCode(CONSTANT_FUNCTION, function_name); | 638 return GetCodeWithFlags(flags, function_name); |
| 637 } | 639 } |
| 638 | 640 |
| 639 | 641 |
| 640 Object* CallStubCompiler::CompileCallInterceptor(Object* object, | 642 Object* CallStubCompiler::CompileCallInterceptor(Object* object, |
| 641 JSObject* holder, | 643 JSObject* holder, |
| 642 String* name) { | 644 String* name) { |
| 643 // ----------- S t a t e ------------- | 645 // ----------- S t a t e ------------- |
| 644 // ----------------------------------- | 646 // ----------------------------------- |
| 645 Label miss; | 647 Label miss; |
| 646 | 648 |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1170 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1172 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1171 | 1173 |
| 1172 // Return the generated code. | 1174 // Return the generated code. |
| 1173 return GetCode(CALLBACKS, name); | 1175 return GetCode(CALLBACKS, name); |
| 1174 } | 1176 } |
| 1175 | 1177 |
| 1176 | 1178 |
| 1177 #undef __ | 1179 #undef __ |
| 1178 | 1180 |
| 1179 } } // namespace v8::internal | 1181 } } // namespace v8::internal |
| OLD | NEW |