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

Side by Side Diff: src/mips64/builtins-mips64.cc

Issue 2031123003: Avoid creating weak cells for literal arrays that are empty of literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 6 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/mips/builtins-mips.cc ('k') | src/objects.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 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 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 __ Daddu(array_pointer, map, Operand(at)); 1273 __ Daddu(array_pointer, map, Operand(at));
1274 __ ld(temp, FieldMemOperand(array_pointer, 1274 __ ld(temp, FieldMemOperand(array_pointer,
1275 SharedFunctionInfo::kOffsetToPreviousContext)); 1275 SharedFunctionInfo::kOffsetToPreviousContext));
1276 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1276 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1277 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); 1277 __ Branch(&loop_bottom, ne, temp, Operand(native_context));
1278 // OSR id set to none? 1278 // OSR id set to none?
1279 __ ld(temp, FieldMemOperand(array_pointer, 1279 __ ld(temp, FieldMemOperand(array_pointer,
1280 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); 1280 SharedFunctionInfo::kOffsetToPreviousOsrAstId));
1281 const int bailout_id = BailoutId::None().ToInt(); 1281 const int bailout_id = BailoutId::None().ToInt();
1282 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id))); 1282 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id)));
1283
1283 // Literals available? 1284 // Literals available?
1285 Label got_literals, maybe_cleared_weakcell;
1284 __ ld(temp, FieldMemOperand(array_pointer, 1286 __ ld(temp, FieldMemOperand(array_pointer,
1285 SharedFunctionInfo::kOffsetToPreviousLiterals)); 1287 SharedFunctionInfo::kOffsetToPreviousLiterals));
1288 // temp contains either a WeakCell pointing to the literals array or the
1289 // literals array directly.
1290 __ ld(a4, FieldMemOperand(temp, WeakCell::kValueOffset));
1291 __ JumpIfSmi(a4, &maybe_cleared_weakcell);
1292 // a4 is a pointer, therefore temp is a WeakCell pointing to a literals array.
1286 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1293 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1287 __ JumpIfSmi(temp, &gotta_call_runtime); 1294 __ jmp(&got_literals);
1295
1296 // a4 is a smi. If it's 0, then we are looking at a cleared WeakCell
1297 // around the literals array, and we should visit the runtime. If it's > 0,
1298 // then temp already contains the literals array.
1299 __ bind(&maybe_cleared_weakcell);
1300 __ Branch(&gotta_call_runtime, eq, a4, Operand(Smi::FromInt(0)));
1288 1301
1289 // Save the literals in the closure. 1302 // Save the literals in the closure.
1303 __ bind(&got_literals);
1290 __ ld(a4, MemOperand(sp, 0)); 1304 __ ld(a4, MemOperand(sp, 0));
1291 __ sd(temp, FieldMemOperand(a4, JSFunction::kLiteralsOffset)); 1305 __ sd(temp, FieldMemOperand(a4, JSFunction::kLiteralsOffset));
1292 __ push(index); 1306 __ push(index);
1293 __ RecordWriteField(a4, JSFunction::kLiteralsOffset, temp, index, 1307 __ RecordWriteField(a4, JSFunction::kLiteralsOffset, temp, index,
1294 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1308 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1295 OMIT_SMI_CHECK); 1309 OMIT_SMI_CHECK);
1296 __ pop(index); 1310 __ pop(index);
1297 1311
1298 // Code available? 1312 // Code available?
1299 Register entry = a4; 1313 Register entry = a4;
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2870 } 2884 }
2871 } 2885 }
2872 2886
2873 2887
2874 #undef __ 2888 #undef __
2875 2889
2876 } // namespace internal 2890 } // namespace internal
2877 } // namespace v8 2891 } // namespace v8
2878 2892
2879 #endif // V8_TARGET_ARCH_MIPS64 2893 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698