Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 18196:ff1f1481b367
Fix bug in code installer.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 30 Oct 2014 18:14:41 +0100 |
parents | 9619ba4daf4c |
children | a8cff27ca2e1 6eda3b299460 |
comparison
equal
deleted
inserted
replaced
18195:62d3440228b8 | 18196:ff1f1481b367 |
---|---|
550 _debug_recorder = new DebugInformationRecorder(_oop_recorder); | 550 _debug_recorder = new DebugInformationRecorder(_oop_recorder); |
551 _debug_recorder->set_oopmaps(new OopMapSet()); | 551 _debug_recorder->set_oopmaps(new OopMapSet()); |
552 | 552 |
553 buffer.initialize_oop_recorder(_oop_recorder); | 553 buffer.initialize_oop_recorder(_oop_recorder); |
554 | 554 |
555 // copy the constant data into the newly created CodeBuffer | |
556 address end_data = _constants->start() + _constants_size; | |
557 memcpy(_constants->start(), data_section()->base(T_BYTE), _constants_size); | |
558 _constants->set_end(end_data); | |
559 | |
555 // copy the code into the newly created CodeBuffer | 560 // copy the code into the newly created CodeBuffer |
556 address end_pc = _instructions->start() + _code_size; | 561 address end_pc = _instructions->start() + _code_size; |
557 if (!_instructions->allocates2(end_pc)) { | 562 if (!_instructions->allocates2(end_pc)) { |
558 return false; | 563 return false; |
559 } | 564 } |
560 memcpy(_instructions->start(), code()->base(T_BYTE), code()->length()); | 565 memcpy(_instructions->start(), code()->base(T_BYTE), _code_size); |
561 _instructions->set_end(end_pc); | 566 _instructions->set_end(end_pc); |
562 | |
563 // copy the constant data into the newly created CodeBuffer | |
564 address end_data = _constants->start() + _constants_size; | |
565 memcpy(_constants->start(), data_section()->base(T_BYTE), _constants_size); | |
566 _constants->set_end(end_data); | |
567 | |
568 | 567 |
569 for (int i = 0; i < data_section_patches()->length(); i++) { | 568 for (int i = 0; i < data_section_patches()->length(); i++) { |
570 Handle patch = data_section_patches()->obj_at(i); | 569 Handle patch = data_section_patches()->obj_at(i); |
571 Handle reference = CompilationResult_DataPatch::reference(patch); | 570 Handle reference = CompilationResult_DataPatch::reference(patch); |
572 assert(reference->is_a(CompilationResult_ConstantReference::klass()), err_msg("patch in data section must be a ConstantReference")); | 571 assert(reference->is_a(CompilationResult_ConstantReference::klass()), err_msg("patch in data section must be a ConstantReference")); |