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

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

Issue 997513003: CpuProfiler: fix for CollectDeoptEvents test on arm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed Created 5 years, 9 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 | 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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 Address entry = table_entry->address; 339 Address entry = table_entry->address;
340 DeoptComment(table_entry->deopt_info); 340 DeoptComment(table_entry->deopt_info);
341 341
342 // Second-level deopt table entries are contiguous and small, so instead 342 // Second-level deopt table entries are contiguous and small, so instead
343 // of loading the full, absolute address of each one, load an immediate 343 // of loading the full, absolute address of each one, load an immediate
344 // offset which will be added to the base address later. 344 // offset which will be added to the base address later.
345 __ mov(entry_offset, Operand(entry - base)); 345 __ mov(entry_offset, Operand(entry - base));
346 346
347 if (table_entry->needs_frame) { 347 if (table_entry->needs_frame) {
348 DCHECK(!info()->saves_caller_doubles()); 348 DCHECK(!info()->saves_caller_doubles());
349 if (needs_frame.is_bound()) { 349 Comment(";;; call deopt with frame");
350 __ b(&needs_frame); 350 __ PushFixedFrame();
351 } else { 351 __ bl(&needs_frame);
352 __ bind(&needs_frame);
353 Comment(";;; call deopt with frame");
354 __ PushFixedFrame();
355 // This variant of deopt can only be used with stubs. Since we don't
356 // have a function pointer to install in the stack frame that we're
357 // building, install a special marker there instead.
358 DCHECK(info()->IsStub());
359 __ mov(ip, Operand(Smi::FromInt(StackFrame::STUB)));
360 __ push(ip);
361 __ add(fp, sp,
362 Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
363 __ bind(&call_deopt_entry);
364 // Add the base address to the offset previously loaded in
365 // entry_offset.
366 __ add(entry_offset, entry_offset,
367 Operand(ExternalReference::ForDeoptEntry(base)));
368 __ blx(entry_offset);
369 }
370
371 masm()->CheckConstPool(false, false);
372 } else { 352 } else {
373 // The last entry can fall through into `call_deopt_entry`, avoiding a 353 __ bl(&call_deopt_entry);
374 // branch.
375 bool need_branch = ((i + 1) != length) || call_deopt_entry.is_bound();
376
377 if (need_branch) __ b(&call_deopt_entry);
378
379 masm()->CheckConstPool(false, !need_branch);
380 } 354 }
355 masm()->CheckConstPool(false, false);
381 } 356 }
382 357
383 if (!call_deopt_entry.is_bound()) { 358 if (needs_frame.is_linked()) {
384 Comment(";;; call deopt"); 359 __ bind(&needs_frame);
385 __ bind(&call_deopt_entry); 360 // This variant of deopt can only be used with stubs. Since we don't
361 // have a function pointer to install in the stack frame that we're
362 // building, install a special marker there instead.
363 DCHECK(info()->IsStub());
364 __ mov(ip, Operand(Smi::FromInt(StackFrame::STUB)));
365 __ push(ip);
366 __ add(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
367 }
386 368
387 if (info()->saves_caller_doubles()) { 369 Comment(";;; call deopt");
388 DCHECK(info()->IsStub()); 370 __ bind(&call_deopt_entry);
389 RestoreCallerDoubles();
390 }
391 371
392 // Add the base address to the offset previously loaded in entry_offset. 372 if (info()->saves_caller_doubles()) {
393 __ add(entry_offset, entry_offset, 373 DCHECK(info()->IsStub());
394 Operand(ExternalReference::ForDeoptEntry(base))); 374 RestoreCallerDoubles();
395 __ blx(entry_offset);
396 } 375 }
376
377 // Add the base address to the offset previously loaded in entry_offset.
378 __ add(entry_offset, entry_offset,
379 Operand(ExternalReference::ForDeoptEntry(base)));
380 __ bx(entry_offset);
397 } 381 }
398 382
399 // Force constant pool emission at the end of the deopt jump table to make 383 // Force constant pool emission at the end of the deopt jump table to make
400 // sure that no constant pools are emitted after. 384 // sure that no constant pools are emitted after.
401 masm()->CheckConstPool(true, false); 385 masm()->CheckConstPool(true, false);
402 386
403 // The deoptimization jump table is the last part of the instruction 387 // The deoptimization jump table is the last part of the instruction
404 // sequence. Mark the generated code as done unless we bailed out. 388 // sequence. Mark the generated code as done unless we bailed out.
405 if (!is_aborted()) status_ = DONE; 389 if (!is_aborted()) status_ = DONE;
406 return !is_aborted(); 390 return !is_aborted();
(...skipping 5579 matching lines...) Expand 10 before | Expand all | Expand 10 after
5986 __ Push(scope_info); 5970 __ Push(scope_info);
5987 __ push(ToRegister(instr->function())); 5971 __ push(ToRegister(instr->function()));
5988 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5972 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5989 RecordSafepoint(Safepoint::kNoLazyDeopt); 5973 RecordSafepoint(Safepoint::kNoLazyDeopt);
5990 } 5974 }
5991 5975
5992 5976
5993 #undef __ 5977 #undef __
5994 5978
5995 } } // namespace v8::internal 5979 } } // namespace v8::internal
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