| 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 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 cmp(edi, Operand::StaticVariable(limit_address)); | 1915 cmp(edi, Operand::StaticVariable(limit_address)); |
| 1916 j(not_equal, &delete_allocated_handles); | 1916 j(not_equal, &delete_allocated_handles); |
| 1917 bind(&leave_exit_frame); | 1917 bind(&leave_exit_frame); |
| 1918 | 1918 |
| 1919 // Check if the function scheduled an exception. | 1919 // Check if the function scheduled an exception. |
| 1920 ExternalReference scheduled_exception_address = | 1920 ExternalReference scheduled_exception_address = |
| 1921 ExternalReference::scheduled_exception_address(isolate()); | 1921 ExternalReference::scheduled_exception_address(isolate()); |
| 1922 cmp(Operand::StaticVariable(scheduled_exception_address), | 1922 cmp(Operand::StaticVariable(scheduled_exception_address), |
| 1923 Immediate(isolate()->factory()->the_hole_value())); | 1923 Immediate(isolate()->factory()->the_hole_value())); |
| 1924 j(not_equal, &promote_scheduled_exception); | 1924 j(not_equal, &promote_scheduled_exception); |
| 1925 |
| 1926 #if ENABLE_EXTRA_CHECKS |
| 1927 // Check if the function returned a valid JavaScript value. |
| 1928 Label ok; |
| 1929 Register return_value = eax; |
| 1930 Register map = ecx; |
| 1931 |
| 1932 JumpIfSmi(return_value, &ok, Label::kNear); |
| 1933 mov(map, FieldOperand(return_value, HeapObject::kMapOffset)); |
| 1934 |
| 1935 CmpInstanceType(map, FIRST_NONSTRING_TYPE); |
| 1936 j(below, &ok, Label::kNear); |
| 1937 |
| 1938 CmpInstanceType(map, FIRST_SPEC_OBJECT_TYPE); |
| 1939 j(above_equal, &ok, Label::kNear); |
| 1940 |
| 1941 cmp(map, isolate()->factory()->heap_number_map()); |
| 1942 j(equal, &ok, Label::kNear); |
| 1943 |
| 1944 cmp(return_value, isolate()->factory()->undefined_value()); |
| 1945 j(equal, &ok, Label::kNear); |
| 1946 |
| 1947 cmp(return_value, isolate()->factory()->true_value()); |
| 1948 j(equal, &ok, Label::kNear); |
| 1949 |
| 1950 cmp(return_value, isolate()->factory()->false_value()); |
| 1951 j(equal, &ok, Label::kNear); |
| 1952 |
| 1953 cmp(return_value, isolate()->factory()->null_value()); |
| 1954 j(equal, &ok, Label::kNear); |
| 1955 |
| 1956 Abort("API call returned invalid object"); |
| 1957 |
| 1958 bind(&ok); |
| 1959 #endif |
| 1960 |
| 1925 LeaveApiExitFrame(); | 1961 LeaveApiExitFrame(); |
| 1926 ret(stack_space * kPointerSize); | 1962 ret(stack_space * kPointerSize); |
| 1927 | 1963 |
| 1928 bind(&empty_handle); | 1964 bind(&empty_handle); |
| 1929 // It was zero; the result is undefined. | 1965 // It was zero; the result is undefined. |
| 1930 mov(eax, isolate()->factory()->undefined_value()); | 1966 mov(eax, isolate()->factory()->undefined_value()); |
| 1931 jmp(&prologue); | 1967 jmp(&prologue); |
| 1932 | 1968 |
| 1933 bind(&promote_scheduled_exception); | 1969 bind(&promote_scheduled_exception); |
| 1934 TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); | 1970 TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2916 // Load the prototype from the map and loop if non-null. | 2952 // Load the prototype from the map and loop if non-null. |
| 2917 bind(&check_prototype); | 2953 bind(&check_prototype); |
| 2918 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2954 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
| 2919 cmp(ecx, isolate()->factory()->null_value()); | 2955 cmp(ecx, isolate()->factory()->null_value()); |
| 2920 j(not_equal, &next); | 2956 j(not_equal, &next); |
| 2921 } | 2957 } |
| 2922 | 2958 |
| 2923 } } // namespace v8::internal | 2959 } } // namespace v8::internal |
| 2924 | 2960 |
| 2925 #endif // V8_TARGET_ARCH_IA32 | 2961 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |