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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 } | 2179 } |
2180 | 2180 |
2181 // Call C function. | 2181 // Call C function. |
2182 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. | 2182 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. |
2183 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. | 2183 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. |
2184 __ mov(Operand(esp, 2 * kPointerSize), | 2184 __ mov(Operand(esp, 2 * kPointerSize), |
2185 Immediate(ExternalReference::isolate_address(isolate()))); | 2185 Immediate(ExternalReference::isolate_address(isolate()))); |
2186 __ call(ebx); | 2186 __ call(ebx); |
2187 // Result is in eax or edx:eax - do not destroy these registers! | 2187 // Result is in eax or edx:eax - do not destroy these registers! |
2188 | 2188 |
| 2189 // Runtime functions should not return 'the hole'. Allowing it to escape may |
| 2190 // lead to crashes in the IC code later. |
| 2191 if (FLAG_debug_code) { |
| 2192 Label okay; |
| 2193 __ cmp(eax, isolate()->factory()->the_hole_value()); |
| 2194 __ j(not_equal, &okay, Label::kNear); |
| 2195 __ int3(); |
| 2196 __ bind(&okay); |
| 2197 } |
| 2198 |
2189 // Check result for exception sentinel. | 2199 // Check result for exception sentinel. |
2190 Label exception_returned; | 2200 Label exception_returned; |
2191 __ cmp(eax, isolate()->factory()->exception()); | 2201 __ cmp(eax, isolate()->factory()->exception()); |
2192 __ j(equal, &exception_returned); | 2202 __ j(equal, &exception_returned); |
2193 | 2203 |
2194 // Check that there is no pending exception, otherwise we | 2204 // Check that there is no pending exception, otherwise we |
2195 // should have returned the exception sentinel. | 2205 // should have returned the exception sentinel. |
2196 if (FLAG_debug_code) { | 2206 if (FLAG_debug_code) { |
2197 __ push(edx); | 2207 __ push(edx); |
2198 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); | 2208 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); |
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5058 ApiParameterOperand(2), kStackSpace, nullptr, | 5068 ApiParameterOperand(2), kStackSpace, nullptr, |
5059 Operand(ebp, 7 * kPointerSize), NULL); | 5069 Operand(ebp, 7 * kPointerSize), NULL); |
5060 } | 5070 } |
5061 | 5071 |
5062 | 5072 |
5063 #undef __ | 5073 #undef __ |
5064 | 5074 |
5065 } } // namespace v8::internal | 5075 } } // namespace v8::internal |
5066 | 5076 |
5067 #endif // V8_TARGET_ARCH_X87 | 5077 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |