Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 9190007: Merge r10187, r10188 from the bleeding_edge to the 3.7 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.7/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 4522 matching lines...) Expand 10 before | Expand all | Expand 10 after
4533 // function without changing the state. 4533 // function without changing the state.
4534 __ cmp(ecx, edi); 4534 __ cmp(ecx, edi);
4535 __ j(equal, &call, Label::kNear); 4535 __ j(equal, &call, Label::kNear);
4536 __ cmp(ecx, Immediate(MegamorphicSentinel(isolate))); 4536 __ cmp(ecx, Immediate(MegamorphicSentinel(isolate)));
4537 __ j(equal, &call, Label::kNear); 4537 __ j(equal, &call, Label::kNear);
4538 4538
4539 // A monomorphic miss (i.e, here the cache is not uninitialized) goes 4539 // A monomorphic miss (i.e, here the cache is not uninitialized) goes
4540 // megamorphic. 4540 // megamorphic.
4541 __ cmp(ecx, Immediate(UninitializedSentinel(isolate))); 4541 __ cmp(ecx, Immediate(UninitializedSentinel(isolate)));
4542 __ j(equal, &initialize, Label::kNear); 4542 __ j(equal, &initialize, Label::kNear);
4543 // MegamorphicSentinel is a root so no write-barrier is needed. 4543 // MegamorphicSentinel is an immortal immovable object (undefined) so no
4544 // write-barrier is needed.
4544 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), 4545 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
4545 Immediate(MegamorphicSentinel(isolate))); 4546 Immediate(MegamorphicSentinel(isolate)));
4546 __ jmp(&call, Label::kNear); 4547 __ jmp(&call, Label::kNear);
4547 4548
4548 // An uninitialized cache is patched with the function. 4549 // An uninitialized cache is patched with the function.
4549 __ bind(&initialize); 4550 __ bind(&initialize);
4550 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), edi); 4551 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), edi);
4551 __ mov(ecx, edi); 4552 // No need for a write barrier here - cells are rescanned.
4552 __ RecordWriteField(ebx,
4553 JSGlobalPropertyCell::kValueOffset,
4554 ecx,
4555 edx,
4556 kDontSaveFPRegs,
4557 OMIT_REMEMBERED_SET, // Cells are rescanned.
4558 OMIT_SMI_CHECK);
4559 4553
4560 __ bind(&call); 4554 __ bind(&call);
4561 } 4555 }
4562 4556
4563 // Fast-case: Just invoke the function. 4557 // Fast-case: Just invoke the function.
4564 ParameterCount actual(argc_); 4558 ParameterCount actual(argc_);
4565 4559
4566 if (ReceiverMightBeImplicit()) { 4560 if (ReceiverMightBeImplicit()) {
4567 Label call_as_function; 4561 Label call_as_function;
4568 __ cmp(eax, isolate->factory()->the_hole_value()); 4562 __ cmp(eax, isolate->factory()->the_hole_value());
(...skipping 11 matching lines...) Expand all
4580 NullCallWrapper(), 4574 NullCallWrapper(),
4581 CALL_AS_FUNCTION); 4575 CALL_AS_FUNCTION);
4582 4576
4583 // Slow-case: Non-function called. 4577 // Slow-case: Non-function called.
4584 __ bind(&slow); 4578 __ bind(&slow);
4585 if (RecordCallTarget()) { 4579 if (RecordCallTarget()) {
4586 // If there is a call target cache, mark it megamorphic in the 4580 // If there is a call target cache, mark it megamorphic in the
4587 // non-function case. 4581 // non-function case.
4588 __ mov(ebx, Operand(esp, 0)); 4582 __ mov(ebx, Operand(esp, 0));
4589 __ mov(ebx, Operand(ebx, 1)); 4583 __ mov(ebx, Operand(ebx, 1));
4584 // MegamorphicSentinel is an immortal immovable object (undefined) so no
4585 // write barrier is needed.
4590 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), 4586 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
4591 Immediate(MegamorphicSentinel(isolate))); 4587 Immediate(MegamorphicSentinel(isolate)));
4592 } 4588 }
4593 // Check for function proxy. 4589 // Check for function proxy.
4594 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); 4590 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE);
4595 __ j(not_equal, &non_function); 4591 __ j(not_equal, &non_function);
4596 __ pop(ecx); 4592 __ pop(ecx);
4597 __ push(edi); // put proxy as additional argument under return address 4593 __ push(edi); // put proxy as additional argument under return address
4598 __ push(ecx); 4594 __ push(ecx);
4599 __ Set(eax, Immediate(argc_ + 1)); 4595 __ Set(eax, Immediate(argc_ + 1));
(...skipping 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after
7172 false); 7168 false);
7173 __ pop(edx); 7169 __ pop(edx);
7174 __ ret(0); 7170 __ ret(0);
7175 } 7171 }
7176 7172
7177 #undef __ 7173 #undef __
7178 7174
7179 } } // namespace v8::internal 7175 } } // namespace v8::internal
7180 7176
7181 #endif // V8_TARGET_ARCH_IA32 7177 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698