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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/ia32/assembler-ia32.h" | 10 #include "src/ia32/assembler-ia32.h" |
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 } | 1332 } |
1333 __ pop(ebp); // Pop caller's frame pointer. | 1333 __ pop(ebp); // Pop caller's frame pointer. |
1334 __ ret(0); | 1334 __ ret(0); |
1335 } else { | 1335 } else { |
1336 // No saved registers. | 1336 // No saved registers. |
1337 __ mov(esp, ebp); // Move stack pointer back to frame pointer. | 1337 __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
1338 __ pop(ebp); // Pop caller's frame pointer. | 1338 __ pop(ebp); // Pop caller's frame pointer. |
1339 __ ret(0); | 1339 __ ret(0); |
1340 } | 1340 } |
1341 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1341 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1342 __ mov(esp, ebp); // Move stack pointer back to frame pointer. | 1342 // Canonicalize JSFunction return sites for now. |
1343 __ pop(ebp); // Pop caller's frame pointer. | 1343 if (return_label_.is_bound()) { |
1344 int pop_count = descriptor->IsJSFunctionCall() | 1344 __ jmp(&return_label_); |
1345 ? static_cast<int>(descriptor->JSParameterCount()) | 1345 } else { |
1346 : 0; | 1346 __ bind(&return_label_); |
1347 __ Ret(pop_count * kPointerSize, ebx); | 1347 __ mov(esp, ebp); // Move stack pointer back to frame pointer. |
| 1348 __ pop(ebp); // Pop caller's frame pointer. |
| 1349 int pop_count = descriptor->IsJSFunctionCall() |
| 1350 ? static_cast<int>(descriptor->JSParameterCount()) |
| 1351 : 0; |
| 1352 __ Ret(pop_count * kPointerSize, ebx); |
| 1353 } |
1348 } else { | 1354 } else { |
1349 __ ret(0); | 1355 __ ret(0); |
1350 } | 1356 } |
1351 } | 1357 } |
1352 | 1358 |
1353 | 1359 |
1354 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1360 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1355 InstructionOperand* destination) { | 1361 InstructionOperand* destination) { |
1356 IA32OperandConverter g(this, NULL); | 1362 IA32OperandConverter g(this, NULL); |
1357 // Dispatch on the source and destination operand kinds. Not all | 1363 // Dispatch on the source and destination operand kinds. Not all |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 __ Nop(padding_size); | 1542 __ Nop(padding_size); |
1537 } | 1543 } |
1538 } | 1544 } |
1539 } | 1545 } |
1540 | 1546 |
1541 #undef __ | 1547 #undef __ |
1542 | 1548 |
1543 } // namespace compiler | 1549 } // namespace compiler |
1544 } // namespace internal | 1550 } // namespace internal |
1545 } // namespace v8 | 1551 } // namespace v8 |
OLD | NEW |