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

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: Ports. 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
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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 __ Daddu(array_pointer, map, Operand(at)); 1252 __ Daddu(array_pointer, map, Operand(at));
1253 __ ld(temp, FieldMemOperand(array_pointer, 1253 __ ld(temp, FieldMemOperand(array_pointer,
1254 SharedFunctionInfo::kOffsetToPreviousContext)); 1254 SharedFunctionInfo::kOffsetToPreviousContext));
1255 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1255 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1256 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); 1256 __ Branch(&loop_bottom, ne, temp, Operand(native_context));
1257 // OSR id set to none? 1257 // OSR id set to none?
1258 __ ld(temp, FieldMemOperand(array_pointer, 1258 __ ld(temp, FieldMemOperand(array_pointer,
1259 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); 1259 SharedFunctionInfo::kOffsetToPreviousOsrAstId));
1260 const int bailout_id = BailoutId::None().ToInt(); 1260 const int bailout_id = BailoutId::None().ToInt();
1261 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id))); 1261 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id)));
1262
1262 // Literals available? 1263 // Literals available?
1264 Label got_literals, maybe_cleared_weakcell;
1263 __ ld(temp, FieldMemOperand(array_pointer, 1265 __ ld(temp, FieldMemOperand(array_pointer,
1264 SharedFunctionInfo::kOffsetToPreviousLiterals)); 1266 SharedFunctionInfo::kOffsetToPreviousLiterals));
1267 // temp contains either a WeakCell pointing to the literals array or the
1268 // literals array directly.
1269 __ ld(a4, FieldMemOperand(temp, WeakCell::kValueOffset));
1270 __ JumpIfSmi(a4, &maybe_cleared_weakcell);
1271 // a4 is a pointer, therefore temp is a WeakCell pointing to a literals array.
1265 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1272 __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1266 __ JumpIfSmi(temp, &gotta_call_runtime); 1273 __ jmp(&got_literals);
1274
1275 // a4 is a smi. If it's 0, then we are looking at a cleared WeakCell
1276 // around the literals array, and we should visit the runtime. If it's > 0,
1277 // then temp already contains the literals array.
1278 __ bind(&maybe_cleared_weakcell);
1279 __ Branch(&gotta_call_runtime, eq, a4, Operand(Smi::FromInt(0)));
1267 1280
1268 // Save the literals in the closure. 1281 // Save the literals in the closure.
1282 __ bind(&got_literals);
1269 __ ld(a4, MemOperand(sp, 0)); 1283 __ ld(a4, MemOperand(sp, 0));
1270 __ sd(temp, FieldMemOperand(a4, JSFunction::kLiteralsOffset)); 1284 __ sd(temp, FieldMemOperand(a4, JSFunction::kLiteralsOffset));
1271 __ push(index); 1285 __ push(index);
1272 __ RecordWriteField(a4, JSFunction::kLiteralsOffset, temp, index, 1286 __ RecordWriteField(a4, JSFunction::kLiteralsOffset, temp, index,
1273 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1287 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1274 OMIT_SMI_CHECK); 1288 OMIT_SMI_CHECK);
1275 __ pop(index); 1289 __ pop(index);
1276 1290
1277 // Code available? 1291 // Code available?
1278 Register entry = a4; 1292 Register entry = a4;
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2849 } 2863 }
2850 } 2864 }
2851 2865
2852 2866
2853 #undef __ 2867 #undef __
2854 2868
2855 } // namespace internal 2869 } // namespace internal
2856 } // namespace v8 2870 } // namespace v8
2857 2871
2858 #endif // V8_TARGET_ARCH_MIPS64 2872 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/objects.cc » ('j') | src/type-feedback-vector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698