Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 3144002: Copy-on-write arrays. (Closed)
Patch Set: Review fixes. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 Comment cmnt(masm_, "[ ArrayLiteral"); 1216 Comment cmnt(masm_, "[ ArrayLiteral");
1217 1217
1218 ZoneList<Expression*>* subexprs = expr->values(); 1218 ZoneList<Expression*>* subexprs = expr->values();
1219 int length = subexprs->length(); 1219 int length = subexprs->length();
1220 1220
1221 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1221 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1222 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); 1222 __ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset));
1223 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1223 __ mov(r2, Operand(Smi::FromInt(expr->literal_index())));
1224 __ mov(r1, Operand(expr->constant_elements())); 1224 __ mov(r1, Operand(expr->constant_elements()));
1225 __ Push(r3, r2, r1); 1225 __ Push(r3, r2, r1);
1226 if (expr->depth() > 1) { 1226 if (expr->constant_elements()->map() == Heap::fixed_cow_array_map()) {
1227 FastCloneShallowArrayStub stub(
1228 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length);
1229 __ CallStub(&stub);
1230 } else if (expr->depth() > 1) {
1227 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); 1231 __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
1228 } else if (length > FastCloneShallowArrayStub::kMaximumLength) { 1232 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
1229 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); 1233 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
1230 } else { 1234 } else {
1231 FastCloneShallowArrayStub stub(length); 1235 FastCloneShallowArrayStub stub(
1236 FastCloneShallowArrayStub::CLONE_ELEMENTS, length);
1232 __ CallStub(&stub); 1237 __ CallStub(&stub);
1233 } 1238 }
1234 1239
1235 bool result_saved = false; // Is the result saved to the stack? 1240 bool result_saved = false; // Is the result saved to the stack?
1236 1241
1237 // Emit code to evaluate all the non-constant subexpressions and to store 1242 // Emit code to evaluate all the non-constant subexpressions and to store
1238 // them into the newly cloned array. 1243 // them into the newly cloned array.
1239 for (int i = 0; i < length; i++) { 1244 for (int i = 0; i < length; i++) {
1240 Expression* subexpr = subexprs->at(i); 1245 Expression* subexpr = subexprs->at(i);
1241 // If the subexpression is a literal or a simple materialized literal it 1246 // If the subexpression is a literal or a simple materialized literal it
(...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after
3237 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 3242 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
3238 __ add(pc, r1, Operand(masm_->CodeObject())); 3243 __ add(pc, r1, Operand(masm_->CodeObject()));
3239 } 3244 }
3240 3245
3241 3246
3242 #undef __ 3247 #undef __
3243 3248
3244 } } // namespace v8::internal 3249 } } // namespace v8::internal
3245 3250
3246 #endif // V8_TARGET_ARCH_ARM 3251 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698