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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 2655853010: [TypeFeedbackVector] Combine the literals array and the feedback vector. (Closed)
Patch Set: partial serializer todo 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
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/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/builtins/builtins-constructor.h" 9 #include "src/builtins/builtins-constructor.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // MANUAL indicates that the scope shouldn't actually generate code to set up 125 // MANUAL indicates that the scope shouldn't actually generate code to set up
126 // the frame (that is done below). 126 // the frame (that is done below).
127 FrameScope frame_scope(masm_, StackFrame::MANUAL); 127 FrameScope frame_scope(masm_, StackFrame::MANUAL);
128 128
129 info->set_prologue_offset(masm_->pc_offset()); 129 info->set_prologue_offset(masm_->pc_offset());
130 __ Prologue(info->GeneratePreagedPrologue()); 130 __ Prologue(info->GeneratePreagedPrologue());
131 131
132 // Increment invocation count for the function. 132 // Increment invocation count for the function.
133 { 133 {
134 Comment cmnt(masm_, "[ Increment invocation count"); 134 Comment cmnt(masm_, "[ Increment invocation count");
135 __ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset)); 135 __ ldr(r2, FieldMemOperand(r1, JSFunction::kFeedbackVectorOffset));
136 __ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset));
137 __ ldr(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex * 136 __ ldr(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex *
138 kPointerSize + 137 kPointerSize +
139 TypeFeedbackVector::kHeaderSize)); 138 TypeFeedbackVector::kHeaderSize));
140 __ add(r9, r9, Operand(Smi::FromInt(1))); 139 __ add(r9, r9, Operand(Smi::FromInt(1)));
141 __ str(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex * 140 __ str(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex *
142 kPointerSize + 141 kPointerSize +
143 TypeFeedbackVector::kHeaderSize)); 142 TypeFeedbackVector::kHeaderSize));
144 } 143 }
145 144
146 { Comment cmnt(masm_, "[ Allocate locals"); 145 { Comment cmnt(masm_, "[ Allocate locals");
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 } 1208 }
1210 } 1209 }
1211 1210
1212 1211
1213 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { 1212 void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
1214 Comment cmnt(masm_, "[ ObjectLiteral"); 1213 Comment cmnt(masm_, "[ ObjectLiteral");
1215 1214
1216 Handle<FixedArray> constant_properties = 1215 Handle<FixedArray> constant_properties =
1217 expr->GetOrBuildConstantProperties(isolate()); 1216 expr->GetOrBuildConstantProperties(isolate());
1218 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1217 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1219 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1218 __ mov(r2, Operand(SmiFromSlot(expr->literal_slot())));
1220 __ mov(r1, Operand(constant_properties)); 1219 __ mov(r1, Operand(constant_properties));
1221 int flags = expr->ComputeFlags(); 1220 int flags = expr->ComputeFlags();
1222 __ mov(r0, Operand(Smi::FromInt(flags))); 1221 __ mov(r0, Operand(Smi::FromInt(flags)));
1223 if (MustCreateObjectLiteralWithRuntime(expr)) { 1222 if (MustCreateObjectLiteralWithRuntime(expr)) {
1224 __ Push(r3, r2, r1, r0); 1223 __ Push(r3, r2, r1, r0);
1225 __ CallRuntime(Runtime::kCreateObjectLiteral); 1224 __ CallRuntime(Runtime::kCreateObjectLiteral);
1226 } else { 1225 } else {
1227 Callable callable = CodeFactory::FastCloneShallowObject( 1226 Callable callable = CodeFactory::FastCloneShallowObject(
1228 isolate(), expr->properties_count()); 1227 isolate(), expr->properties_count());
1229 __ Call(callable.code(), RelocInfo::CODE_TARGET); 1228 __ Call(callable.code(), RelocInfo::CODE_TARGET);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 IsFastObjectElementsKind(expr->constant_elements_kind()); 1350 IsFastObjectElementsKind(expr->constant_elements_kind());
1352 1351
1353 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; 1352 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
1354 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { 1353 if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
1355 // If the only customer of allocation sites is transitioning, then 1354 // If the only customer of allocation sites is transitioning, then
1356 // we can turn it off if we don't have anywhere else to transition to. 1355 // we can turn it off if we don't have anywhere else to transition to.
1357 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; 1356 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
1358 } 1357 }
1359 1358
1360 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 1359 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
1361 __ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); 1360 __ mov(r2, Operand(SmiFromSlot(expr->literal_slot())));
1362 __ mov(r1, Operand(constant_elements)); 1361 __ mov(r1, Operand(constant_elements));
1363 if (MustCreateArrayLiteralWithRuntime(expr)) { 1362 if (MustCreateArrayLiteralWithRuntime(expr)) {
1364 __ mov(r0, Operand(Smi::FromInt(expr->ComputeFlags()))); 1363 __ mov(r0, Operand(Smi::FromInt(expr->ComputeFlags())));
1365 __ Push(r3, r2, r1, r0); 1364 __ Push(r3, r2, r1, r0);
1366 __ CallRuntime(Runtime::kCreateArrayLiteral); 1365 __ CallRuntime(Runtime::kCreateArrayLiteral);
1367 } else { 1366 } else {
1368 Callable callable = 1367 Callable callable =
1369 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode); 1368 CodeFactory::FastCloneShallowArray(isolate(), allocation_site_mode);
1370 __ Call(callable.code(), RelocInfo::CODE_TARGET); 1369 __ Call(callable.code(), RelocInfo::CODE_TARGET);
1371 RestoreContext(); 1370 RestoreContext();
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
2909 DCHECK(interrupt_address == 2908 DCHECK(interrupt_address ==
2910 isolate->builtins()->OnStackReplacement()->entry()); 2909 isolate->builtins()->OnStackReplacement()->entry());
2911 return ON_STACK_REPLACEMENT; 2910 return ON_STACK_REPLACEMENT;
2912 } 2911 }
2913 2912
2914 2913
2915 } // namespace internal 2914 } // namespace internal
2916 } // namespace v8 2915 } // namespace v8
2917 2916
2918 #endif // V8_TARGET_ARCH_ARM 2917 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698