| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Open a frame scope to indicate that there is a frame on the stack. The | 133 // Open a frame scope to indicate that there is a frame on the stack. The |
| 134 // MANUAL indicates that the scope shouldn't actually generate code to set up | 134 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 135 // the frame (that is done below). | 135 // the frame (that is done below). |
| 136 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 136 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 137 info->set_prologue_offset(masm_->pc_offset()); | 137 info->set_prologue_offset(masm_->pc_offset()); |
| 138 __ Prologue(info->GeneratePreagedPrologue()); | 138 __ Prologue(info->GeneratePreagedPrologue()); |
| 139 | 139 |
| 140 // Increment invocation count for the function. | 140 // Increment invocation count for the function. |
| 141 { | 141 { |
| 142 Comment cmnt(masm_, "[ Increment invocation count"); | 142 Comment cmnt(masm_, "[ Increment invocation count"); |
| 143 __ ld(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset)); | 143 __ ld(a0, FieldMemOperand(a1, JSFunction::kFeedbackVectorOffset)); |
| 144 __ ld(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset)); | |
| 145 __ ld(a4, FieldMemOperand( | 144 __ ld(a4, FieldMemOperand( |
| 146 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 145 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 147 TypeFeedbackVector::kHeaderSize)); | 146 TypeFeedbackVector::kHeaderSize)); |
| 148 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); | 147 __ Daddu(a4, a4, Operand(Smi::FromInt(1))); |
| 149 __ sd(a4, FieldMemOperand( | 148 __ sd(a4, FieldMemOperand( |
| 150 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 149 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 151 TypeFeedbackVector::kHeaderSize)); | 150 TypeFeedbackVector::kHeaderSize)); |
| 152 } | 151 } |
| 153 | 152 |
| 154 { Comment cmnt(masm_, "[ Allocate locals"); | 153 { Comment cmnt(masm_, "[ Allocate locals"); |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 } | 1210 } |
| 1212 } | 1211 } |
| 1213 | 1212 |
| 1214 | 1213 |
| 1215 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { | 1214 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| 1216 Comment cmnt(masm_, "[ ObjectLiteral"); | 1215 Comment cmnt(masm_, "[ ObjectLiteral"); |
| 1217 | 1216 |
| 1218 Handle<FixedArray> constant_properties = | 1217 Handle<FixedArray> constant_properties = |
| 1219 expr->GetOrBuildConstantProperties(isolate()); | 1218 expr->GetOrBuildConstantProperties(isolate()); |
| 1220 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1219 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1221 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1220 __ li(a2, Operand(SmiFromSlot(expr->literal_slot()))); |
| 1222 __ li(a1, Operand(constant_properties)); | 1221 __ li(a1, Operand(constant_properties)); |
| 1223 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); | 1222 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); |
| 1224 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1223 if (MustCreateObjectLiteralWithRuntime(expr)) { |
| 1225 __ Push(a3, a2, a1, a0); | 1224 __ Push(a3, a2, a1, a0); |
| 1226 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1225 __ CallRuntime(Runtime::kCreateObjectLiteral); |
| 1227 } else { | 1226 } else { |
| 1228 Callable callable = CodeFactory::FastCloneShallowObject( | 1227 Callable callable = CodeFactory::FastCloneShallowObject( |
| 1229 isolate(), expr->properties_count()); | 1228 isolate(), expr->properties_count()); |
| 1230 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1229 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 1231 RestoreContext(); | 1230 RestoreContext(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 | 1352 |
| 1354 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1353 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
| 1355 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1354 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
| 1356 // If the only customer of allocation sites is transitioning, then | 1355 // If the only customer of allocation sites is transitioning, then |
| 1357 // we can turn it off if we don't have anywhere else to transition to. | 1356 // we can turn it off if we don't have anywhere else to transition to. |
| 1358 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1357 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
| 1359 } | 1358 } |
| 1360 | 1359 |
| 1361 __ mov(a0, result_register()); | 1360 __ mov(a0, result_register()); |
| 1362 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1361 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1363 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1362 __ li(a2, Operand(SmiFromSlot(expr->literal_slot()))); |
| 1364 __ li(a1, Operand(constant_elements)); | 1363 __ li(a1, Operand(constant_elements)); |
| 1365 if (MustCreateArrayLiteralWithRuntime(expr)) { | 1364 if (MustCreateArrayLiteralWithRuntime(expr)) { |
| 1366 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); | 1365 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); |
| 1367 __ Push(a3, a2, a1, a0); | 1366 __ Push(a3, a2, a1, a0); |
| 1368 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1367 __ CallRuntime(Runtime::kCreateArrayLiteral); |
| 1369 } else { | 1368 } else { |
| 1370 Callable callable = | 1369 Callable callable = |
| 1371 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); | 1370 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); |
| 1372 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 1371 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 1373 RestoreContext(); | 1372 RestoreContext(); |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 reinterpret_cast<uint64_t>( | 2877 reinterpret_cast<uint64_t>( |
| 2879 isolate->builtins()->OnStackReplacement()->entry())); | 2878 isolate->builtins()->OnStackReplacement()->entry())); |
| 2880 return ON_STACK_REPLACEMENT; | 2879 return ON_STACK_REPLACEMENT; |
| 2881 } | 2880 } |
| 2882 | 2881 |
| 2883 | 2882 |
| 2884 } // namespace internal | 2883 } // namespace internal |
| 2885 } // namespace v8 | 2884 } // namespace v8 |
| 2886 | 2885 |
| 2887 #endif // V8_TARGET_ARCH_MIPS64 | 2886 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |