Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/c1_Runtime1_x86.cpp @ 3538:e4616e3d207b
support for new CiRuntimeCalls CreateNullPointerException and CreateOutOfBoundsException
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 10 Aug 2011 18:19:09 +0200 |
parents | 28ba2439034f |
children | bc95d122df79 |
comparison
equal
deleted
inserted
replaced
3536:c4f88f4ede54 | 3538:e4616e3d207b |
---|---|
1050 | 1050 |
1051 JRT_ENTRY(void, graal_create_null_exception(JavaThread* thread)) | 1051 JRT_ENTRY(void, graal_create_null_exception(JavaThread* thread)) |
1052 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); | 1052 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL)()); |
1053 JRT_END | 1053 JRT_END |
1054 | 1054 |
1055 JRT_ENTRY(void, graal_create_out_of_bounds_exception(JavaThread* thread, jint index)) | |
1056 char message[jintAsStringSize]; | |
1057 sprintf(message, "%d", index); | |
1058 thread->set_vm_result(Exceptions::new_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message)()); | |
1059 JRT_END | |
1060 | |
1055 | 1061 |
1056 | 1062 |
1057 | 1063 |
1058 OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { | 1064 OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { |
1059 | 1065 |
1913 generate_unwind_exception(sasm); | 1919 generate_unwind_exception(sasm); |
1914 __ should_not_reach_here(); | 1920 __ should_not_reach_here(); |
1915 break; | 1921 break; |
1916 } | 1922 } |
1917 | 1923 |
1924 case graal_create_null_pointer_exception_id: { | |
1925 __ enter(); | |
1926 oop_maps = new OopMapSet(); | |
1927 OopMap* oop_map = save_live_registers(sasm, 0); | |
1928 int call_offset = __ call_RT(rax, noreg, (address)graal_create_null_exception, 0); | |
1929 oop_maps->add_gc_map(call_offset, oop_map); | |
1930 __ leave(); | |
1931 __ ret(0); | |
1932 break; | |
1933 } | |
1934 | |
1935 case graal_create_out_of_bounds_exception_id: { | |
1936 __ enter(); | |
1937 oop_maps = new OopMapSet(); | |
1938 OopMap* oop_map = save_live_registers(sasm, 0); | |
1939 int call_offset = __ call_RT(rax, noreg, (address)graal_create_out_of_bounds_exception, c_rarg0); | |
1940 oop_maps->add_gc_map(call_offset, oop_map); | |
1941 __ leave(); | |
1942 __ ret(0); | |
1943 break; | |
1944 } | |
1945 | |
1918 case graal_handle_exception_id: { | 1946 case graal_handle_exception_id: { |
1919 StubFrame f(sasm, "graal_handle_exception", dont_gc_arguments); | 1947 StubFrame f(sasm, "graal_handle_exception", dont_gc_arguments); |
1920 oop_maps = new OopMapSet(); | 1948 oop_maps = new OopMapSet(); |
1921 OopMap* oop_map = save_live_registers(sasm, 1, false); | 1949 OopMap* oop_map = save_live_registers(sasm, 1, false); |
1922 graal_generate_handle_exception(sasm, oop_maps, oop_map); | 1950 graal_generate_handle_exception(sasm, oop_maps, oop_map); |