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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 } \ | 334 } \ |
335 __ bind(&done); \ | 335 __ bind(&done); \ |
336 } while (false) | 336 } while (false) |
337 | 337 |
338 | 338 |
339 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 339 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
340 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 340 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
341 if (sp_slot_delta > 0) { | 341 if (sp_slot_delta > 0) { |
342 __ add(esp, Immediate(sp_slot_delta * kPointerSize)); | 342 __ add(esp, Immediate(sp_slot_delta * kPointerSize)); |
343 } | 343 } |
344 if (frame()->needs_frame()) { | |
345 __ pop(ebp); | |
346 } | |
347 frame_access_state()->SetFrameAccessToDefault(); | 344 frame_access_state()->SetFrameAccessToDefault(); |
348 } | 345 } |
349 | 346 |
350 | 347 |
351 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { | 348 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
352 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 349 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
353 if (sp_slot_delta < 0) { | 350 if (sp_slot_delta < 0) { |
354 __ sub(esp, Immediate(-sp_slot_delta * kPointerSize)); | 351 __ sub(esp, Immediate(-sp_slot_delta * kPointerSize)); |
355 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); | 352 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
356 } | 353 } |
| 354 if (frame()->needs_frame()) { |
| 355 __ mov(ebp, MemOperand(ebp, 0)); |
| 356 } |
357 frame_access_state()->SetFrameAccessToSP(); | 357 frame_access_state()->SetFrameAccessToSP(); |
358 } | 358 } |
359 | 359 |
360 | 360 |
361 // Assembles an instruction after register allocation, producing machine code. | 361 // Assembles an instruction after register allocation, producing machine code. |
362 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 362 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
363 X87OperandConverter i(this, instr); | 363 X87OperandConverter i(this, instr); |
364 | 364 |
365 switch (ArchOpcodeField::decode(instr->opcode())) { | 365 switch (ArchOpcodeField::decode(instr->opcode())) { |
366 case kArchCallCodeObject: { | 366 case kArchCallCodeObject: { |
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1991 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1991 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1992 __ Nop(padding_size); | 1992 __ Nop(padding_size); |
1993 } | 1993 } |
1994 } | 1994 } |
1995 | 1995 |
1996 #undef __ | 1996 #undef __ |
1997 | 1997 |
1998 } // namespace compiler | 1998 } // namespace compiler |
1999 } // namespace internal | 1999 } // namespace internal |
2000 } // namespace v8 | 2000 } // namespace v8 |
OLD | NEW |