| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } \ | 330 } \ |
| 331 __ bind(&done); \ | 331 __ bind(&done); \ |
| 332 } while (false) | 332 } while (false) |
| 333 | 333 |
| 334 | 334 |
| 335 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 335 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
| 336 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 336 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| 337 if (sp_slot_delta > 0) { | 337 if (sp_slot_delta > 0) { |
| 338 __ add(esp, Immediate(sp_slot_delta * kPointerSize)); | 338 __ add(esp, Immediate(sp_slot_delta * kPointerSize)); |
| 339 } | 339 } |
| 340 if (frame()->needs_frame()) { | |
| 341 __ pop(ebp); | |
| 342 } | |
| 343 frame_access_state()->SetFrameAccessToDefault(); | 340 frame_access_state()->SetFrameAccessToDefault(); |
| 344 } | 341 } |
| 345 | 342 |
| 346 | 343 |
| 347 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { | 344 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
| 348 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 345 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| 349 if (sp_slot_delta < 0) { | 346 if (sp_slot_delta < 0) { |
| 350 __ sub(esp, Immediate(-sp_slot_delta * kPointerSize)); | 347 __ sub(esp, Immediate(-sp_slot_delta * kPointerSize)); |
| 351 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); | 348 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
| 352 } | 349 } |
| 350 if (frame()->needs_frame()) { |
| 351 __ mov(ebp, MemOperand(ebp, 0)); |
| 352 } |
| 353 frame_access_state()->SetFrameAccessToSP(); | 353 frame_access_state()->SetFrameAccessToSP(); |
| 354 } | 354 } |
| 355 | 355 |
| 356 | 356 |
| 357 // Assembles an instruction after register allocation, producing machine code. | 357 // Assembles an instruction after register allocation, producing machine code. |
| 358 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 358 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
| 359 IA32OperandConverter i(this, instr); | 359 IA32OperandConverter i(this, instr); |
| 360 | 360 |
| 361 switch (ArchOpcodeField::decode(instr->opcode())) { | 361 switch (ArchOpcodeField::decode(instr->opcode())) { |
| 362 case kArchCallCodeObject: { | 362 case kArchCallCodeObject: { |
| (...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1652 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 1653 __ Nop(padding_size); | 1653 __ Nop(padding_size); |
| 1654 } | 1654 } |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 #undef __ | 1657 #undef __ |
| 1658 | 1658 |
| 1659 } // namespace compiler | 1659 } // namespace compiler |
| 1660 } // namespace internal | 1660 } // namespace internal |
| 1661 } // namespace v8 | 1661 } // namespace v8 |
| OLD | NEW |