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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 7860035: Merge bleeding edge up to 9192 into the GC branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 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/mips/simulator-mips.cc ('k') | src/mksnapshot.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 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after
3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset)); 3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset));
3495 __ sra(t2, key, kSmiTagSize); 3495 __ sra(t2, key, kSmiTagSize);
3496 // Unsigned comparison catches both negative and too-large values. 3496 // Unsigned comparison catches both negative and too-large values.
3497 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1)); 3497 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1));
3498 3498
3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset)); 3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset));
3500 // a3: base pointer of external storage 3500 // a3: base pointer of external storage
3501 3501
3502 // We are not untagging smi key and instead work with it 3502 // We are not untagging smi key and instead work with it
3503 // as if it was premultiplied by 2. 3503 // as if it was premultiplied by 2.
3504 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); 3504 STATIC_ASSERT((kSmiTag == 0) && (kSmiTagSize == 1));
3505 3505
3506 Register value = a2; 3506 Register value = a2;
3507 switch (elements_kind) { 3507 switch (elements_kind) {
3508 case JSObject::EXTERNAL_BYTE_ELEMENTS: 3508 case JSObject::EXTERNAL_BYTE_ELEMENTS:
3509 __ srl(t2, key, 1); 3509 __ srl(t2, key, 1);
3510 __ addu(t3, a3, t2); 3510 __ addu(t3, a3, t2);
3511 __ lb(value, MemOperand(t3, 0)); 3511 __ lb(value, MemOperand(t3, 0));
3512 break; 3512 break;
3513 case JSObject::EXTERNAL_PIXEL_ELEMENTS: 3513 case JSObject::EXTERNAL_PIXEL_ELEMENTS:
3514 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 3514 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS:
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
4206 // Get the elements array. 4206 // Get the elements array.
4207 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); 4207 __ lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset));
4208 __ AssertFastElements(a2); 4208 __ AssertFastElements(a2);
4209 4209
4210 // Check that the key is within bounds. 4210 // Check that the key is within bounds.
4211 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset)); 4211 __ lw(a3, FieldMemOperand(a2, FixedArray::kLengthOffset));
4212 __ Branch(&miss_force_generic, hs, a0, Operand(a3)); 4212 __ Branch(&miss_force_generic, hs, a0, Operand(a3));
4213 4213
4214 // Load the result and make sure it's not the hole. 4214 // Load the result and make sure it's not the hole.
4215 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4215 __ Addu(a3, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4216 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4216 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4217 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize); 4217 __ sll(t0, a0, kPointerSizeLog2 - kSmiTagSize);
4218 __ Addu(t0, t0, a3); 4218 __ Addu(t0, t0, a3);
4219 __ lw(t0, MemOperand(t0)); 4219 __ lw(t0, MemOperand(t0));
4220 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex); 4220 __ LoadRoot(t1, Heap::kTheHoleValueRootIndex);
4221 __ Branch(&miss_force_generic, eq, t0, Operand(t1)); 4221 __ Branch(&miss_force_generic, eq, t0, Operand(t1));
4222 __ mov(v0, t0); 4222 __ mov(v0, t0);
4223 __ Ret(); 4223 __ Ret();
4224 4224
4225 __ bind(&miss_force_generic); 4225 __ bind(&miss_force_generic);
4226 Code* stub = masm->isolate()->builtins()->builtin( 4226 Code* stub = masm->isolate()->builtins()->builtin(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
4337 if (is_js_array) { 4337 if (is_js_array) {
4338 __ lw(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); 4338 __ lw(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset));
4339 } else { 4339 } else {
4340 __ lw(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); 4340 __ lw(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset));
4341 } 4341 }
4342 // Compare smis. 4342 // Compare smis.
4343 __ Branch(&miss_force_generic, hs, key_reg, Operand(scratch)); 4343 __ Branch(&miss_force_generic, hs, key_reg, Operand(scratch));
4344 4344
4345 __ Addu(scratch, 4345 __ Addu(scratch,
4346 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 4346 elements_reg, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
4347 ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2); 4347 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize < kPointerSizeLog2);
4348 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize); 4348 __ sll(scratch2, key_reg, kPointerSizeLog2 - kSmiTagSize);
4349 __ Addu(scratch3, scratch2, scratch); 4349 __ Addu(scratch3, scratch2, scratch);
4350 __ sw(value_reg, MemOperand(scratch3)); 4350 __ sw(value_reg, MemOperand(scratch3));
4351 __ RecordWrite(scratch, Operand(scratch2), receiver_reg , elements_reg); 4351 __ RecordWrite(scratch, Operand(scratch2), receiver_reg , elements_reg);
4352 4352
4353 // value_reg (a0) is preserved. 4353 // value_reg (a0) is preserved.
4354 // Done. 4354 // Done.
4355 __ Ret(); 4355 __ Ret();
4356 4356
4357 __ bind(&miss_force_generic); 4357 __ bind(&miss_force_generic);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
4421 __ Branch(&maybe_nan, ge, exponent_reg, Operand(scratch)); 4421 __ Branch(&maybe_nan, ge, exponent_reg, Operand(scratch));
4422 4422
4423 __ lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset)); 4423 __ lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset));
4424 4424
4425 __ bind(&have_double_value); 4425 __ bind(&have_double_value);
4426 __ sll(scratch4, key_reg, kDoubleSizeLog2 - kSmiTagSize); 4426 __ sll(scratch4, key_reg, kDoubleSizeLog2 - kSmiTagSize);
4427 __ Addu(scratch, elements_reg, Operand(scratch4)); 4427 __ Addu(scratch, elements_reg, Operand(scratch4));
4428 __ sw(mantissa_reg, FieldMemOperand(scratch, FixedDoubleArray::kHeaderSize)); 4428 __ sw(mantissa_reg, FieldMemOperand(scratch, FixedDoubleArray::kHeaderSize));
4429 uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32); 4429 uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32);
4430 __ sw(exponent_reg, FieldMemOperand(scratch, offset)); 4430 __ sw(exponent_reg, FieldMemOperand(scratch, offset));
4431 __ Ret(); 4431 __ Ret(USE_DELAY_SLOT);
4432 __ mov(v0, value_reg); // In delay slot.
4432 4433
4433 __ bind(&maybe_nan); 4434 __ bind(&maybe_nan);
4434 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise 4435 // Could be NaN or Infinity. If fraction is not zero, it's NaN, otherwise
4435 // it's an Infinity, and the non-NaN code path applies. 4436 // it's an Infinity, and the non-NaN code path applies.
4436 __ li(scratch, Operand(kNaNOrInfinityLowerBoundUpper32)); 4437 __ li(scratch, Operand(kNaNOrInfinityLowerBoundUpper32));
4437 __ Branch(&is_nan, gt, exponent_reg, Operand(scratch)); 4438 __ Branch(&is_nan, gt, exponent_reg, Operand(scratch));
4438 __ lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset)); 4439 __ lw(mantissa_reg, FieldMemOperand(value_reg, HeapNumber::kMantissaOffset));
4439 __ Branch(&have_double_value, eq, mantissa_reg, Operand(zero_reg)); 4440 __ Branch(&have_double_value, eq, mantissa_reg, Operand(zero_reg));
4440 4441
4441 __ bind(&is_nan); 4442 __ bind(&is_nan);
(...skipping 29 matching lines...) Expand all
4471 exponent_reg, 4472 exponent_reg,
4472 scratch4, 4473 scratch4,
4473 f2); 4474 f2);
4474 if (destination == FloatingPointHelper::kFPURegisters) { 4475 if (destination == FloatingPointHelper::kFPURegisters) {
4475 CpuFeatures::Scope scope(FPU); 4476 CpuFeatures::Scope scope(FPU);
4476 __ sdc1(f0, MemOperand(scratch, 0)); 4477 __ sdc1(f0, MemOperand(scratch, 0));
4477 } else { 4478 } else {
4478 __ sw(mantissa_reg, MemOperand(scratch, 0)); 4479 __ sw(mantissa_reg, MemOperand(scratch, 0));
4479 __ sw(exponent_reg, MemOperand(scratch, Register::kSizeInBytes)); 4480 __ sw(exponent_reg, MemOperand(scratch, Register::kSizeInBytes));
4480 } 4481 }
4481 __ Ret(); 4482 __ Ret(USE_DELAY_SLOT);
4483 __ mov(v0, value_reg); // In delay slot.
4482 4484
4483 // Handle store cache miss, replacing the ic with the generic stub. 4485 // Handle store cache miss, replacing the ic with the generic stub.
4484 __ bind(&miss_force_generic); 4486 __ bind(&miss_force_generic);
4485 Handle<Code> ic = 4487 Handle<Code> ic =
4486 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4488 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4487 __ Jump(ic, RelocInfo::CODE_TARGET); 4489 __ Jump(ic, RelocInfo::CODE_TARGET);
4488 } 4490 }
4489 4491
4490 4492
4491 #undef __ 4493 #undef __
4492 4494
4493 } } // namespace v8::internal 4495 } } // namespace v8::internal
4494 4496
4495 #endif // V8_TARGET_ARCH_MIPS 4497 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698