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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 } | 2531 } |
2532 | 2532 |
2533 // Call C function. | 2533 // Call C function. |
2534 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. | 2534 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. |
2535 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. | 2535 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. |
2536 __ mov(Operand(esp, 2 * kPointerSize), | 2536 __ mov(Operand(esp, 2 * kPointerSize), |
2537 Immediate(ExternalReference::isolate_address(isolate()))); | 2537 Immediate(ExternalReference::isolate_address(isolate()))); |
2538 __ call(ebx); | 2538 __ call(ebx); |
2539 // Result is in eax or edx:eax - do not destroy these registers! | 2539 // Result is in eax or edx:eax - do not destroy these registers! |
2540 | 2540 |
2541 // Runtime functions should not return 'the hole'. Allowing it to escape may | |
2542 // lead to crashes in the IC code later. | |
2543 if (FLAG_debug_code) { | |
2544 Label okay; | |
2545 __ cmp(eax, isolate()->factory()->the_hole_value()); | |
2546 __ j(not_equal, &okay, Label::kNear); | |
2547 __ int3(); | |
2548 __ bind(&okay); | |
2549 } | |
2550 | |
2551 // Check result for exception sentinel. | 2541 // Check result for exception sentinel. |
2552 Label exception_returned; | 2542 Label exception_returned; |
2553 __ cmp(eax, isolate()->factory()->exception()); | 2543 __ cmp(eax, isolate()->factory()->exception()); |
2554 __ j(equal, &exception_returned); | 2544 __ j(equal, &exception_returned); |
2555 | 2545 |
2556 // Check that there is no pending exception, otherwise we | 2546 // Check that there is no pending exception, otherwise we |
2557 // should have returned the exception sentinel. | 2547 // should have returned the exception sentinel. |
2558 if (FLAG_debug_code) { | 2548 if (FLAG_debug_code) { |
2559 __ push(edx); | 2549 __ push(edx); |
2560 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); | 2550 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); |
(...skipping 2623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5184 ApiParameterOperand(2), kStackSpace, nullptr, | 5174 ApiParameterOperand(2), kStackSpace, nullptr, |
5185 Operand(ebp, 7 * kPointerSize), NULL); | 5175 Operand(ebp, 7 * kPointerSize), NULL); |
5186 } | 5176 } |
5187 | 5177 |
5188 | 5178 |
5189 #undef __ | 5179 #undef __ |
5190 | 5180 |
5191 } } // namespace v8::internal | 5181 } } // namespace v8::internal |
5192 | 5182 |
5193 #endif // V8_TARGET_ARCH_IA32 | 5183 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |