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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 145133013: External Array renaming and boilerplate scrapping (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
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 3391 matching lines...) Expand 10 before | Expand all | Expand 10 after
3402 elements_kind)) { 3402 elements_kind)) {
3403 __ SmiUntag(ToRegister(key)); 3403 __ SmiUntag(ToRegister(key));
3404 } 3404 }
3405 Operand operand(BuildFastArrayOperand( 3405 Operand operand(BuildFastArrayOperand(
3406 instr->elements(), 3406 instr->elements(),
3407 key, 3407 key,
3408 instr->hydrogen()->key()->representation(), 3408 instr->hydrogen()->key()->representation(),
3409 elements_kind, 3409 elements_kind,
3410 0, 3410 0,
3411 instr->additional_index())); 3411 instr->additional_index()));
3412 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || 3412 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
3413 elements_kind == FLOAT32_ELEMENTS) { 3413 elements_kind == FLOAT32_ELEMENTS) {
3414 if (CpuFeatures::IsSupported(SSE2)) { 3414 if (CpuFeatures::IsSupported(SSE2)) {
3415 CpuFeatureScope scope(masm(), SSE2); 3415 CpuFeatureScope scope(masm(), SSE2);
3416 XMMRegister result(ToDoubleRegister(instr->result())); 3416 XMMRegister result(ToDoubleRegister(instr->result()));
3417 __ movss(result, operand); 3417 __ movss(result, operand);
3418 __ cvtss2sd(result, result); 3418 __ cvtss2sd(result, result);
3419 } else { 3419 } else {
3420 X87Mov(ToX87Register(instr->result()), operand, kX87FloatOperand); 3420 X87Mov(ToX87Register(instr->result()), operand, kX87FloatOperand);
3421 } 3421 }
3422 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS || 3422 } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
3423 elements_kind == FLOAT64_ELEMENTS) { 3423 elements_kind == FLOAT64_ELEMENTS) {
3424 if (CpuFeatures::IsSupported(SSE2)) { 3424 if (CpuFeatures::IsSupported(SSE2)) {
3425 CpuFeatureScope scope(masm(), SSE2); 3425 CpuFeatureScope scope(masm(), SSE2);
3426 __ movsd(ToDoubleRegister(instr->result()), operand); 3426 __ movsd(ToDoubleRegister(instr->result()), operand);
3427 } else { 3427 } else {
3428 X87Mov(ToX87Register(instr->result()), operand); 3428 X87Mov(ToX87Register(instr->result()), operand);
3429 } 3429 }
3430 } else { 3430 } else {
3431 Register result(ToRegister(instr->result())); 3431 Register result(ToRegister(instr->result()));
3432 switch (elements_kind) { 3432 switch (elements_kind) {
3433 case EXTERNAL_BYTE_ELEMENTS: 3433 case EXTERNAL_INT8_ELEMENTS:
3434 case INT8_ELEMENTS: 3434 case INT8_ELEMENTS:
3435 __ movsx_b(result, operand); 3435 __ movsx_b(result, operand);
3436 break; 3436 break;
3437 case EXTERNAL_PIXEL_ELEMENTS: 3437 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
3438 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 3438 case EXTERNAL_UINT8_ELEMENTS:
3439 case UINT8_ELEMENTS: 3439 case UINT8_ELEMENTS:
3440 case UINT8_CLAMPED_ELEMENTS: 3440 case UINT8_CLAMPED_ELEMENTS:
3441 __ movzx_b(result, operand); 3441 __ movzx_b(result, operand);
3442 break; 3442 break;
3443 case EXTERNAL_SHORT_ELEMENTS: 3443 case EXTERNAL_INT16_ELEMENTS:
3444 case INT16_ELEMENTS: 3444 case INT16_ELEMENTS:
3445 __ movsx_w(result, operand); 3445 __ movsx_w(result, operand);
3446 break; 3446 break;
3447 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 3447 case EXTERNAL_UINT16_ELEMENTS:
3448 case UINT16_ELEMENTS: 3448 case UINT16_ELEMENTS:
3449 __ movzx_w(result, operand); 3449 __ movzx_w(result, operand);
3450 break; 3450 break;
3451 case EXTERNAL_INT_ELEMENTS: 3451 case EXTERNAL_INT32_ELEMENTS:
3452 case INT32_ELEMENTS: 3452 case INT32_ELEMENTS:
3453 __ mov(result, operand); 3453 __ mov(result, operand);
3454 break; 3454 break;
3455 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 3455 case EXTERNAL_UINT32_ELEMENTS:
3456 case UINT32_ELEMENTS: 3456 case UINT32_ELEMENTS:
3457 __ mov(result, operand); 3457 __ mov(result, operand);
3458 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { 3458 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
3459 __ test(result, Operand(result)); 3459 __ test(result, Operand(result));
3460 DeoptimizeIf(negative, instr->environment()); 3460 DeoptimizeIf(negative, instr->environment());
3461 } 3461 }
3462 break; 3462 break;
3463 case EXTERNAL_FLOAT_ELEMENTS: 3463 case EXTERNAL_FLOAT32_ELEMENTS:
3464 case EXTERNAL_DOUBLE_ELEMENTS: 3464 case EXTERNAL_FLOAT64_ELEMENTS:
3465 case FLOAT32_ELEMENTS: 3465 case FLOAT32_ELEMENTS:
3466 case FLOAT64_ELEMENTS: 3466 case FLOAT64_ELEMENTS:
3467 case FAST_SMI_ELEMENTS: 3467 case FAST_SMI_ELEMENTS:
3468 case FAST_ELEMENTS: 3468 case FAST_ELEMENTS:
3469 case FAST_DOUBLE_ELEMENTS: 3469 case FAST_DOUBLE_ELEMENTS:
3470 case FAST_HOLEY_SMI_ELEMENTS: 3470 case FAST_HOLEY_SMI_ELEMENTS:
3471 case FAST_HOLEY_ELEMENTS: 3471 case FAST_HOLEY_ELEMENTS:
3472 case FAST_HOLEY_DOUBLE_ELEMENTS: 3472 case FAST_HOLEY_DOUBLE_ELEMENTS:
3473 case DICTIONARY_ELEMENTS: 3473 case DICTIONARY_ELEMENTS:
3474 case NON_STRICT_ARGUMENTS_ELEMENTS: 3474 case NON_STRICT_ARGUMENTS_ELEMENTS:
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
4532 elements_kind)) { 4532 elements_kind)) {
4533 __ SmiUntag(ToRegister(key)); 4533 __ SmiUntag(ToRegister(key));
4534 } 4534 }
4535 Operand operand(BuildFastArrayOperand( 4535 Operand operand(BuildFastArrayOperand(
4536 instr->elements(), 4536 instr->elements(),
4537 key, 4537 key,
4538 instr->hydrogen()->key()->representation(), 4538 instr->hydrogen()->key()->representation(),
4539 elements_kind, 4539 elements_kind,
4540 0, 4540 0,
4541 instr->additional_index())); 4541 instr->additional_index()));
4542 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || 4542 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
4543 elements_kind == FLOAT32_ELEMENTS) { 4543 elements_kind == FLOAT32_ELEMENTS) {
4544 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 4544 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
4545 CpuFeatureScope scope(masm(), SSE2); 4545 CpuFeatureScope scope(masm(), SSE2);
4546 XMMRegister xmm_scratch = double_scratch0(); 4546 XMMRegister xmm_scratch = double_scratch0();
4547 __ cvtsd2ss(xmm_scratch, ToDoubleRegister(instr->value())); 4547 __ cvtsd2ss(xmm_scratch, ToDoubleRegister(instr->value()));
4548 __ movss(operand, xmm_scratch); 4548 __ movss(operand, xmm_scratch);
4549 } else { 4549 } else {
4550 __ fld(0); 4550 __ fld(0);
4551 __ fstp_s(operand); 4551 __ fstp_s(operand);
4552 } 4552 }
4553 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS || 4553 } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
4554 elements_kind == FLOAT64_ELEMENTS) { 4554 elements_kind == FLOAT64_ELEMENTS) {
4555 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { 4555 if (CpuFeatures::IsSafeForSnapshot(SSE2)) {
4556 CpuFeatureScope scope(masm(), SSE2); 4556 CpuFeatureScope scope(masm(), SSE2);
4557 __ movsd(operand, ToDoubleRegister(instr->value())); 4557 __ movsd(operand, ToDoubleRegister(instr->value()));
4558 } else { 4558 } else {
4559 X87Mov(operand, ToX87Register(instr->value())); 4559 X87Mov(operand, ToX87Register(instr->value()));
4560 } 4560 }
4561 } else { 4561 } else {
4562 Register value = ToRegister(instr->value()); 4562 Register value = ToRegister(instr->value());
4563 switch (elements_kind) { 4563 switch (elements_kind) {
4564 case EXTERNAL_PIXEL_ELEMENTS: 4564 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
4565 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 4565 case EXTERNAL_UINT8_ELEMENTS:
4566 case EXTERNAL_BYTE_ELEMENTS: 4566 case EXTERNAL_INT8_ELEMENTS:
4567 case UINT8_ELEMENTS: 4567 case UINT8_ELEMENTS:
4568 case INT8_ELEMENTS: 4568 case INT8_ELEMENTS:
4569 case UINT8_CLAMPED_ELEMENTS: 4569 case UINT8_CLAMPED_ELEMENTS:
4570 __ mov_b(operand, value); 4570 __ mov_b(operand, value);
4571 break; 4571 break;
4572 case EXTERNAL_SHORT_ELEMENTS: 4572 case EXTERNAL_INT16_ELEMENTS:
4573 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 4573 case EXTERNAL_UINT16_ELEMENTS:
4574 case UINT16_ELEMENTS: 4574 case UINT16_ELEMENTS:
4575 case INT16_ELEMENTS: 4575 case INT16_ELEMENTS:
4576 __ mov_w(operand, value); 4576 __ mov_w(operand, value);
4577 break; 4577 break;
4578 case EXTERNAL_INT_ELEMENTS: 4578 case EXTERNAL_INT32_ELEMENTS:
4579 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 4579 case EXTERNAL_UINT32_ELEMENTS:
4580 case UINT32_ELEMENTS: 4580 case UINT32_ELEMENTS:
4581 case INT32_ELEMENTS: 4581 case INT32_ELEMENTS:
4582 __ mov(operand, value); 4582 __ mov(operand, value);
4583 break; 4583 break;
4584 case EXTERNAL_FLOAT_ELEMENTS: 4584 case EXTERNAL_FLOAT32_ELEMENTS:
4585 case EXTERNAL_DOUBLE_ELEMENTS: 4585 case EXTERNAL_FLOAT64_ELEMENTS:
4586 case FLOAT32_ELEMENTS: 4586 case FLOAT32_ELEMENTS:
4587 case FLOAT64_ELEMENTS: 4587 case FLOAT64_ELEMENTS:
4588 case FAST_SMI_ELEMENTS: 4588 case FAST_SMI_ELEMENTS:
4589 case FAST_ELEMENTS: 4589 case FAST_ELEMENTS:
4590 case FAST_DOUBLE_ELEMENTS: 4590 case FAST_DOUBLE_ELEMENTS:
4591 case FAST_HOLEY_SMI_ELEMENTS: 4591 case FAST_HOLEY_SMI_ELEMENTS:
4592 case FAST_HOLEY_ELEMENTS: 4592 case FAST_HOLEY_ELEMENTS:
4593 case FAST_HOLEY_DOUBLE_ELEMENTS: 4593 case FAST_HOLEY_DOUBLE_ELEMENTS:
4594 case DICTIONARY_ELEMENTS: 4594 case DICTIONARY_ELEMENTS:
4595 case NON_STRICT_ARGUMENTS_ELEMENTS: 4595 case NON_STRICT_ARGUMENTS_ELEMENTS:
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
6356 FixedArray::kHeaderSize - kPointerSize)); 6356 FixedArray::kHeaderSize - kPointerSize));
6357 __ bind(&done); 6357 __ bind(&done);
6358 } 6358 }
6359 6359
6360 6360
6361 #undef __ 6361 #undef __
6362 6362
6363 } } // namespace v8::internal 6363 } } // namespace v8::internal
6364 6364
6365 #endif // V8_TARGET_ARCH_IA32 6365 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/api.cc ('K') | « src/hydrogen-uint32-analysis.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698