OLD | NEW |
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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 | 5476 |
5477 Register callee = edi; | 5477 Register callee = edi; |
5478 Register call_data = ebx; | 5478 Register call_data = ebx; |
5479 Register holder = ecx; | 5479 Register holder = ecx; |
5480 Register api_function_address = edx; | 5480 Register api_function_address = edx; |
5481 Register context = esi; | 5481 Register context = esi; |
5482 Register return_address = eax; | 5482 Register return_address = eax; |
5483 | 5483 |
5484 typedef FunctionCallbackArguments FCA; | 5484 typedef FunctionCallbackArguments FCA; |
5485 | 5485 |
5486 STATIC_ASSERT(FCA::kContextSaveIndex == 5); | 5486 STATIC_ASSERT(FCA::kContextSaveIndex == 6); |
| 5487 STATIC_ASSERT(FCA::kCalleeIndex == 5); |
5487 STATIC_ASSERT(FCA::kDataIndex == 4); | 5488 STATIC_ASSERT(FCA::kDataIndex == 4); |
5488 STATIC_ASSERT(FCA::kReturnValueOffset == 3); | 5489 STATIC_ASSERT(FCA::kReturnValueOffset == 3); |
5489 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); | 5490 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); |
5490 STATIC_ASSERT(FCA::kIsolateIndex == 1); | 5491 STATIC_ASSERT(FCA::kIsolateIndex == 1); |
5491 STATIC_ASSERT(FCA::kHolderIndex == 0); | 5492 STATIC_ASSERT(FCA::kHolderIndex == 0); |
5492 STATIC_ASSERT(FCA::kArgsLength == 6); | 5493 STATIC_ASSERT(FCA::kArgsLength == 7); |
5493 | 5494 |
5494 DCHECK(argc.is_immediate() || eax.is(argc.reg())); | 5495 DCHECK(argc.is_immediate() || eax.is(argc.reg())); |
5495 | 5496 |
5496 if (argc.is_immediate()) { | 5497 if (argc.is_immediate()) { |
5497 __ pop(return_address); | 5498 __ pop(return_address); |
5498 // context save. | 5499 // context save. |
5499 __ push(context); | 5500 __ push(context); |
5500 } else { | 5501 } else { |
5501 // pop return address and save context | 5502 // pop return address and save context |
5502 __ xchg(context, Operand(esp, 0)); | 5503 __ xchg(context, Operand(esp, 0)); |
5503 return_address = context; | 5504 return_address = context; |
5504 } | 5505 } |
5505 | 5506 |
| 5507 // callee |
| 5508 __ push(callee); |
| 5509 |
5506 // call data | 5510 // call data |
5507 __ push(call_data); | 5511 __ push(call_data); |
5508 | 5512 |
5509 Register scratch = call_data; | 5513 Register scratch = call_data; |
5510 if (!call_data_undefined) { | 5514 if (!call_data_undefined) { |
5511 // return value | 5515 // return value |
5512 __ push(Immediate(masm->isolate()->factory()->undefined_value())); | 5516 __ push(Immediate(masm->isolate()->factory()->undefined_value())); |
5513 // return value default | 5517 // return value default |
5514 __ push(Immediate(masm->isolate()->factory()->undefined_value())); | 5518 __ push(Immediate(masm->isolate()->factory()->undefined_value())); |
5515 } else { | 5519 } else { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5650 Operand(ebp, 7 * kPointerSize), NULL); | 5654 Operand(ebp, 7 * kPointerSize), NULL); |
5651 } | 5655 } |
5652 | 5656 |
5653 | 5657 |
5654 #undef __ | 5658 #undef __ |
5655 | 5659 |
5656 } // namespace internal | 5660 } // namespace internal |
5657 } // namespace v8 | 5661 } // namespace v8 |
5658 | 5662 |
5659 #endif // V8_TARGET_ARCH_IA32 | 5663 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |