summaryrefslogtreecommitdiffstats
path: root/vm/compiler/codegen/x86/NcgHelper.cpp
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-08-05 12:46:17 -0700
committerBrian Carlstrom <bdc@google.com>2014-08-05 12:51:13 -0700
commit870b4f2d70d67d6dbb7d0881d101c61bed8caad2 (patch)
tree7487dad3970556a040f88a49852a3dc9ed19bebd /vm/compiler/codegen/x86/NcgHelper.cpp
parent76e15e367ae1189b6f641ba8d16ca92bd179dac0 (diff)
downloadandroid_dalvik-870b4f2d70d67d6dbb7d0881d101c61bed8caad2.tar.gz
android_dalvik-870b4f2d70d67d6dbb7d0881d101c61bed8caad2.tar.bz2
android_dalvik-870b4f2d70d67d6dbb7d0881d101c61bed8caad2.zip
Dalvik is dead, long live Dalvik!
croot cd dalvik repo start dalvik-is-dead-long-live-dalvik . repo sync -c . git rm -r README.txt git rm -r dexopt git rm -r tools/deadcode.py git rm -r tools/dex-preopt git rm -r tools/dexcheck git rm -r tools/gdbjithelper git rm -r unit-tests git rm -r vm git checkout HEAD vm/Common.h (needed by libdex) git checkout HEAD vm/DalvikVersion.h (needed by libdex) git checkout HEAD vm/Profile.h (needed by dmtracedump) git add Android.mk (after removing vm, dexopt, and unit-tests references) git commit -a -m 'Dalvik is dead, long live Dalvik!' Bug: 14298175 Change-Id: I9dd13053677629d13496d4238af4374452cda415
Diffstat (limited to 'vm/compiler/codegen/x86/NcgHelper.cpp')
-rw-r--r--vm/compiler/codegen/x86/NcgHelper.cpp104
1 files changed, 0 insertions, 104 deletions
diff --git a/vm/compiler/codegen/x86/NcgHelper.cpp b/vm/compiler/codegen/x86/NcgHelper.cpp
deleted file mode 100644
index c603d09c1..000000000
--- a/vm/compiler/codegen/x86/NcgHelper.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include "Dalvik.h"
-#include "NcgHelper.h"
-#include "interp/InterpDefs.h"
-
-
-/*
- * Find the matching case. Returns the offset to the handler instructions.
- *
- * Returns 3 if we don't find a match (it's the size of the packed-switch
- * instruction).
- */
-s4 dvmNcgHandlePackedSwitch(const s4* entries, s4 firstKey, u2 size, s4 testVal)
-{
- //skip add_reg_reg (ADD_REG_REG_SIZE) and jump_reg (JUMP_REG_SIZE)
- const int kInstrLen = 4; //default to next bytecode
- if (testVal < firstKey || testVal >= firstKey + size) {
- LOGVV("Value %d not found in switch (%d-%d)",
- testVal, firstKey, firstKey+size-1);
- return kInstrLen;
- }
-
- assert(testVal - firstKey >= 0 && testVal - firstKey < size);
- LOGVV("Value %d found in slot %d (goto 0x%02x)",
- testVal, testVal - firstKey,
- s4FromSwitchData(&entries[testVal - firstKey]));
- return s4FromSwitchData(&entries[testVal - firstKey]);
-
-}
-/* return the number of bytes to increase the bytecode pointer by */
-s4 dvmJitHandlePackedSwitch(const s4* entries, s4 firstKey, u2 size, s4 testVal)
-{
- if (testVal < firstKey || testVal >= firstKey + size) {
- LOGVV("Value %d not found in switch (%d-%d)",
- testVal, firstKey, firstKey+size-1);
- return 2*3;//bytecode packed_switch is 6(2*3) bytes long
- }
-
- LOGVV("Value %d found in slot %d (goto 0x%02x)",
- testVal, testVal - firstKey,
- s4FromSwitchData(&entries[testVal - firstKey]));
- return 2*s4FromSwitchData(&entries[testVal - firstKey]); //convert from u2 to byte
-
-}
-/*
- * Find the matching case. Returns the offset to the handler instructions.
- *
- * Returns 3 if we don't find a match (it's the size of the sparse-switch
- * instruction).
- */
-s4 dvmNcgHandleSparseSwitch(const s4* keys, u2 size, s4 testVal)
-{
- const int kInstrLen = 4; //CHECK
- const s4* entries = keys + size;
- int i;
- for (i = 0; i < size; i++) {
- s4 k = s4FromSwitchData(&keys[i]);
- if (k == testVal) {
- LOGVV("Value %d found in entry %d (goto 0x%02x)",
- testVal, i, s4FromSwitchData(&entries[i]));
- return s4FromSwitchData(&entries[i]);
- } else if (k > testVal) {
- break;
- }
- }
-
- LOGVV("Value %d not found in switch", testVal);
- return kInstrLen;
-}
-/* return the number of bytes to increase the bytecode pointer by */
-s4 dvmJitHandleSparseSwitch(const s4* keys, u2 size, s4 testVal)
-{
- const s4* entries = keys + size;
- int i;
- for (i = 0; i < size; i++) {
- s4 k = s4FromSwitchData(&keys[i]);
- if (k == testVal) {
- LOGVV("Value %d found in entry %d (goto 0x%02x)",
- testVal, i, s4FromSwitchData(&entries[i]));
- return 2*s4FromSwitchData(&entries[i]); //convert from u2 to byte
- } else if (k > testVal) {
- break;
- }
- }
-
- LOGVV("Value %d not found in switch", testVal);
- return 2*3; //bytecode sparse_switch is 6(2*3) bytes long
-}