OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 15557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15568 if (entry != kNotFound) { | 15568 if (entry != kNotFound) { |
15569 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); | 15569 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); |
15570 int function_index = Smi::cast(smi_index)->value(); | 15570 int function_index = Smi::cast(smi_index)->value(); |
15571 return &(kIntrinsicFunctions[function_index]); | 15571 return &(kIntrinsicFunctions[function_index]); |
15572 } | 15572 } |
15573 return NULL; | 15573 return NULL; |
15574 } | 15574 } |
15575 | 15575 |
15576 | 15576 |
15577 const Runtime::Function* Runtime::FunctionForEntry(Address entry) { | 15577 const Runtime::Function* Runtime::FunctionForEntry(Address entry) { |
15578 size_t length = sizeof(kIntrinsicFunctions) / sizeof(*kIntrinsicFunctions); | 15578 for (size_t i = 0; i < ARRAY_SIZE(kIntrinsicFunctions); ++i) { |
15579 for (size_t i = 0; i < length; ++i) { | |
15580 if (entry == kIntrinsicFunctions[i].entry) { | 15579 if (entry == kIntrinsicFunctions[i].entry) { |
15581 return &(kIntrinsicFunctions[i]); | 15580 return &(kIntrinsicFunctions[i]); |
15582 } | 15581 } |
15583 } | 15582 } |
15584 return NULL; | 15583 return NULL; |
15585 } | 15584 } |
15586 | 15585 |
15587 | 15586 |
15588 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15587 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15589 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15588 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15590 } | 15589 } |
15591 | 15590 |
15592 } } // namespace v8::internal | 15591 } } // namespace v8::internal |
OLD | NEW |