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 15573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15584 if (entry != kNotFound) { | 15584 if (entry != kNotFound) { |
15585 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); | 15585 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); |
15586 int function_index = Smi::cast(smi_index)->value(); | 15586 int function_index = Smi::cast(smi_index)->value(); |
15587 return &(kIntrinsicFunctions[function_index]); | 15587 return &(kIntrinsicFunctions[function_index]); |
15588 } | 15588 } |
15589 return NULL; | 15589 return NULL; |
15590 } | 15590 } |
15591 | 15591 |
15592 | 15592 |
15593 const Runtime::Function* Runtime::FunctionForEntry(Address entry) { | 15593 const Runtime::Function* Runtime::FunctionForEntry(Address entry) { |
15594 for (size_t i = 0; i < sizeof(kIntrinsicFunctions); ++i) { | 15594 size_t length = sizeof(kIntrinsicFunctions) / sizeof(*kIntrinsicFunctions); |
| 15595 for (size_t i = 0; i < length; ++i) { |
15595 if (entry == kIntrinsicFunctions[i].entry) { | 15596 if (entry == kIntrinsicFunctions[i].entry) { |
15596 return &(kIntrinsicFunctions[i]); | 15597 return &(kIntrinsicFunctions[i]); |
15597 } | 15598 } |
15598 } | 15599 } |
15599 return NULL; | 15600 return NULL; |
15600 } | 15601 } |
15601 | 15602 |
15602 | 15603 |
15603 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15604 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15604 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15605 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15605 } | 15606 } |
15606 | 15607 |
15607 } } // namespace v8::internal | 15608 } } // namespace v8::internal |
OLD | NEW |