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

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

Issue 2144183002: Revert "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, 5 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 | « no previous file | src/builtins/arm64/builtins-arm64.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_ARM 5 #if V8_TARGET_ARCH_ARM
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 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 SharedFunctionInfo::kOffsetToPreviousContext)); 1317 SharedFunctionInfo::kOffsetToPreviousContext));
1318 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1318 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1319 __ cmp(temp, native_context); 1319 __ cmp(temp, native_context);
1320 __ b(ne, &loop_bottom); 1320 __ b(ne, &loop_bottom);
1321 // OSR id set to none? 1321 // OSR id set to none?
1322 __ ldr(temp, FieldMemOperand(array_pointer, 1322 __ ldr(temp, FieldMemOperand(array_pointer,
1323 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); 1323 SharedFunctionInfo::kOffsetToPreviousOsrAstId));
1324 const int bailout_id = BailoutId::None().ToInt(); 1324 const int bailout_id = BailoutId::None().ToInt();
1325 __ cmp(temp, Operand(Smi::FromInt(bailout_id))); 1325 __ cmp(temp, Operand(Smi::FromInt(bailout_id)));
1326 __ b(ne, &loop_bottom); 1326 __ b(ne, &loop_bottom);
1327
1328 // Literals available? 1327 // Literals available?
1329 Label got_literals, maybe_cleared_weakcell;
1330 __ ldr(temp, FieldMemOperand(array_pointer, 1328 __ ldr(temp, FieldMemOperand(array_pointer,
1331 SharedFunctionInfo::kOffsetToPreviousLiterals)); 1329 SharedFunctionInfo::kOffsetToPreviousLiterals));
1332 // temp contains either a WeakCell pointing to the literals array or the
1333 // literals array directly.
1334 STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset);
1335 __ ldr(r4, FieldMemOperand(temp, WeakCell::kValueOffset));
1336 __ JumpIfSmi(r4, &maybe_cleared_weakcell);
1337 // r4 is a pointer, therefore temp is a WeakCell pointing to a literals array.
1338 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1330 __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1339 __ jmp(&got_literals); 1331 __ JumpIfSmi(temp, &gotta_call_runtime);
1340
1341 // r4 is a smi. If it's 0, then we are looking at a cleared WeakCell
1342 // around the literals array, and we should visit the runtime. If it's > 0,
1343 // then temp already contains the literals array.
1344 __ bind(&maybe_cleared_weakcell);
1345 __ cmp(r4, Operand(Smi::FromInt(0)));
1346 __ b(eq, &gotta_call_runtime);
1347 1332
1348 // Save the literals in the closure. 1333 // Save the literals in the closure.
1349 __ bind(&got_literals);
1350 __ ldr(r4, MemOperand(sp, 0)); 1334 __ ldr(r4, MemOperand(sp, 0));
1351 __ str(temp, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); 1335 __ str(temp, FieldMemOperand(r4, JSFunction::kLiteralsOffset));
1352 __ push(index); 1336 __ push(index);
1353 __ RecordWriteField(r4, JSFunction::kLiteralsOffset, temp, index, 1337 __ RecordWriteField(r4, JSFunction::kLiteralsOffset, temp, index,
1354 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1338 kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1355 OMIT_SMI_CHECK); 1339 OMIT_SMI_CHECK);
1356 __ pop(index); 1340 __ pop(index);
1357 1341
1358 // Code available? 1342 // Code available?
1359 Register entry = r4; 1343 Register entry = r4;
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2930 __ bkpt(0); 2914 __ bkpt(0);
2931 } 2915 }
2932 } 2916 }
2933 2917
2934 #undef __ 2918 #undef __
2935 2919
2936 } // namespace internal 2920 } // namespace internal
2937 } // namespace v8 2921 } // namespace v8
2938 2922
2939 #endif // V8_TARGET_ARCH_ARM 2923 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/builtins/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698