| Index: src/arm/lithium-codegen-arm.cc
|
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
|
| index c05b0875827d5555cf7e54ba9a78aae7cd0c29e1..4b210f3acabcdc04b242cd731d4f0ac73c68444f 100644
|
| --- a/src/arm/lithium-codegen-arm.cc
|
| +++ b/src/arm/lithium-codegen-arm.cc
|
| @@ -747,10 +747,6 @@ void LCodeGen::DoCallStub(LCallStub* instr) {
|
| CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
|
| break;
|
| }
|
| - case CodeStub::MathPow: {
|
| - Abort("MathPowStub unimplemented.");
|
| - break;
|
| - }
|
| case CodeStub::NumberToString: {
|
| NumberToStringStub stub;
|
| CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
|
| @@ -1139,10 +1135,10 @@ void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) {
|
| +void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) {
|
| Register result = ToRegister(instr->result());
|
| Register array = ToRegister(instr->InputAt(0));
|
| - __ ldr(result, FieldMemOperand(array, PixelArray::kLengthOffset));
|
| + __ ldr(result, FieldMemOperand(array, ExternalArray::kLengthOffset));
|
| }
|
|
|
|
|
| @@ -2210,7 +2206,7 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) {
|
| __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
|
| __ cmp(scratch, ip);
|
| __ b(eq, &done);
|
| - __ LoadRoot(ip, Heap::kPixelArrayMapRootIndex);
|
| + __ LoadRoot(ip, Heap::kExternalPixelArrayMapRootIndex);
|
| __ cmp(scratch, ip);
|
| __ b(eq, &done);
|
| __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
|
| @@ -2221,11 +2217,12 @@ void LCodeGen::DoLoadElements(LLoadElements* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoLoadPixelArrayExternalPointer(
|
| - LLoadPixelArrayExternalPointer* instr) {
|
| +void LCodeGen::DoLoadExternalArrayPointer(
|
| + LLoadExternalArrayPointer* instr) {
|
| Register to_reg = ToRegister(instr->result());
|
| Register from_reg = ToRegister(instr->InputAt(0));
|
| - __ ldr(to_reg, FieldMemOperand(from_reg, PixelArray::kExternalPointerOffset));
|
| + __ ldr(to_reg, FieldMemOperand(from_reg,
|
| + ExternalArray::kExternalPointerOffset));
|
| }
|
|
|
|
|
| @@ -2266,12 +2263,12 @@ void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) {
|
|
|
|
|
| void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) {
|
| - Register external_elements = ToRegister(instr->external_pointer());
|
| + Register external_pointer = ToRegister(instr->external_pointer());
|
| Register key = ToRegister(instr->key());
|
| Register result = ToRegister(instr->result());
|
|
|
| // Load the result.
|
| - __ ldrb(result, MemOperand(external_elements, key));
|
| + __ ldrb(result, MemOperand(external_pointer, key));
|
| }
|
|
|
|
|
| @@ -2650,6 +2647,22 @@ void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoMathPowHalf(LUnaryMathOperation* instr) {
|
| + DoubleRegister input = ToDoubleRegister(instr->InputAt(0));
|
| + Register scratch = scratch0();
|
| + SwVfpRegister single_scratch = double_scratch0().low();
|
| + DoubleRegister double_scratch = double_scratch0();
|
| + ASSERT(ToDoubleRegister(instr->result()).is(input));
|
| +
|
| + // Add +0 to convert -0 to +0.
|
| + __ mov(scratch, Operand(0));
|
| + __ vmov(single_scratch, scratch);
|
| + __ vcvt_f64_s32(double_scratch, single_scratch);
|
| + __ vadd(input, input, double_scratch);
|
| + __ vsqrt(input, input);
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoPower(LPower* instr) {
|
| LOperand* left = instr->InputAt(0);
|
| LOperand* right = instr->InputAt(1);
|
| @@ -2746,6 +2759,9 @@ void LCodeGen::DoUnaryMathOperation(LUnaryMathOperation* instr) {
|
| case kMathSqrt:
|
| DoMathSqrt(instr);
|
| break;
|
| + case kMathPowHalf:
|
| + DoMathPowHalf(instr);
|
| + break;
|
| case kMathCos:
|
| DoMathCos(instr);
|
| break;
|
| @@ -2911,6 +2927,17 @@ void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoStorePixelArrayElement(LStorePixelArrayElement* instr) {
|
| + Register external_pointer = ToRegister(instr->external_pointer());
|
| + Register key = ToRegister(instr->key());
|
| + Register value = ToRegister(instr->value());
|
| +
|
| + // Clamp the value to [0..255].
|
| + __ Usat(value, 8, Operand(value));
|
| + __ strb(value, MemOperand(external_pointer, key, LSL, 0));
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
|
| ASSERT(ToRegister(instr->object()).is(r2));
|
| ASSERT(ToRegister(instr->key()).is(r1));
|
|
|