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

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

Issue 10209027: Implement tracking and optimizations of packed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New upload Created 8 years, 8 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7041 matching lines...) Expand 10 before | Expand all | Expand 10 after
7052 // GenerateStoreField calls the stub with two different permutations of 7052 // GenerateStoreField calls the stub with two different permutations of
7053 // registers. This is the second. 7053 // registers. This is the second.
7054 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET }, 7054 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET },
7055 // StoreIC::GenerateNormal via GenerateDictionaryStore 7055 // StoreIC::GenerateNormal via GenerateDictionaryStore
7056 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET }, 7056 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET },
7057 // KeyedStoreIC::GenerateGeneric. 7057 // KeyedStoreIC::GenerateGeneric.
7058 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET}, 7058 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET},
7059 // KeyedStoreStubCompiler::GenerateStoreFastElement. 7059 // KeyedStoreStubCompiler::GenerateStoreFastElement.
7060 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET}, 7060 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET},
7061 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET}, 7061 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET},
7062 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 7062 // ElementsTransitionGenerator::GenerateMapChangeElementTransition
7063 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble 7063 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble
7064 // and ElementsTransitionGenerator::GenerateDoubleToObject 7064 // and ElementsTransitionGenerator::GenerateDoubleToObject
7065 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, 7065 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET},
7066 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, 7066 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET},
7067 // ElementsTransitionGenerator::GenerateDoubleToObject 7067 // ElementsTransitionGenerator::GenerateDoubleToObject
7068 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, 7068 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET},
7069 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, 7069 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET},
7070 // StoreArrayLiteralElementStub::Generate 7070 // StoreArrayLiteralElementStub::Generate
7071 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, 7071 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET},
7072 // Null termination. 7072 // Null termination.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7325 7325
7326 Label element_done; 7326 Label element_done;
7327 Label double_elements; 7327 Label double_elements;
7328 Label smi_element; 7328 Label smi_element;
7329 Label slow_elements; 7329 Label slow_elements;
7330 Label slow_elements_from_double; 7330 Label slow_elements_from_double;
7331 Label fast_elements; 7331 Label fast_elements;
7332 7332
7333 __ CheckFastElements(edi, &double_elements); 7333 __ CheckFastElements(edi, &double_elements);
7334 7334
7335 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS 7335 // Check for Smi-only or Object elements
7336 __ JumpIfSmi(eax, &smi_element); 7336 __ JumpIfSmi(eax, &smi_element);
7337 __ CheckFastSmiOnlyElements(edi, &fast_elements, Label::kNear); 7337 __ CheckFastSmiOnlyElements(edi, &fast_elements, Label::kNear);
7338 7338
7339 // Store into the array literal requires a elements transition. Call into 7339 // Store into the array literal requires a elements transition. Call into
7340 // the runtime. 7340 // the runtime.
7341 7341
7342 __ bind(&slow_elements); 7342 __ bind(&slow_elements);
7343 __ pop(edi); // Pop return address and remember to put back later for tail 7343 __ pop(edi); // Pop return address and remember to put back later for tail
7344 // call. 7344 // call.
7345 __ push(ebx); 7345 __ push(ebx);
7346 __ push(ecx); 7346 __ push(ecx);
7347 __ push(eax); 7347 __ push(eax);
7348 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 7348 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
7349 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); 7349 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
7350 __ push(edx); 7350 __ push(edx);
7351 __ push(edi); // Return return address so that tail call returns to right 7351 __ push(edi); // Return return address so that tail call returns to right
7352 // place. 7352 // place.
7353 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); 7353 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1);
7354 7354
7355 __ bind(&slow_elements_from_double); 7355 __ bind(&slow_elements_from_double);
7356 __ pop(edx); 7356 __ pop(edx);
7357 __ jmp(&slow_elements); 7357 __ jmp(&slow_elements);
7358 7358
7359 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. 7359 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object.
7360 __ bind(&fast_elements); 7360 __ bind(&fast_elements);
7361 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); 7361 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset));
7362 __ lea(ecx, FieldOperand(ebx, ecx, times_half_pointer_size, 7362 __ lea(ecx, FieldOperand(ebx, ecx, times_half_pointer_size,
7363 FixedArrayBase::kHeaderSize)); 7363 FixedArrayBase::kHeaderSize));
7364 __ mov(Operand(ecx, 0), eax); 7364 __ mov(Operand(ecx, 0), eax);
7365 // Update the write barrier for the array store. 7365 // Update the write barrier for the array store.
7366 __ RecordWrite(ebx, ecx, eax, 7366 __ RecordWrite(ebx, ecx, eax,
7367 kDontSaveFPRegs, 7367 kDontSaveFPRegs,
7368 EMIT_REMEMBERED_SET, 7368 EMIT_REMEMBERED_SET,
7369 OMIT_SMI_CHECK); 7369 OMIT_SMI_CHECK);
7370 __ ret(0); 7370 __ ret(0);
7371 7371
7372 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or 7372 // Array literal has ElementsKind of Smi-only or Object, and value is Smi.
7373 // FAST_ELEMENTS, and value is Smi.
7374 __ bind(&smi_element); 7373 __ bind(&smi_element);
7375 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); 7374 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset));
7376 __ mov(FieldOperand(ebx, ecx, times_half_pointer_size, 7375 __ mov(FieldOperand(ebx, ecx, times_half_pointer_size,
7377 FixedArrayBase::kHeaderSize), eax); 7376 FixedArrayBase::kHeaderSize), eax);
7378 __ ret(0); 7377 __ ret(0);
7379 7378
7380 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. 7379 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
7381 __ bind(&double_elements); 7380 __ bind(&double_elements);
7382 7381
7383 __ push(edx); 7382 __ push(edx);
7384 __ mov(edx, FieldOperand(ebx, JSObject::kElementsOffset)); 7383 __ mov(edx, FieldOperand(ebx, JSObject::kElementsOffset));
7385 __ StoreNumberToDoubleElements(eax, 7384 __ StoreNumberToDoubleElements(eax,
7386 edx, 7385 edx,
7387 ecx, 7386 ecx,
7388 edi, 7387 edi,
7389 xmm0, 7388 xmm0,
7390 &slow_elements_from_double, 7389 &slow_elements_from_double,
7391 false); 7390 false);
7392 __ pop(edx); 7391 __ pop(edx);
7393 __ ret(0); 7392 __ ret(0);
7394 } 7393 }
7395 7394
7396 #undef __ 7395 #undef __
7397 7396
7398 } } // namespace v8::internal 7397 } } // namespace v8::internal
7399 7398
7400 #endif // V8_TARGET_ARCH_IA32 7399 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ia32/codegen-ia32.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698