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

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

Issue 6066010: Merge 6095:6198 from bleeding_edge to experimental/gc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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/ia32/builtins-ia32.cc ('k') | src/ia32/debug-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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 // Get the function from the stack. 98 // Get the function from the stack.
99 __ mov(ecx, Operand(esp, 1 * kPointerSize)); 99 __ mov(ecx, Operand(esp, 1 * kPointerSize));
100 100
101 // Setup the object header. 101 // Setup the object header.
102 __ mov(FieldOperand(eax, HeapObject::kMapOffset), Factory::context_map()); 102 __ mov(FieldOperand(eax, HeapObject::kMapOffset), Factory::context_map());
103 __ mov(FieldOperand(eax, Context::kLengthOffset), 103 __ mov(FieldOperand(eax, Context::kLengthOffset),
104 Immediate(Smi::FromInt(length))); 104 Immediate(Smi::FromInt(length)));
105 105
106 // Setup the fixed slots. 106 // Setup the fixed slots.
107 __ xor_(ebx, Operand(ebx)); // Set to NULL. 107 __ Set(ebx, Immediate(0)); // Set to NULL.
108 __ mov(Operand(eax, Context::SlotOffset(Context::CLOSURE_INDEX)), ecx); 108 __ mov(Operand(eax, Context::SlotOffset(Context::CLOSURE_INDEX)), ecx);
109 __ mov(Operand(eax, Context::SlotOffset(Context::FCONTEXT_INDEX)), eax); 109 __ mov(Operand(eax, Context::SlotOffset(Context::FCONTEXT_INDEX)), eax);
110 __ mov(Operand(eax, Context::SlotOffset(Context::PREVIOUS_INDEX)), ebx); 110 __ mov(Operand(eax, Context::SlotOffset(Context::PREVIOUS_INDEX)), ebx);
111 __ mov(Operand(eax, Context::SlotOffset(Context::EXTENSION_INDEX)), ebx); 111 __ mov(Operand(eax, Context::SlotOffset(Context::EXTENSION_INDEX)), ebx);
112 112
113 // Copy the global object from the surrounding context. We go through the 113 // Copy the global object from the surrounding context. We go through the
114 // context in the function (ecx) to match the allocation behavior we have 114 // context in the function (ecx) to match the allocation behavior we have
115 // in the runtime system (see Heap::AllocateFunctionContext). 115 // in the runtime system (see Heap::AllocateFunctionContext).
116 __ mov(ebx, FieldOperand(ecx, JSFunction::kContextOffset)); 116 __ mov(ebx, FieldOperand(ecx, JSFunction::kContextOffset));
117 __ mov(ebx, Operand(ebx, Context::SlotOffset(Context::GLOBAL_INDEX))); 117 __ mov(ebx, Operand(ebx, Context::SlotOffset(Context::GLOBAL_INDEX)));
(...skipping 4182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4300 // The representation of NaN values has all exponent bits (52..62) set, 4300 // The representation of NaN values has all exponent bits (52..62) set,
4301 // and not all mantissa bits (0..51) clear. 4301 // and not all mantissa bits (0..51) clear.
4302 // We only accept QNaNs, which have bit 51 set. 4302 // We only accept QNaNs, which have bit 51 set.
4303 // Read top bits of double representation (second word of value). 4303 // Read top bits of double representation (second word of value).
4304 4304
4305 // Value is a QNaN if value & kQuietNaNMask == kQuietNaNMask, i.e., 4305 // Value is a QNaN if value & kQuietNaNMask == kQuietNaNMask, i.e.,
4306 // all bits in the mask are set. We only need to check the word 4306 // all bits in the mask are set. We only need to check the word
4307 // that contains the exponent and high bit of the mantissa. 4307 // that contains the exponent and high bit of the mantissa.
4308 STATIC_ASSERT(((kQuietNaNHighBitsMask << 1) & 0x80000000u) != 0); 4308 STATIC_ASSERT(((kQuietNaNHighBitsMask << 1) & 0x80000000u) != 0);
4309 __ mov(edx, FieldOperand(edx, HeapNumber::kExponentOffset)); 4309 __ mov(edx, FieldOperand(edx, HeapNumber::kExponentOffset));
4310 __ xor_(eax, Operand(eax)); 4310 __ Set(eax, Immediate(0));
4311 // Shift value and mask so kQuietNaNHighBitsMask applies to topmost 4311 // Shift value and mask so kQuietNaNHighBitsMask applies to topmost
4312 // bits. 4312 // bits.
4313 __ add(edx, Operand(edx)); 4313 __ add(edx, Operand(edx));
4314 __ cmp(edx, kQuietNaNHighBitsMask << 1); 4314 __ cmp(edx, kQuietNaNHighBitsMask << 1);
4315 if (cc_ == equal) { 4315 if (cc_ == equal) {
4316 STATIC_ASSERT(EQUAL != 1); 4316 STATIC_ASSERT(EQUAL != 1);
4317 __ setcc(above_equal, eax); 4317 __ setcc(above_equal, eax);
4318 __ ret(0); 4318 __ ret(0);
4319 } else { 4319 } else {
4320 NearLabel nan; 4320 NearLabel nan;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
4430 __ FCmp(); 4430 __ FCmp();
4431 4431
4432 // Don't base result on EFLAGS when a NaN is involved. 4432 // Don't base result on EFLAGS when a NaN is involved.
4433 __ j(parity_even, &unordered, not_taken); 4433 __ j(parity_even, &unordered, not_taken);
4434 4434
4435 NearLabel below_label, above_label; 4435 NearLabel below_label, above_label;
4436 // Return a result of -1, 0, or 1, based on EFLAGS. 4436 // Return a result of -1, 0, or 1, based on EFLAGS.
4437 __ j(below, &below_label, not_taken); 4437 __ j(below, &below_label, not_taken);
4438 __ j(above, &above_label, not_taken); 4438 __ j(above, &above_label, not_taken);
4439 4439
4440 __ xor_(eax, Operand(eax)); 4440 __ Set(eax, Immediate(0));
4441 __ ret(0); 4441 __ ret(0);
4442 4442
4443 __ bind(&below_label); 4443 __ bind(&below_label);
4444 __ mov(eax, Immediate(Smi::FromInt(-1))); 4444 __ mov(eax, Immediate(Smi::FromInt(-1)));
4445 __ ret(0); 4445 __ ret(0);
4446 4446
4447 __ bind(&above_label); 4447 __ bind(&above_label);
4448 __ mov(eax, Immediate(Smi::FromInt(1))); 4448 __ mov(eax, Immediate(Smi::FromInt(1)));
4449 __ ret(0); 4449 __ ret(0);
4450 } 4450 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 // Restore next handler and frame pointer, discard handler state. 4643 // Restore next handler and frame pointer, discard handler state.
4644 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 4644 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
4645 __ pop(Operand::StaticVariable(handler_address)); 4645 __ pop(Operand::StaticVariable(handler_address));
4646 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize); 4646 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
4647 __ pop(ebp); 4647 __ pop(ebp);
4648 __ pop(edx); // Remove state. 4648 __ pop(edx); // Remove state.
4649 4649
4650 // Before returning we restore the context from the frame pointer if 4650 // Before returning we restore the context from the frame pointer if
4651 // not NULL. The frame pointer is NULL in the exception handler of 4651 // not NULL. The frame pointer is NULL in the exception handler of
4652 // a JS entry frame. 4652 // a JS entry frame.
4653 __ xor_(esi, Operand(esi)); // Tentatively set context pointer to NULL. 4653 __ Set(esi, Immediate(0)); // Tentatively set context pointer to NULL.
4654 NearLabel skip; 4654 NearLabel skip;
4655 __ cmp(ebp, 0); 4655 __ cmp(ebp, 0);
4656 __ j(equal, &skip, not_taken); 4656 __ j(equal, &skip, not_taken);
4657 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 4657 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4658 __ bind(&skip); 4658 __ bind(&skip);
4659 4659
4660 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize); 4660 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
4661 __ ret(0); 4661 __ ret(0);
4662 } 4662 }
4663 4663
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
4796 __ mov(eax, false); 4796 __ mov(eax, false);
4797 __ mov(Operand::StaticVariable(external_caught), eax); 4797 __ mov(Operand::StaticVariable(external_caught), eax);
4798 4798
4799 // Set pending exception and eax to out of memory exception. 4799 // Set pending exception and eax to out of memory exception.
4800 ExternalReference pending_exception(Top::k_pending_exception_address); 4800 ExternalReference pending_exception(Top::k_pending_exception_address);
4801 __ mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException())); 4801 __ mov(eax, reinterpret_cast<int32_t>(Failure::OutOfMemoryException()));
4802 __ mov(Operand::StaticVariable(pending_exception), eax); 4802 __ mov(Operand::StaticVariable(pending_exception), eax);
4803 } 4803 }
4804 4804
4805 // Clear the context pointer. 4805 // Clear the context pointer.
4806 __ xor_(esi, Operand(esi)); 4806 __ Set(esi, Immediate(0));
4807 4807
4808 // Restore fp from handler and discard handler state. 4808 // Restore fp from handler and discard handler state.
4809 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize); 4809 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 1 * kPointerSize);
4810 __ pop(ebp); 4810 __ pop(ebp);
4811 __ pop(edx); // State. 4811 __ pop(edx); // State.
4812 4812
4813 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize); 4813 STATIC_ASSERT(StackHandlerConstants::kPCOffset == 3 * kPointerSize);
4814 __ ret(0); 4814 __ ret(0);
4815 } 4815 }
4816 4816
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
6409 // Do a tail call to the rewritten stub. 6409 // Do a tail call to the rewritten stub.
6410 __ jmp(Operand(edi)); 6410 __ jmp(Operand(edi));
6411 } 6411 }
6412 6412
6413 6413
6414 #undef __ 6414 #undef __
6415 6415
6416 } } // namespace v8::internal 6416 } } // namespace v8::internal
6417 6417
6418 #endif // V8_TARGET_ARCH_IA32 6418 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/debug-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698