| 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/runtime/runtime.h" | 5 #include "src/runtime/runtime.h" |
| 6 | 6 |
| 7 #include "src/contexts.h" |
| 7 #include "src/handles-inl.h" | 8 #include "src/handles-inl.h" |
| 8 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
| 9 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| 10 #include "src/runtime/runtime-utils.h" | 11 #include "src/runtime/runtime-utils.h" |
| 11 | 12 |
| 12 namespace v8 { | 13 namespace v8 { |
| 13 namespace internal { | 14 namespace internal { |
| 14 | 15 |
| 15 // Header of runtime functions. | 16 // Header of runtime functions. |
| 16 #define F(name, number_of_args, result_size) \ | 17 #define F(name, number_of_args, result_size) \ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 34 , | 35 , |
| 35 | 36 |
| 36 | 37 |
| 37 #define I(name, number_of_args, result_size) \ | 38 #define I(name, number_of_args, result_size) \ |
| 38 { \ | 39 { \ |
| 39 Runtime::kInline##name, Runtime::INLINE, "_" #name, \ | 40 Runtime::kInline##name, Runtime::INLINE, "_" #name, \ |
| 40 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \ | 41 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \ |
| 41 } \ | 42 } \ |
| 42 , | 43 , |
| 43 | 44 |
| 44 | |
| 45 static const Runtime::Function kIntrinsicFunctions[] = { | 45 static const Runtime::Function kIntrinsicFunctions[] = { |
| 46 FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC(I)}; | 46 FOR_EACH_INTRINSIC(F) |
| 47 FOR_EACH_INTRINSIC(I) |
| 48 }; |
| 47 | 49 |
| 48 #undef I | 50 #undef I |
| 49 #undef F | 51 #undef F |
| 50 | 52 |
| 51 | 53 |
| 52 void Runtime::InitializeIntrinsicFunctionNames(Isolate* isolate, | 54 void Runtime::InitializeIntrinsicFunctionNames(Isolate* isolate, |
| 53 Handle<NameDictionary> dict) { | 55 Handle<NameDictionary> dict) { |
| 54 DCHECK(dict->NumberOfElements() == 0); | 56 DCHECK(dict->NumberOfElements() == 0); |
| 55 HandleScope scope(isolate); | 57 HandleScope scope(isolate); |
| 56 for (int i = 0; i < kNumFunctions; ++i) { | 58 for (int i = 0; i < kNumFunctions; ++i) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 93 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 92 } | 94 } |
| 93 | 95 |
| 94 | 96 |
| 95 std::ostream& operator<<(std::ostream& os, Runtime::FunctionId id) { | 97 std::ostream& operator<<(std::ostream& os, Runtime::FunctionId id) { |
| 96 return os << Runtime::FunctionForId(id)->name; | 98 return os << Runtime::FunctionForId(id)->name; |
| 97 } | 99 } |
| 98 | 100 |
| 99 } // namespace internal | 101 } // namespace internal |
| 100 } // namespace v8 | 102 } // namespace v8 |
| OLD | NEW |