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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 __ Addu(array_pointer, map, Operand(at)); | 1314 __ Addu(array_pointer, map, Operand(at)); |
1315 __ lw(temp, FieldMemOperand(array_pointer, | 1315 __ lw(temp, FieldMemOperand(array_pointer, |
1316 SharedFunctionInfo::kOffsetToPreviousContext)); | 1316 SharedFunctionInfo::kOffsetToPreviousContext)); |
1317 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1317 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1318 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); | 1318 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); |
1319 // OSR id set to none? | 1319 // OSR id set to none? |
1320 __ lw(temp, FieldMemOperand(array_pointer, | 1320 __ lw(temp, FieldMemOperand(array_pointer, |
1321 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); | 1321 SharedFunctionInfo::kOffsetToPreviousOsrAstId)); |
1322 const int bailout_id = BailoutId::None().ToInt(); | 1322 const int bailout_id = BailoutId::None().ToInt(); |
1323 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id))); | 1323 __ Branch(&loop_bottom, ne, temp, Operand(Smi::FromInt(bailout_id))); |
1324 | |
1325 // Literals available? | 1324 // Literals available? |
1326 Label got_literals, maybe_cleared_weakcell; | |
1327 __ lw(temp, FieldMemOperand(array_pointer, | 1325 __ lw(temp, FieldMemOperand(array_pointer, |
1328 SharedFunctionInfo::kOffsetToPreviousLiterals)); | 1326 SharedFunctionInfo::kOffsetToPreviousLiterals)); |
1329 // temp contains either a WeakCell pointing to the literals array or the | |
1330 // literals array directly. | |
1331 STATIC_ASSERT(WeakCell::kValueOffset == FixedArray::kLengthOffset); | |
1332 __ lw(t0, FieldMemOperand(temp, WeakCell::kValueOffset)); | |
1333 __ JumpIfSmi(t0, &maybe_cleared_weakcell); | |
1334 // t0 is a pointer, therefore temp is a WeakCell pointing to a literals array. | |
1335 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); | 1327 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
1336 __ jmp(&got_literals); | 1328 __ JumpIfSmi(temp, &gotta_call_runtime); |
1337 | |
1338 // t0 is a smi. If it's 0, then we are looking at a cleared WeakCell | |
1339 // around the literals array, and we should visit the runtime. If it's > 0, | |
1340 // then temp already contains the literals array. | |
1341 __ bind(&maybe_cleared_weakcell); | |
1342 __ Branch(&gotta_call_runtime, eq, t0, Operand(Smi::FromInt(0))); | |
1343 | 1329 |
1344 // Save the literals in the closure. | 1330 // Save the literals in the closure. |
1345 __ bind(&got_literals); | |
1346 __ lw(t0, MemOperand(sp, 0)); | 1331 __ lw(t0, MemOperand(sp, 0)); |
1347 __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset)); | 1332 __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset)); |
1348 __ push(index); | 1333 __ push(index); |
1349 __ RecordWriteField(t0, JSFunction::kLiteralsOffset, temp, index, | 1334 __ RecordWriteField(t0, JSFunction::kLiteralsOffset, temp, index, |
1350 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1335 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
1351 OMIT_SMI_CHECK); | 1336 OMIT_SMI_CHECK); |
1352 __ pop(index); | 1337 __ pop(index); |
1353 | 1338 |
1354 // Code available? | 1339 // Code available? |
1355 Register entry = t0; | 1340 Register entry = t0; |
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3014 __ break_(0xCC); | 2999 __ break_(0xCC); |
3015 } | 3000 } |
3016 } | 3001 } |
3017 | 3002 |
3018 #undef __ | 3003 #undef __ |
3019 | 3004 |
3020 } // namespace internal | 3005 } // namespace internal |
3021 } // namespace v8 | 3006 } // namespace v8 |
3022 | 3007 |
3023 #endif // V8_TARGET_ARCH_MIPS | 3008 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |