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

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

Issue 2655853010: [TypeFeedbackVector] Combine the literals array and the feedback vector. (Closed)
Patch Set: more comments. Created 3 years, 10 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/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/mips64/builtins-mips64.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_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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); 1010 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset));
1011 __ bind(&bytecode_array_loaded); 1011 __ bind(&bytecode_array_loaded);
1012 1012
1013 // Check whether we should continue to use the interpreter. 1013 // Check whether we should continue to use the interpreter.
1014 Label switch_to_different_code_kind; 1014 Label switch_to_different_code_kind;
1015 __ lw(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset)); 1015 __ lw(a0, FieldMemOperand(a0, SharedFunctionInfo::kCodeOffset));
1016 __ Branch(&switch_to_different_code_kind, ne, a0, 1016 __ Branch(&switch_to_different_code_kind, ne, a0,
1017 Operand(masm->CodeObject())); // Self-reference to this code. 1017 Operand(masm->CodeObject())); // Self-reference to this code.
1018 1018
1019 // Increment invocation count for the function. 1019 // Increment invocation count for the function.
1020 __ lw(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset)); 1020 __ lw(a0, FieldMemOperand(a1, JSFunction::kFeedbackVectorOffset));
1021 __ lw(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset));
1022 __ lw(t0, FieldMemOperand( 1021 __ lw(t0, FieldMemOperand(
1023 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + 1022 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
1024 TypeFeedbackVector::kHeaderSize)); 1023 TypeFeedbackVector::kHeaderSize));
1025 __ Addu(t0, t0, Operand(Smi::FromInt(1))); 1024 __ Addu(t0, t0, Operand(Smi::FromInt(1)));
1026 __ sw(t0, FieldMemOperand( 1025 __ sw(t0, FieldMemOperand(
1027 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + 1026 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
1028 TypeFeedbackVector::kHeaderSize)); 1027 TypeFeedbackVector::kHeaderSize));
1029 1028
1030 // Check function data field is actually a BytecodeArray object. 1029 // Check function data field is actually a BytecodeArray object.
1031 if (FLAG_debug_code) { 1030 if (FLAG_debug_code) {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 Register temp = a1; 1376 Register temp = a1;
1378 Register array_pointer = t1; 1377 Register array_pointer = t1;
1379 1378
1380 // Does the native context match? 1379 // Does the native context match?
1381 __ sll(at, index, kPointerSizeLog2 - kSmiTagSize); 1380 __ sll(at, index, kPointerSizeLog2 - kSmiTagSize);
1382 __ Addu(array_pointer, map, Operand(at)); 1381 __ Addu(array_pointer, map, Operand(at));
1383 __ lw(temp, FieldMemOperand(array_pointer, 1382 __ lw(temp, FieldMemOperand(array_pointer,
1384 SharedFunctionInfo::kOffsetToPreviousContext)); 1383 SharedFunctionInfo::kOffsetToPreviousContext));
1385 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1384 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1386 __ Branch(&loop_bottom, ne, temp, Operand(native_context)); 1385 __ Branch(&loop_bottom, ne, temp, Operand(native_context));
1387 // Literals available? 1386 // Feedback vector available?
1388 __ lw(temp, FieldMemOperand(array_pointer, 1387 __ lw(temp, FieldMemOperand(array_pointer,
1389 SharedFunctionInfo::kOffsetToPreviousLiterals)); 1388 SharedFunctionInfo::kOffsetToPreviousLiterals));
1390 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); 1389 __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
1391 __ JumpIfSmi(temp, &gotta_call_runtime); 1390 __ JumpIfSmi(temp, &gotta_call_runtime);
1392 1391
1393 // Save the literals in the closure. 1392 // Save the feedback vector in the closure.
1394 __ lw(t0, MemOperand(sp, 0)); 1393 __ lw(t0, MemOperand(sp, 0));
1395 __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset)); 1394 __ sw(temp, FieldMemOperand(t0, JSFunction::kFeedbackVectorOffset));
1396 __ push(index); 1395 __ push(index);
1397 __ RecordWriteField(t0, JSFunction::kLiteralsOffset, temp, index, 1396 __ RecordWriteField(t0, JSFunction::kFeedbackVectorOffset, temp, index,
1398 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, 1397 kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1399 OMIT_SMI_CHECK); 1398 OMIT_SMI_CHECK);
1400 __ pop(index); 1399 __ pop(index);
1401 1400
1402 // Code available? 1401 // Code available?
1403 Register entry = t0; 1402 Register entry = t0;
1404 __ lw(entry, 1403 __ lw(entry,
1405 FieldMemOperand(array_pointer, 1404 FieldMemOperand(array_pointer,
1406 SharedFunctionInfo::kOffsetToPreviousCachedCode)); 1405 SharedFunctionInfo::kOffsetToPreviousCachedCode));
1407 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); 1406 __ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset));
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 __ break_(0xCC); 3194 __ break_(0xCC);
3196 } 3195 }
3197 } 3196 }
3198 3197
3199 #undef __ 3198 #undef __
3200 3199
3201 } // namespace internal 3200 } // namespace internal
3202 } // namespace v8 3201 } // namespace v8
3203 3202
3204 #endif // V8_TARGET_ARCH_MIPS 3203 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/builtins/ia32/builtins-ia32.cc ('k') | src/builtins/mips64/builtins-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698