1 // Copyright 2016 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins.h" 7 #include "src/handles-inl.h" 8 #include "src/isolate.h" 9 #include "src/objects-inl.h" 10 11 namespace v8 { 12 namespace internal { 13 CallFunction(ConvertReceiverMode mode)14Handle<Code> Builtins::CallFunction(ConvertReceiverMode mode) { 15 switch (mode) { 16 case ConvertReceiverMode::kNullOrUndefined: 17 return builtin_handle(kCallFunction_ReceiverIsNullOrUndefined); 18 case ConvertReceiverMode::kNotNullOrUndefined: 19 return builtin_handle(kCallFunction_ReceiverIsNotNullOrUndefined); 20 case ConvertReceiverMode::kAny: 21 return builtin_handle(kCallFunction_ReceiverIsAny); 22 } 23 UNREACHABLE(); 24 } 25 Call(ConvertReceiverMode mode)26Handle<Code> Builtins::Call(ConvertReceiverMode mode) { 27 switch (mode) { 28 case ConvertReceiverMode::kNullOrUndefined: 29 return builtin_handle(kCall_ReceiverIsNullOrUndefined); 30 case ConvertReceiverMode::kNotNullOrUndefined: 31 return builtin_handle(kCall_ReceiverIsNotNullOrUndefined); 32 case ConvertReceiverMode::kAny: 33 return builtin_handle(kCall_ReceiverIsAny); 34 } 35 UNREACHABLE(); 36 } 37 38 } // namespace internal 39 } // namespace v8 40