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

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

Issue 138013007: A64: Address a few TODOs in full-codegen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 VariableDeclaration* function = scope()->function(); 275 VariableDeclaration* function = scope()->function();
276 ASSERT(function->proxy()->var()->mode() == CONST || 276 ASSERT(function->proxy()->var()->mode() == CONST ||
277 function->proxy()->var()->mode() == CONST_HARMONY); 277 function->proxy()->var()->mode() == CONST_HARMONY);
278 ASSERT(function->proxy()->var()->location() != Variable::UNALLOCATED); 278 ASSERT(function->proxy()->var()->location() != Variable::UNALLOCATED);
279 VisitVariableDeclaration(function); 279 VisitVariableDeclaration(function);
280 } 280 }
281 VisitDeclarations(scope()->declarations()); 281 VisitDeclarations(scope()->declarations());
282 } 282 }
283 } 283 }
284 284
285 // TODO(jbramley): Why not call EmitBackEdgeBookkeeping()?
286 { Comment cmnt(masm_, "[ Stack check"); 285 { Comment cmnt(masm_, "[ Stack check");
287 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); 286 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
288 Label ok; 287 Label ok;
289 ASSERT(jssp.Is(__ StackPointer())); 288 ASSERT(jssp.Is(__ StackPointer()));
290 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); 289 __ CompareRoot(jssp, Heap::kStackLimitRootIndex);
291 __ B(hs, &ok); 290 __ B(hs, &ok);
292 PredictableCodeSizeScope predictable(masm_, 291 PredictableCodeSizeScope predictable(masm_,
293 Assembler::kCallSizeWithRelocation); 292 Assembler::kCallSizeWithRelocation);
294 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET); 293 __ Call(isolate()->builtins()->StackCheck(), RelocInfo::CODE_TARGET);
295 __ Bind(&ok); 294 __ Bind(&ok);
(...skipping 16 matching lines...) Expand all
312 // of the back edge table. 311 // of the back edge table.
313 masm()->CheckConstPool(true, false); 312 masm()->CheckConstPool(true, false);
314 } 313 }
315 314
316 315
317 void FullCodeGenerator::ClearAccumulator() { 316 void FullCodeGenerator::ClearAccumulator() {
318 __ Mov(x0, Operand(Smi::FromInt(0))); 317 __ Mov(x0, Operand(Smi::FromInt(0)));
319 } 318 }
320 319
321 320
322 // TODO(mcapewel): untested, ported as part of merge.
323 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) { 321 void FullCodeGenerator::EmitProfilingCounterDecrement(int delta) {
324 __ Mov(x2, Operand(profiling_counter_)); 322 __ Mov(x2, Operand(profiling_counter_));
325 __ Ldr(x3, FieldMemOperand(x2, Cell::kValueOffset)); 323 __ Ldr(x3, FieldMemOperand(x2, Cell::kValueOffset));
326 __ Subs(x3, x3, Operand(Smi::FromInt(delta))); 324 __ Subs(x3, x3, Operand(Smi::FromInt(delta)));
327 __ Str(x3, FieldMemOperand(x2, Cell::kValueOffset)); 325 __ Str(x3, FieldMemOperand(x2, Cell::kValueOffset));
328 } 326 }
329 327
330 328
331 // TODO(mcapewel): untested, ported as part of merge.
332 void FullCodeGenerator::EmitProfilingCounterReset() { 329 void FullCodeGenerator::EmitProfilingCounterReset() {
333 int reset_value = FLAG_interrupt_budget; 330 int reset_value = FLAG_interrupt_budget;
334 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) { 331 if (info_->ShouldSelfOptimize() && !FLAG_retry_self_opt) {
335 // Self-optimization is a one-off thing. if it fails, don't try again. 332 // Self-optimization is a one-off thing. if it fails, don't try again.
336 reset_value = Smi::kMaxValue; 333 reset_value = Smi::kMaxValue;
337 } 334 }
338 if (isolate()->IsDebuggerActive()) { 335 if (isolate()->IsDebuggerActive()) {
339 // Detect debug break requests as soon as possible. 336 // Detect debug break requests as soon as possible.
340 reset_value = FLAG_interrupt_budget >> 4; 337 reset_value = FLAG_interrupt_budget >> 4;
341 } 338 }
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 // Push enumeration cache, enumeration cache length (as smi) and zero. 1152 // Push enumeration cache, enumeration cache length (as smi) and zero.
1156 __ SmiTag(x1); 1153 __ SmiTag(x1);
1157 __ Push(x2, x1, x0); 1154 __ Push(x2, x1, x0);
1158 __ B(&loop); 1155 __ B(&loop);
1159 1156
1160 __ Bind(&no_descriptors); 1157 __ Bind(&no_descriptors);
1161 __ Drop(1); 1158 __ Drop(1);
1162 __ B(&exit); 1159 __ B(&exit);
1163 1160
1164 // We got a fixed array in register x0. Iterate through that. 1161 // We got a fixed array in register x0. Iterate through that.
1165 Label non_proxy;
1166 __ Bind(&fixed_array); 1162 __ Bind(&fixed_array);
1167 1163
1168 Handle<Cell> cell = isolate()->factory()->NewCell( 1164 Handle<Cell> cell = isolate()->factory()->NewCell(
1169 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker), 1165 Handle<Object>(Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker),
1170 isolate())); 1166 isolate()));
1171 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell); 1167 RecordTypeFeedbackCell(stmt->ForInFeedbackId(), cell);
1172 __ LoadHeapObject(x1, cell); 1168 __ LoadHeapObject(x1, cell);
1173 __ Mov(x10, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker))); 1169 __ Mov(x10, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
1174 __ Str(x10, FieldMemOperand(x1, Cell::kValueOffset)); 1170 __ Str(x10, FieldMemOperand(x1, Cell::kValueOffset));
1175 1171
1176 __ Mov(x1, Operand(Smi::FromInt(1))); // Smi indicates slow check. 1172 __ Mov(x1, Operand(Smi::FromInt(1))); // Smi indicates slow check.
1177 __ Peek(x10, 0); // Get enumerated object. 1173 __ Peek(x10, 0); // Get enumerated object.
1178 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); 1174 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);
1179 // TODO(all): similar check was done already. Can we avoid it here? 1175 // TODO(all): similar check was done already. Can we avoid it here?
1180 __ JumpIfObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE, &non_proxy, gt); 1176 __ CompareObjectType(x10, x11, x12, LAST_JS_PROXY_TYPE);
1181 // TODO(all): use csel here 1177 ASSERT(Smi::FromInt(0) == 0);
1182 __ Mov(x1, Operand(Smi::FromInt(0))); // Zero indicates proxy. 1178 __ CzeroX(x1, le); // Zero indicates proxy.
1183 __ Bind(&non_proxy);
1184 __ Push(x1, x0); // Smi and array 1179 __ Push(x1, x0); // Smi and array
1185 __ Ldr(x1, FieldMemOperand(x0, FixedArray::kLengthOffset)); 1180 __ Ldr(x1, FieldMemOperand(x0, FixedArray::kLengthOffset));
1186 __ Push(x1, xzr); // Fixed array length (as smi) and initial index. 1181 __ Push(x1, xzr); // Fixed array length (as smi) and initial index.
1187 1182
1188 // Generate code for doing the condition check. 1183 // Generate code for doing the condition check.
1189 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); 1184 PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS);
1190 __ Bind(&loop); 1185 __ Bind(&loop);
1191 // Load the current count to x0, load the length to x1. 1186 // Load the current count to x0, load the length to x1.
1192 __ PeekPair(x0, x1, 0); 1187 __ PeekPair(x0, x1, 0);
1193 __ Cmp(x0, x1); // Compare to the array length. 1188 __ Cmp(x0, x1); // Compare to the array length.
(...skipping 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after
5038 return previous_; 5033 return previous_;
5039 } 5034 }
5040 5035
5041 5036
5042 #undef __ 5037 #undef __
5043 5038
5044 5039
5045 } } // namespace v8::internal 5040 } } // namespace v8::internal
5046 5041
5047 #endif // V8_TARGET_ARCH_A64 5042 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698