Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java @ 8354:55ef03d64f03
Generalize read and write of fixed register for snippets. Move to HotSpot-independent project.
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 18 Mar 2013 19:28:44 -0700 |
parents | 14fedab0419e |
children | c3657d00e343 |
comparison
equal
deleted
inserted
replaced
8353:98b90a7bb764 | 8354:55ef03d64f03 |
---|---|
32 import com.oracle.graal.hotspot.*; | 32 import com.oracle.graal.hotspot.*; |
33 import com.oracle.graal.hotspot.meta.*; | 33 import com.oracle.graal.hotspot.meta.*; |
34 import com.oracle.graal.hotspot.nodes.*; | 34 import com.oracle.graal.hotspot.nodes.*; |
35 import com.oracle.graal.nodes.extended.*; | 35 import com.oracle.graal.nodes.extended.*; |
36 import com.oracle.graal.snippets.Snippet.Fold; | 36 import com.oracle.graal.snippets.Snippet.Fold; |
37 import com.oracle.graal.snippets.nodes.*; | |
37 import com.oracle.graal.word.*; | 38 import com.oracle.graal.word.*; |
38 | 39 |
39 //JaCoCo Exclude | 40 //JaCoCo Exclude |
40 | 41 |
41 /** | 42 /** |
336 | 337 |
337 /** | 338 /** |
338 * Gets the value of the stack pointer register as a Word. | 339 * Gets the value of the stack pointer register as a Word. |
339 */ | 340 */ |
340 public static Word stackPointer() { | 341 public static Word stackPointer() { |
341 return HotSpotSnippetUtils.registerAsWord(stackPointerRegister()); | 342 return HotSpotSnippetUtils.registerAsWord(stackPointerRegister(), true, false); |
342 } | 343 } |
343 | 344 |
344 /** | 345 /** |
345 * Gets the value of the thread register as a Word. | 346 * Gets the value of the thread register as a Word. |
346 */ | 347 */ |
347 public static Word thread() { | 348 public static Word thread() { |
348 return HotSpotSnippetUtils.registerAsWord(threadRegister()); | 349 return HotSpotSnippetUtils.registerAsWord(threadRegister(), true, false); |
349 } | 350 } |
350 | 351 |
351 public static Word loadWordFromObject(Object object, int offset) { | 352 public static Word loadWordFromObject(Object object, int offset) { |
352 return loadWordFromObjectIntrinsic(object, 0, offset, wordKind()); | 353 return loadWordFromObjectIntrinsic(object, 0, offset, wordKind()); |
353 } | 354 } |
354 | 355 |
355 @NodeIntrinsic(value = RegisterNode.class, setStampFromReturnType = true) | 356 @NodeIntrinsic(value = ReadRegisterNode.class, setStampFromReturnType = true) |
356 public static native Word registerAsWord(@ConstantNodeParameter Register register); | 357 public static native Word registerAsWord(@ConstantNodeParameter Register register, @ConstantNodeParameter boolean directUse, @ConstantNodeParameter boolean incoming); |
357 | 358 |
358 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true) | 359 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true) |
359 private static native Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind); | 360 private static native Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind); |
360 | 361 |
361 @NodeIntrinsic(value = LoadHubNode.class, setStampFromReturnType = true) | 362 @NodeIntrinsic(value = LoadHubNode.class, setStampFromReturnType = true) |