OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5031 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. | 5031 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. |
5032 __ mov(Operand(esp, 2 * kPointerSize), | 5032 __ mov(Operand(esp, 2 * kPointerSize), |
5033 Immediate(ExternalReference::isolate_address())); | 5033 Immediate(ExternalReference::isolate_address())); |
5034 __ call(ebx); | 5034 __ call(ebx); |
5035 // Result is in eax or edx:eax - do not destroy these registers! | 5035 // Result is in eax or edx:eax - do not destroy these registers! |
5036 | 5036 |
5037 if (always_allocate_scope) { | 5037 if (always_allocate_scope) { |
5038 __ dec(Operand::StaticVariable(scope_depth)); | 5038 __ dec(Operand::StaticVariable(scope_depth)); |
5039 } | 5039 } |
5040 | 5040 |
5041 // Make sure we're not trying to return 'the hole' from the runtime | 5041 // Runtime functions should not return 'the hole'. Allowing it to escape may |
5042 // call as this may lead to crashes in the IC code later. | 5042 // lead to crashes in the IC code later. |
5043 if (FLAG_debug_code) { | 5043 if (FLAG_debug_code) { |
5044 Label okay; | 5044 Label okay; |
5045 __ cmp(eax, masm->isolate()->factory()->the_hole_value()); | 5045 __ cmp(eax, masm->isolate()->factory()->the_hole_value()); |
5046 __ j(not_equal, &okay, Label::kNear); | 5046 __ j(not_equal, &okay, Label::kNear); |
| 5047 // TODO(wingo): Currently SuspendJSGeneratorObject returns the hole. Change |
| 5048 // to return another sentinel like a harmony symbol. |
| 5049 __ cmp(ebx, Immediate(ExternalReference( |
| 5050 Runtime::kSuspendJSGeneratorObject, masm->isolate()))); |
| 5051 __ j(equal, &okay, Label::kNear); |
5047 __ int3(); | 5052 __ int3(); |
5048 __ bind(&okay); | 5053 __ bind(&okay); |
5049 } | 5054 } |
5050 | 5055 |
5051 // Check for failure result. | 5056 // Check for failure result. |
5052 Label failure_returned; | 5057 Label failure_returned; |
5053 STATIC_ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0); | 5058 STATIC_ASSERT(((kFailureTag + 1) & kFailureTagMask) == 0); |
5054 __ lea(ecx, Operand(eax, 1)); | 5059 __ lea(ecx, Operand(eax, 1)); |
5055 // Lower 2 bits of ecx are 0 iff eax has failure tag. | 5060 // Lower 2 bits of ecx are 0 iff eax has failure tag. |
5056 __ test(ecx, Immediate(kFailureTagMask)); | 5061 __ test(ecx, Immediate(kFailureTagMask)); |
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7709 // Restore ecx. | 7714 // Restore ecx. |
7710 __ pop(ecx); | 7715 __ pop(ecx); |
7711 __ ret(0); | 7716 __ ret(0); |
7712 } | 7717 } |
7713 | 7718 |
7714 #undef __ | 7719 #undef __ |
7715 | 7720 |
7716 } } // namespace v8::internal | 7721 } } // namespace v8::internal |
7717 | 7722 |
7718 #endif // V8_TARGET_ARCH_IA32 | 7723 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |