Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-57270] Use the refactored isolate arguments and cleanup. #9947

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ public void parse(CEntryPointCreateIsolateParameters parameters, IsolateArgument
}

copyStringArguments(arguments);

// Temporarily needed.
overrideParameters(parameters, arguments);
}

@Uninterruptible(reason = "Tear-down in progress.")
Expand Down Expand Up @@ -269,12 +266,6 @@ private static void copyStringArguments(IsolateArguments arguments) {
}
}

// Temporary method.
@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
protected void overrideParameters(CEntryPointCreateIsolateParameters parameters, IsolateArguments arguments) {
parameters.setReservedSpaceSize(WordFactory.unsigned(readLong(arguments, getOptionIndex(SubstrateGCOptions.ReservedAddressSpaceSize))));
}

/**
* Note that this logic must be in sync with
* {@link com.oracle.svm.core.option.RuntimeOptionParser#parseAndConsumeAllOptions}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.graalvm.nativeimage.c.type.CLongPointer;
import org.graalvm.word.PointerBase;

import com.oracle.svm.core.c.function.CEntryPointCreateIsolateParameters;

@RawStructure
public interface IsolateArguments extends PointerBase {

Expand Down Expand Up @@ -60,7 +58,6 @@ public interface IsolateArguments extends PointerBase {
@RawField
void setProtectionKey(int pkey);

// Temporary unused.
@RawField
int getProtectionKey();

Expand All @@ -70,11 +67,4 @@ public interface IsolateArguments extends PointerBase {
@RawField
boolean getIsCompilationIsolate();

// Temporary field.
@RawField
void setParameters(CEntryPointCreateIsolateParameters parameters);

@RawField
CEntryPointCreateIsolateParameters getParameters();

}
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ private static int createIsolate(CEntryPointCreateIsolateParameters providedPara
CLongPointer parsedArgs = StackValue.get(IsolateArgumentParser.singleton().getParsedArgsSize());
arguments.setParsedArgs(parsedArgs);

// Temporarily needed.
arguments.setParameters(parameters);

IsolateArgumentParser.singleton().parse(parameters, arguments);

Container.initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import com.oracle.svm.core.IsolateArguments;
import com.oracle.svm.core.Uninterruptible;
import com.oracle.svm.core.c.function.CEntryPointCreateIsolateParameters;

import jdk.graal.compiler.api.replacements.Fold;

Expand All @@ -53,13 +52,7 @@ static CommittedMemoryProvider get() {
* @return zero in case of success, non-zero in case of an error.
*/
@Uninterruptible(reason = "Still being initialized.")
int initialize(WordPointer heapBasePointer, CEntryPointCreateIsolateParameters parameters);

@Uninterruptible(reason = "Still being initialized.")
default int initialize(WordPointer heapBasePointer, IsolateArguments arguments) {
// The default implementation of this method is temporary.
return initialize(heapBasePointer, arguments.getParameters());
}
int initialize(WordPointer heapBasePointer, IsolateArguments arguments);

/**
* Tear down <em>for the current isolate</em>. This must be the last method of this interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import org.graalvm.nativeimage.Platforms;
import org.graalvm.nativeimage.c.type.WordPointer;

import com.oracle.svm.core.IsolateArguments;
import com.oracle.svm.core.Isolates;
import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.Uninterruptible;
import com.oracle.svm.core.c.function.CEntryPointCreateIsolateParameters;
import com.oracle.svm.core.c.function.CEntryPointErrors;
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
import com.oracle.svm.core.feature.InternalFeature;
Expand All @@ -48,7 +48,7 @@ public OSCommittedMemoryProvider() {

@Override
@Uninterruptible(reason = "Still being initialized.")
public int initialize(WordPointer heapBasePointer, CEntryPointCreateIsolateParameters parameters) {
public int initialize(WordPointer heapBasePointer, IsolateArguments arguments) {
if (!SubstrateOptions.SpawnIsolates.getValue()) {
int result = protectSingleIsolateImageHeap();
if (result == CEntryPointErrors.NO_ERROR) {
Expand Down