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

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

Issue 24795002: Thumb2 Backend: Use sp-relative offsets for stack slot operations in Crankshaft Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | src/arm/lithium-codegen-arm.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 // 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 deopt_jump_table_(4, info->zone()), 57 deopt_jump_table_(4, info->zone()),
58 deoptimization_literals_(8, info->zone()), 58 deoptimization_literals_(8, info->zone()),
59 inlined_function_count_(0), 59 inlined_function_count_(0),
60 scope_(info->scope()), 60 scope_(info->scope()),
61 status_(UNUSED), 61 status_(UNUSED),
62 translations_(info->zone()), 62 translations_(info->zone()),
63 deferred_(8, info->zone()), 63 deferred_(8, info->zone()),
64 osr_pc_offset_(-1), 64 osr_pc_offset_(-1),
65 last_lazy_deopt_pc_(0), 65 last_lazy_deopt_pc_(0),
66 frame_is_built_(false), 66 frame_is_built_(false),
67 fp_sp_delta_(-1),
67 safepoints_(info->zone()), 68 safepoints_(info->zone()),
68 resolver_(this), 69 resolver_(this),
69 expected_safepoint_kind_(Safepoint::kSimple), 70 expected_safepoint_kind_(Safepoint::kSimple),
70 old_position_(RelocInfo::kNoPosition) { 71 old_position_(RelocInfo::kNoPosition) {
71 PopulateDeoptimizationLiteralsWithInlinedFunctions(); 72 PopulateDeoptimizationLiteralsWithInlinedFunctions();
72 } 73 }
73 74
74 75
75 // Simple accessors. 76 // Simple accessors.
76 MacroAssembler* masm() const { return masm_; } 77 MacroAssembler* masm() const { return masm_; }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 bool GenerateBody(); 226 bool GenerateBody();
226 bool GenerateDeferredCode(); 227 bool GenerateDeferredCode();
227 bool GenerateDeoptJumpTable(); 228 bool GenerateDeoptJumpTable();
228 bool GenerateSafepointTable(); 229 bool GenerateSafepointTable();
229 230
230 enum SafepointMode { 231 enum SafepointMode {
231 RECORD_SIMPLE_SAFEPOINT, 232 RECORD_SIMPLE_SAFEPOINT,
232 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS 233 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
233 }; 234 };
234 235
236 void SetFpSpDelta(int argument_count);
237
238 void Push(Register src1);
239 void Push(Register src1, Register src2);
240 void Push(Register src1, Register src2, Register src3);
241 void Push(Register src1, Register src2, Register src3, Register src4);
242
243 #ifdef DEBUG
244 void CheckFpSpDelta(LInstruction* instr);
245 #endif // DEBUG
246
235 void CallCode( 247 void CallCode(
236 Handle<Code> code, 248 Handle<Code> code,
237 RelocInfo::Mode mode, 249 RelocInfo::Mode mode,
250 int num_arguments,
238 LInstruction* instr, 251 LInstruction* instr,
239 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS); 252 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS);
240 253
241 void CallCodeGeneric( 254 void CallCodeGeneric(
242 Handle<Code> code, 255 Handle<Code> code,
243 RelocInfo::Mode mode, 256 RelocInfo::Mode mode,
257 int num_arguments,
244 LInstruction* instr, 258 LInstruction* instr,
245 SafepointMode safepoint_mode, 259 SafepointMode safepoint_mode,
246 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS); 260 TargetAddressStorageMode storage_mode = CAN_INLINE_TARGET_ADDRESS);
247 261
248 void CallRuntime(const Runtime::Function* function, 262 void CallRuntime(const Runtime::Function* function,
249 int num_arguments, 263 int num_arguments,
250 LInstruction* instr); 264 LInstruction* instr);
251 265
252 void CallRuntime(Runtime::FunctionId id, 266 void CallRuntime(Runtime::FunctionId id,
253 int num_arguments, 267 int num_arguments,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_; 415 ZoneList<Deoptimizer::JumpTableEntry> deopt_jump_table_;
402 ZoneList<Handle<Object> > deoptimization_literals_; 416 ZoneList<Handle<Object> > deoptimization_literals_;
403 int inlined_function_count_; 417 int inlined_function_count_;
404 Scope* const scope_; 418 Scope* const scope_;
405 Status status_; 419 Status status_;
406 TranslationBuffer translations_; 420 TranslationBuffer translations_;
407 ZoneList<LDeferredCode*> deferred_; 421 ZoneList<LDeferredCode*> deferred_;
408 int osr_pc_offset_; 422 int osr_pc_offset_;
409 int last_lazy_deopt_pc_; 423 int last_lazy_deopt_pc_;
410 bool frame_is_built_; 424 bool frame_is_built_;
425 int fp_sp_delta_;
411 426
412 // Builder that keeps track of safepoints in the code. The table 427 // Builder that keeps track of safepoints in the code. The table
413 // itself is emitted at the end of the generated code. 428 // itself is emitted at the end of the generated code.
414 SafepointTableBuilder safepoints_; 429 SafepointTableBuilder safepoints_;
415 430
416 // Compiler from a set of parallel moves to a sequential list of moves. 431 // Compiler from a set of parallel moves to a sequential list of moves.
417 LGapResolver resolver_; 432 LGapResolver resolver_;
418 433
419 Safepoint::Kind expected_safepoint_kind_; 434 Safepoint::Kind expected_safepoint_kind_;
420 435
421 int old_position_; 436 int old_position_;
422 437
423 class PushSafepointRegistersScope BASE_EMBEDDED { 438 class PushSafepointRegistersScope BASE_EMBEDDED {
424 public: 439 public:
425 PushSafepointRegistersScope(LCodeGen* codegen, 440 PushSafepointRegistersScope(LCodeGen* codegen,
426 Safepoint::Kind kind) 441 Safepoint::Kind kind)
427 : codegen_(codegen) { 442 : codegen_(codegen) {
428 ASSERT(codegen_->info()->is_calling()); 443 ASSERT(codegen_->info()->is_calling());
429 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); 444 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
430 codegen_->expected_safepoint_kind_ = kind; 445 codegen_->expected_safepoint_kind_ = kind;
431 446
432 switch (codegen_->expected_safepoint_kind_) { 447 switch (codegen_->expected_safepoint_kind_) {
433 case Safepoint::kWithRegisters: 448 case Safepoint::kWithRegisters:
434 codegen_->masm_->PushSafepointRegisters(); 449 codegen_->masm_->PushSafepointRegisters();
435 break; 450 codegen_->fp_sp_delta_ += kNumSafepointSavedRegisters * kPointerSize;
451 break;
436 case Safepoint::kWithRegistersAndDoubles: 452 case Safepoint::kWithRegistersAndDoubles:
437 codegen_->masm_->PushSafepointRegistersAndDoubles(); 453 codegen_->masm_->PushSafepointRegistersAndDoubles();
454 codegen_->fp_sp_delta_ += kNumSafepointSavedRegisters * kPointerSize
455 + DwVfpRegister::NumAllocatableRegisters() * kDoubleSize;
438 break; 456 break;
439 default: 457 default:
440 UNREACHABLE(); 458 UNREACHABLE();
441 } 459 }
442 } 460 }
443 461
444 ~PushSafepointRegistersScope() { 462 ~PushSafepointRegistersScope() {
445 Safepoint::Kind kind = codegen_->expected_safepoint_kind_; 463 Safepoint::Kind kind = codegen_->expected_safepoint_kind_;
446 ASSERT((kind & Safepoint::kWithRegisters) != 0); 464 ASSERT((kind & Safepoint::kWithRegisters) != 0);
447 switch (kind) { 465 switch (kind) {
448 case Safepoint::kWithRegisters: 466 case Safepoint::kWithRegisters:
449 codegen_->masm_->PopSafepointRegisters(); 467 codegen_->masm_->PopSafepointRegisters();
468 codegen_->fp_sp_delta_ -= kNumSafepointRegisters * kPointerSize;
450 break; 469 break;
451 case Safepoint::kWithRegistersAndDoubles: 470 case Safepoint::kWithRegistersAndDoubles:
452 codegen_->masm_->PopSafepointRegistersAndDoubles(); 471 codegen_->masm_->PopSafepointRegistersAndDoubles();
472 codegen_->fp_sp_delta_ -= kNumSafepointSavedRegisters * kPointerSize
473 + DwVfpRegister::NumAllocatableRegisters() * kDoubleSize;
453 break; 474 break;
454 default: 475 default:
455 UNREACHABLE(); 476 UNREACHABLE();
456 } 477 }
457 codegen_->expected_safepoint_kind_ = Safepoint::kSimple; 478 codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
458 } 479 }
459 480
460 private: 481 private:
461 LCodeGen* codegen_; 482 LCodeGen* codegen_;
462 }; 483 };
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 LCodeGen* codegen_; 515 LCodeGen* codegen_;
495 Label entry_; 516 Label entry_;
496 Label exit_; 517 Label exit_;
497 Label* external_exit_; 518 Label* external_exit_;
498 int instruction_index_; 519 int instruction_index_;
499 }; 520 };
500 521
501 } } // namespace v8::internal 522 } } // namespace v8::internal
502 523
503 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ 524 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698