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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/runtime/runtime.h" | 7 #include "src/runtime/runtime.h" |
8 #include "src/runtime/runtime-utils.h" | 8 #include "src/runtime/runtime-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 | 41 |
42 #define I(name, number_of_args, result_size) \ | 42 #define I(name, number_of_args, result_size) \ |
43 { \ | 43 { \ |
44 Runtime::kInline##name, Runtime::INLINE, "_" #name, \ | 44 Runtime::kInline##name, Runtime::INLINE, "_" #name, \ |
45 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \ | 45 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \ |
46 } \ | 46 } \ |
47 , | 47 , |
48 | 48 |
49 | 49 |
50 #define IO(name, number_of_args, result_size) \ | |
51 { \ | |
52 Runtime::kInlineOptimized##name, Runtime::INLINE_OPTIMIZED, "_" #name, \ | |
53 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \ | |
54 } \ | |
55 , | |
56 | |
57 | |
58 static const Runtime::Function kIntrinsicFunctions[] = { | 50 static const Runtime::Function kIntrinsicFunctions[] = { |
59 RUNTIME_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F) | 51 RUNTIME_FUNCTION_LIST(F) INLINE_OPTIMIZED_FUNCTION_LIST(F) |
60 INLINE_FUNCTION_LIST(I) INLINE_OPTIMIZED_FUNCTION_LIST(IO)}; | 52 INLINE_FUNCTION_LIST(I) INLINE_OPTIMIZED_FUNCTION_LIST(I)}; |
61 | 53 |
62 #undef IO | |
63 #undef I | 54 #undef I |
64 #undef F | 55 #undef F |
65 | 56 |
66 | 57 |
67 void Runtime::InitializeIntrinsicFunctionNames(Isolate* isolate, | 58 void Runtime::InitializeIntrinsicFunctionNames(Isolate* isolate, |
68 Handle<NameDictionary> dict) { | 59 Handle<NameDictionary> dict) { |
69 DCHECK(dict->NumberOfElements() == 0); | 60 DCHECK(dict->NumberOfElements() == 0); |
70 HandleScope scope(isolate); | 61 HandleScope scope(isolate); |
71 for (int i = 0; i < kNumFunctions; ++i) { | 62 for (int i = 0; i < kNumFunctions; ++i) { |
72 const char* name = kIntrinsicFunctions[i].name; | 63 const char* name = kIntrinsicFunctions[i].name; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 97 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
107 } | 98 } |
108 | 99 |
109 | 100 |
110 std::ostream& operator<<(std::ostream& os, Runtime::FunctionId id) { | 101 std::ostream& operator<<(std::ostream& os, Runtime::FunctionId id) { |
111 return os << Runtime::FunctionForId(id)->name; | 102 return os << Runtime::FunctionForId(id)->name; |
112 } | 103 } |
113 | 104 |
114 } // namespace internal | 105 } // namespace internal |
115 } // namespace v8 | 106 } // namespace v8 |
OLD | NEW |