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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1210 |
1211 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1211 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1212 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1212 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1213 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1213 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); |
1214 __ li(a1, Operand(constant_properties)); | 1214 __ li(a1, Operand(constant_properties)); |
1215 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); | 1215 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); |
1216 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1216 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1217 __ Push(a3, a2, a1, a0); | 1217 __ Push(a3, a2, a1, a0); |
1218 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1218 __ CallRuntime(Runtime::kCreateObjectLiteral); |
1219 } else { | 1219 } else { |
1220 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); | 1220 Callable callable = CodeFactory::FastCloneShallowObject( |
1221 __ CallStub(&stub); | 1221 isolate(), expr->properties_count()); |
| 1222 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1222 RestoreContext(); | 1223 RestoreContext(); |
1223 } | 1224 } |
1224 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1225 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1225 | 1226 |
1226 // If result_saved is true the result is on top of the stack. If | 1227 // If result_saved is true the result is on top of the stack. If |
1227 // result_saved is false the result is in v0. | 1228 // result_saved is false the result is in v0. |
1228 bool result_saved = false; | 1229 bool result_saved = false; |
1229 | 1230 |
1230 AccessorTable accessor_table(zone()); | 1231 AccessorTable accessor_table(zone()); |
1231 for (int i = 0; i < expr->properties()->length(); i++) { | 1232 for (int i = 0; i < expr->properties()->length(); i++) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 | 1350 |
1350 __ mov(a0, result_register()); | 1351 __ mov(a0, result_register()); |
1351 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1352 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1352 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1353 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); |
1353 __ li(a1, Operand(constant_elements)); | 1354 __ li(a1, Operand(constant_elements)); |
1354 if (MustCreateArrayLiteralWithRuntime(expr)) { | 1355 if (MustCreateArrayLiteralWithRuntime(expr)) { |
1355 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); | 1356 __ li(a0, Operand(Smi::FromInt(expr->ComputeFlags()))); |
1356 __ Push(a3, a2, a1, a0); | 1357 __ Push(a3, a2, a1, a0); |
1357 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1358 __ CallRuntime(Runtime::kCreateArrayLiteral); |
1358 } else { | 1359 } else { |
1359 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); | 1360 Callable callable = |
1360 __ CallStub(&stub); | 1361 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); |
| 1362 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1361 RestoreContext(); | 1363 RestoreContext(); |
1362 } | 1364 } |
1363 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1365 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1364 | 1366 |
1365 bool result_saved = false; // Is the result saved to the stack? | 1367 bool result_saved = false; // Is the result saved to the stack? |
1366 ZoneList<Expression*>* subexprs = expr->values(); | 1368 ZoneList<Expression*>* subexprs = expr->values(); |
1367 int length = subexprs->length(); | 1369 int length = subexprs->length(); |
1368 | 1370 |
1369 // Emit code to evaluate all the non-constant subexpressions and to store | 1371 // Emit code to evaluate all the non-constant subexpressions and to store |
1370 // them into the newly cloned array. | 1372 // them into the newly cloned array. |
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2881 reinterpret_cast<uint32_t>( | 2883 reinterpret_cast<uint32_t>( |
2882 isolate->builtins()->OnStackReplacement()->entry())); | 2884 isolate->builtins()->OnStackReplacement()->entry())); |
2883 return ON_STACK_REPLACEMENT; | 2885 return ON_STACK_REPLACEMENT; |
2884 } | 2886 } |
2885 | 2887 |
2886 | 2888 |
2887 } // namespace internal | 2889 } // namespace internal |
2888 } // namespace v8 | 2890 } // namespace v8 |
2889 | 2891 |
2890 #endif // V8_TARGET_ARCH_MIPS | 2892 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |