OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 355 } |
356 EmitReturnSequence(); | 356 EmitReturnSequence(); |
357 | 357 |
358 if (HasStackOverflow()) { | 358 if (HasStackOverflow()) { |
359 masm_->AbortConstantPoolBuilding(); | 359 masm_->AbortConstantPoolBuilding(); |
360 } | 360 } |
361 } | 361 } |
362 | 362 |
363 | 363 |
364 void FullCodeGenerator::ClearAccumulator() { | 364 void FullCodeGenerator::ClearAccumulator() { |
365 __ LoadSmiLiteral(r3, Smi::kZero); | 365 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
366 } | 366 } |
367 | 367 |
368 | 368 |
369 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { | 369 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { |
370 __ mov(r5, Operand(profiling_counter_)); | 370 __ mov(r5, Operand(profiling_counter_)); |
371 __ LoadP(r6, FieldMemOperand(r5, Cell::kValueOffset)); | 371 __ LoadP(r6, FieldMemOperand(r5, Cell::kValueOffset)); |
372 __ SubSmiLiteral(r6, r6, Smi::FromInt(delta), r0); | 372 __ SubSmiLiteral(r6, r6, Smi::FromInt(delta), r0); |
373 __ StoreP(r6, FieldMemOperand(r5, Cell::kValueOffset), r0); | 373 __ StoreP(r6, FieldMemOperand(r5, Cell::kValueOffset), r0); |
374 } | 374 } |
375 | 375 |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 __ LoadP(r5, FieldMemOperand(r3, HeapObject::kMapOffset)); | 1008 __ LoadP(r5, FieldMemOperand(r3, HeapObject::kMapOffset)); |
1009 __ LoadRoot(ip, Heap::kMetaMapRootIndex); | 1009 __ LoadRoot(ip, Heap::kMetaMapRootIndex); |
1010 __ cmp(r5, ip); | 1010 __ cmp(r5, ip); |
1011 __ bne(&fixed_array); | 1011 __ bne(&fixed_array); |
1012 | 1012 |
1013 // We got a map in register r3. Get the enumeration cache from it. | 1013 // We got a map in register r3. Get the enumeration cache from it. |
1014 Label no_descriptors; | 1014 Label no_descriptors; |
1015 __ bind(&use_cache); | 1015 __ bind(&use_cache); |
1016 | 1016 |
1017 __ EnumLength(r4, r3); | 1017 __ EnumLength(r4, r3); |
1018 __ CmpSmiLiteral(r4, Smi::kZero, r0); | 1018 __ CmpSmiLiteral(r4, Smi::FromInt(0), r0); |
1019 __ beq(&no_descriptors); | 1019 __ beq(&no_descriptors); |
1020 | 1020 |
1021 __ LoadInstanceDescriptors(r3, r5); | 1021 __ LoadInstanceDescriptors(r3, r5); |
1022 __ LoadP(r5, FieldMemOperand(r5, DescriptorArray::kEnumCacheOffset)); | 1022 __ LoadP(r5, FieldMemOperand(r5, DescriptorArray::kEnumCacheOffset)); |
1023 __ LoadP(r5, | 1023 __ LoadP(r5, |
1024 FieldMemOperand(r5, DescriptorArray::kEnumCacheBridgeCacheOffset)); | 1024 FieldMemOperand(r5, DescriptorArray::kEnumCacheBridgeCacheOffset)); |
1025 | 1025 |
1026 // Set up the four remaining stack slots. | 1026 // Set up the four remaining stack slots. |
1027 __ push(r3); // Map. | 1027 __ push(r3); // Map. |
1028 __ LoadSmiLiteral(r3, Smi::kZero); | 1028 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1029 // Push enumeration cache, enumeration cache length (as smi) and zero. | 1029 // Push enumeration cache, enumeration cache length (as smi) and zero. |
1030 __ Push(r5, r4, r3); | 1030 __ Push(r5, r4, r3); |
1031 __ b(&loop); | 1031 __ b(&loop); |
1032 | 1032 |
1033 __ bind(&no_descriptors); | 1033 __ bind(&no_descriptors); |
1034 __ Drop(1); | 1034 __ Drop(1); |
1035 __ b(&exit); | 1035 __ b(&exit); |
1036 | 1036 |
1037 // We got a fixed array in register r3. Iterate through that. | 1037 // We got a fixed array in register r3. Iterate through that. |
1038 __ bind(&fixed_array); | 1038 __ bind(&fixed_array); |
1039 | 1039 |
1040 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check | 1040 __ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check |
1041 __ Push(r4, r3); // Smi and array | 1041 __ Push(r4, r3); // Smi and array |
1042 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 1042 __ LoadP(r4, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
1043 __ Push(r4); // Fixed array length (as smi). | 1043 __ Push(r4); // Fixed array length (as smi). |
1044 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); | 1044 PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); |
1045 __ LoadSmiLiteral(r3, Smi::kZero); | 1045 __ LoadSmiLiteral(r3, Smi::FromInt(0)); |
1046 __ Push(r3); // Initial index. | 1046 __ Push(r3); // Initial index. |
1047 | 1047 |
1048 // Generate code for doing the condition check. | 1048 // Generate code for doing the condition check. |
1049 __ bind(&loop); | 1049 __ bind(&loop); |
1050 SetExpressionAsStatementPosition(stmt->each()); | 1050 SetExpressionAsStatementPosition(stmt->each()); |
1051 | 1051 |
1052 // Load the current count to r3, load the length to r4. | 1052 // Load the current count to r3, load the length to r4. |
1053 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); | 1053 __ LoadP(r3, MemOperand(sp, 0 * kPointerSize)); |
1054 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); | 1054 __ LoadP(r4, MemOperand(sp, 1 * kPointerSize)); |
1055 __ cmpl(r3, r4); // Compare to the array length. | 1055 __ cmpl(r3, r4); // Compare to the array length. |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 #else | 1929 #else |
1930 __ mr(right, scratch1); | 1930 __ mr(right, scratch1); |
1931 #endif | 1931 #endif |
1932 __ b(&done); | 1932 __ b(&done); |
1933 // We need -0 if we were multiplying a negative number with 0 to get 0. | 1933 // We need -0 if we were multiplying a negative number with 0 to get 0. |
1934 // We know one of them was zero. | 1934 // We know one of them was zero. |
1935 __ bind(&mul_zero); | 1935 __ bind(&mul_zero); |
1936 __ add(scratch2, right, left); | 1936 __ add(scratch2, right, left); |
1937 __ cmpi(scratch2, Operand::Zero()); | 1937 __ cmpi(scratch2, Operand::Zero()); |
1938 __ blt(&stub_call); | 1938 __ blt(&stub_call); |
1939 __ LoadSmiLiteral(right, Smi::kZero); | 1939 __ LoadSmiLiteral(right, Smi::FromInt(0)); |
1940 break; | 1940 break; |
1941 } | 1941 } |
1942 case Token::BIT_OR: | 1942 case Token::BIT_OR: |
1943 __ orx(right, left, right); | 1943 __ orx(right, left, right); |
1944 break; | 1944 break; |
1945 case Token::BIT_AND: | 1945 case Token::BIT_AND: |
1946 __ and_(right, left, right); | 1946 __ and_(right, left, right); |
1947 break; | 1947 break; |
1948 case Token::BIT_XOR: | 1948 case Token::BIT_XOR: |
1949 __ xor_(right, left, right); | 1949 __ xor_(right, left, right); |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3067 LhsKind assign_type = Property::GetAssignType(prop); | 3067 LhsKind assign_type = Property::GetAssignType(prop); |
3068 | 3068 |
3069 // Evaluate expression and get value. | 3069 // Evaluate expression and get value. |
3070 if (assign_type == VARIABLE) { | 3070 if (assign_type == VARIABLE) { |
3071 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL); | 3071 DCHECK(expr->expression()->AsVariableProxy()->var() != NULL); |
3072 AccumulatorValueContext context(this); | 3072 AccumulatorValueContext context(this); |
3073 EmitVariableLoad(expr->expression()->AsVariableProxy()); | 3073 EmitVariableLoad(expr->expression()->AsVariableProxy()); |
3074 } else { | 3074 } else { |
3075 // Reserve space for result of postfix operation. | 3075 // Reserve space for result of postfix operation. |
3076 if (expr->is_postfix() && !context()->IsEffect()) { | 3076 if (expr->is_postfix() && !context()->IsEffect()) { |
3077 __ LoadSmiLiteral(ip, Smi::kZero); | 3077 __ LoadSmiLiteral(ip, Smi::FromInt(0)); |
3078 PushOperand(ip); | 3078 PushOperand(ip); |
3079 } | 3079 } |
3080 switch (assign_type) { | 3080 switch (assign_type) { |
3081 case NAMED_PROPERTY: { | 3081 case NAMED_PROPERTY: { |
3082 // Put the object both on the stack and in the register. | 3082 // Put the object both on the stack and in the register. |
3083 VisitForStackValue(prop->obj()); | 3083 VisitForStackValue(prop->obj()); |
3084 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); | 3084 __ LoadP(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
3085 EmitNamedPropertyLoad(prop); | 3085 EmitNamedPropertyLoad(prop); |
3086 break; | 3086 break; |
3087 } | 3087 } |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3657 | 3657 |
3658 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3658 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3659 | 3659 |
3660 DCHECK(interrupt_address == | 3660 DCHECK(interrupt_address == |
3661 isolate->builtins()->OnStackReplacement()->entry()); | 3661 isolate->builtins()->OnStackReplacement()->entry()); |
3662 return ON_STACK_REPLACEMENT; | 3662 return ON_STACK_REPLACEMENT; |
3663 } | 3663 } |
3664 } // namespace internal | 3664 } // namespace internal |
3665 } // namespace v8 | 3665 } // namespace v8 |
3666 #endif // V8_TARGET_ARCH_PPC | 3666 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |