blob: a4f41b7fb2f446d7ca590c8e1840a9522723a112 [file] [log] [blame]
Carl Shapiro3ee755d2011-06-28 12:11:04 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#include "src/globals.h"
4#include "src/object.h"
5#include "src/logging.h"
6
7namespace art {
8
9uint32_t Method::NumArgRegisters() {
10 CHECK(shorty_ != NULL);
11 uint32_t num_registers = 0;
12 for (size_t i = 1; shorty_[0] != '\0'; ++i) {
13 char ch = shorty_[i];
14 if (ch == 'D' || ch == 'J') {
15 num_registers += 2;
16 } else {
17 num_registers += 1;
18 }
19 }
20 return num_registers;
21}
22
23} // namespace art