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/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // corresponding offset from the function entry. | 130 // corresponding offset from the function entry. |
131 prologue_offset += Instruction::kInstrSize; | 131 prologue_offset += Instruction::kInstrSize; |
132 __ addi(ip, ip, Operand(prologue_offset)); | 132 __ addi(ip, ip, Operand(prologue_offset)); |
133 } | 133 } |
134 info->set_prologue_offset(prologue_offset); | 134 info->set_prologue_offset(prologue_offset); |
135 __ Prologue(info->GeneratePreagedPrologue(), ip, prologue_offset); | 135 __ Prologue(info->GeneratePreagedPrologue(), ip, prologue_offset); |
136 | 136 |
137 // Increment invocation count for the function. | 137 // Increment invocation count for the function. |
138 { | 138 { |
139 Comment cmnt(masm_, "[ Increment invocation count"); | 139 Comment cmnt(masm_, "[ Increment invocation count"); |
140 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); | 140 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kFeedbackVectorOffset)); |
141 __ LoadP(r7, FieldMemOperand(r7, LiteralsArray::kFeedbackVectorOffset)); | |
142 __ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex * | 141 __ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex * |
143 kPointerSize + | 142 kPointerSize + |
144 TypeFeedbackVector::kHeaderSize)); | 143 TypeFeedbackVector::kHeaderSize)); |
145 __ AddSmiLiteral(r8, r8, Smi::FromInt(1), r0); | 144 __ AddSmiLiteral(r8, r8, Smi::FromInt(1), r0); |
146 __ StoreP(r8, | 145 __ StoreP(r8, |
147 FieldMemOperand( | 146 FieldMemOperand( |
148 r7, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 147 r7, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
149 TypeFeedbackVector::kHeaderSize), | 148 TypeFeedbackVector::kHeaderSize), |
150 r0); | 149 r0); |
151 } | 150 } |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 } | 1179 } |
1181 } | 1180 } |
1182 | 1181 |
1183 | 1182 |
1184 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1183 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
1185 Comment cmnt(masm_, "[ ObjectLiteral"); | 1184 Comment cmnt(masm_, "[ ObjectLiteral"); |
1186 | 1185 |
1187 Handle<BoilerplateDescription> constant_properties = | 1186 Handle<BoilerplateDescription> constant_properties = |
1188 expr->GetOrBuildConstantProperties(isolate()); | 1187 expr->GetOrBuildConstantProperties(isolate()); |
1189 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1188 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1190 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); | 1189 __ LoadSmiLiteral(r5, SmiFromSlot(expr->literal_slot())); |
1191 __ mov(r4, Operand(constant_properties)); | 1190 __ mov(r4, Operand(constant_properties)); |
1192 int flags = expr->ComputeFlags(); | 1191 int flags = expr->ComputeFlags(); |
1193 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); | 1192 __ LoadSmiLiteral(r3, Smi::FromInt(flags)); |
1194 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1193 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1195 __ Push(r6, r5, r4, r3); | 1194 __ Push(r6, r5, r4, r3); |
1196 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1195 __ CallRuntime(Runtime::kCreateObjectLiteral); |
1197 } else { | 1196 } else { |
1198 Callable callable = CodeFactory::FastCloneShallowObject( | 1197 Callable callable = CodeFactory::FastCloneShallowObject( |
1199 isolate(), expr->properties_count()); | 1198 isolate(), expr->properties_count()); |
1200 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1199 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1319 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1321 | 1320 |
1322 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1321 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1323 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1322 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
1324 // If the only customer of allocation sites is transitioning, then | 1323 // If the only customer of allocation sites is transitioning, then |
1325 // we can turn it off if we don't have anywhere else to transition to. | 1324 // we can turn it off if we don't have anywhere else to transition to. |
1326 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1325 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1327 } | 1326 } |
1328 | 1327 |
1329 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1328 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1330 __ LoadSmiLiteral(r5, Smi::FromInt(expr->literal_index())); | 1329 __ LoadSmiLiteral(r5, SmiFromSlot(expr->literal_slot())); |
1331 __ mov(r4, Operand(constant_elements)); | 1330 __ mov(r4, Operand(constant_elements)); |
1332 if (MustCreateArrayLiteralWithRuntime(expr)) { | 1331 if (MustCreateArrayLiteralWithRuntime(expr)) { |
1333 __ LoadSmiLiteral(r3, Smi::FromInt(expr->ComputeFlags())); | 1332 __ LoadSmiLiteral(r3, Smi::FromInt(expr->ComputeFlags())); |
1334 __ Push(r6, r5, r4, r3); | 1333 __ Push(r6, r5, r4, r3); |
1335 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1334 __ CallRuntime(Runtime::kCreateArrayLiteral); |
1336 } else { | 1335 } else { |
1337 Callable callable = | 1336 Callable callable = |
1338 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); | 1337 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); |
1339 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1338 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1340 RestoreContext(); | 1339 RestoreContext(); |
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2848 | 2847 |
2849 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 2848 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
2850 | 2849 |
2851 DCHECK(interrupt_address == | 2850 DCHECK(interrupt_address == |
2852 isolate->builtins()->OnStackReplacement()->entry()); | 2851 isolate->builtins()->OnStackReplacement()->entry()); |
2853 return ON_STACK_REPLACEMENT; | 2852 return ON_STACK_REPLACEMENT; |
2854 } | 2853 } |
2855 } // namespace internal | 2854 } // namespace internal |
2856 } // namespace v8 | 2855 } // namespace v8 |
2857 #endif // V8_TARGET_ARCH_PPC | 2856 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |