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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1211 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1212 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1212 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1213 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 1213 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
1214 __ mov(r1, Operand(constant_properties)); | 1214 __ mov(r1, Operand(constant_properties)); |
1215 int flags = expr->ComputeFlags(); | 1215 int flags = expr->ComputeFlags(); |
1216 __ mov(r0, Operand(Smi::FromInt(flags))); | 1216 __ mov(r0, Operand(Smi::FromInt(flags))); |
1217 if (MustCreateObjectLiteralWithRuntime(expr)) { | 1217 if (MustCreateObjectLiteralWithRuntime(expr)) { |
1218 __ Push(r3, r2, r1, r0); | 1218 __ Push(r3, r2, r1, r0); |
1219 __ CallRuntime(Runtime::kCreateObjectLiteral); | 1219 __ CallRuntime(Runtime::kCreateObjectLiteral); |
1220 } else { | 1220 } else { |
1221 FastCloneShallowObjectStub stub(isolate(), expr->properties_count()); | 1221 Callable callable = CodeFactory::FastCloneShallowObject( |
1222 __ CallStub(&stub); | 1222 isolate(), expr->properties_count()); |
| 1223 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
1223 RestoreContext(); | 1224 RestoreContext(); |
1224 } | 1225 } |
1225 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1226 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1226 | 1227 |
1227 // If result_saved is true the result is on top of the stack. If | 1228 // If result_saved is true the result is on top of the stack. If |
1228 // result_saved is false the result is in r0. | 1229 // result_saved is false the result is in r0. |
1229 bool result_saved = false; | 1230 bool result_saved = false; |
1230 | 1231 |
1231 AccessorTable accessor_table(zone()); | 1232 AccessorTable accessor_table(zone()); |
1232 for (int i = 0; i < expr->properties()->length(); i++) { | 1233 for (int i = 0; i < expr->properties()->length(); i++) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 } | 1350 } |
1350 | 1351 |
1351 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1352 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1352 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); | 1353 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
1353 __ mov(r1, Operand(constant_elements)); | 1354 __ mov(r1, Operand(constant_elements)); |
1354 if (MustCreateArrayLiteralWithRuntime(expr)) { | 1355 if (MustCreateArrayLiteralWithRuntime(expr)) { |
1355 __ mov(r0, Operand(Smi::FromInt(expr->ComputeFlags()))); | 1356 __ mov(r0, Operand(Smi::FromInt(expr->ComputeFlags()))); |
1356 __ Push(r3, r2, r1, r0); | 1357 __ Push(r3, r2, r1, r0); |
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 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 DCHECK(interrupt_address == | 2923 DCHECK(interrupt_address == |
2922 isolate->builtins()->OnStackReplacement()->entry()); | 2924 isolate->builtins()->OnStackReplacement()->entry()); |
2923 return ON_STACK_REPLACEMENT; | 2925 return ON_STACK_REPLACEMENT; |
2924 } | 2926 } |
2925 | 2927 |
2926 | 2928 |
2927 } // namespace internal | 2929 } // namespace internal |
2928 } // namespace v8 | 2930 } // namespace v8 |
2929 | 2931 |
2930 #endif // V8_TARGET_ARCH_ARM | 2932 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |