| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_BUILTINS_H_ | 5 #ifndef V8_BUILTINS_H_ |
| 6 #define V8_BUILTINS_H_ | 6 #define V8_BUILTINS_H_ |
| 7 | 7 |
| 8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 | 10 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 #define BUILTIN_LIST_A(V) \ | 150 #define BUILTIN_LIST_A(V) \ |
| 151 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 151 V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 152 \ | 152 \ |
| 153 V(ConstructedNonConstructable, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 153 V(ConstructedNonConstructable, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 154 \ | 154 \ |
| 155 V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 155 V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
| 156 kNoExtraICState) \ | 156 kNoExtraICState) \ |
| 157 V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 157 V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
| 158 kNoExtraICState) \ | 158 kNoExtraICState) \ |
| 159 V(CallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 159 V(CallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 160 V(TailCallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
| 161 kNoExtraICState) \ |
| 162 V(TailCallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
| 163 kNoExtraICState) \ |
| 164 V(TailCallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 160 V(CallBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 165 V(CallBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 161 V(Call_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 166 V(Call_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 162 V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ | 167 V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
| 163 kNoExtraICState) \ | 168 kNoExtraICState) \ |
| 164 V(Call_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 169 V(Call_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 165 \ | 170 \ |
| 166 V(ConstructFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 171 V(ConstructFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 167 V(ConstructBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 172 V(ConstructBoundFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 168 V(ConstructProxy, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 173 V(ConstructProxy, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| 169 V(Construct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ | 174 V(Construct, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) | 337 BUILTIN_LIST_C(DECLARE_BUILTIN_ACCESSOR_C) |
| 333 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) | 338 BUILTIN_LIST_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 334 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) | 339 BUILTIN_LIST_H(DECLARE_BUILTIN_ACCESSOR_H) |
| 335 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) | 340 BUILTIN_LIST_DEBUG_A(DECLARE_BUILTIN_ACCESSOR_A) |
| 336 #undef DECLARE_BUILTIN_ACCESSOR_C | 341 #undef DECLARE_BUILTIN_ACCESSOR_C |
| 337 #undef DECLARE_BUILTIN_ACCESSOR_A | 342 #undef DECLARE_BUILTIN_ACCESSOR_A |
| 338 | 343 |
| 339 // Convenience wrappers. | 344 // Convenience wrappers. |
| 340 Handle<Code> CallFunction(ConvertReceiverMode = ConvertReceiverMode::kAny); | 345 Handle<Code> CallFunction(ConvertReceiverMode = ConvertReceiverMode::kAny); |
| 341 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny); | 346 Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny); |
| 347 Handle<Code> TailCallFunction( |
| 348 ConvertReceiverMode = ConvertReceiverMode::kAny); |
| 349 Handle<Code> TailCall(ConvertReceiverMode = ConvertReceiverMode::kAny); |
| 342 | 350 |
| 343 Code* builtin(Name name) { | 351 Code* builtin(Name name) { |
| 344 // Code::cast cannot be used here since we access builtins | 352 // Code::cast cannot be used here since we access builtins |
| 345 // during the marking phase of mark sweep. See IC::Clear. | 353 // during the marking phase of mark sweep. See IC::Clear. |
| 346 return reinterpret_cast<Code*>(builtins_[name]); | 354 return reinterpret_cast<Code*>(builtins_[name]); |
| 347 } | 355 } |
| 348 | 356 |
| 349 Address builtin_address(Name name) { | 357 Address builtin_address(Name name) { |
| 350 return reinterpret_cast<Address>(&builtins_[name]); | 358 return reinterpret_cast<Address>(&builtins_[name]); |
| 351 } | 359 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 static void Generate_NotifySoftDeoptimized(MacroAssembler* masm); | 404 static void Generate_NotifySoftDeoptimized(MacroAssembler* masm); |
| 397 static void Generate_NotifyLazyDeoptimized(MacroAssembler* masm); | 405 static void Generate_NotifyLazyDeoptimized(MacroAssembler* masm); |
| 398 static void Generate_NotifyStubFailure(MacroAssembler* masm); | 406 static void Generate_NotifyStubFailure(MacroAssembler* masm); |
| 399 static void Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm); | 407 static void Generate_NotifyStubFailureSaveDoubles(MacroAssembler* masm); |
| 400 static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm); | 408 static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm); |
| 401 | 409 |
| 402 static void Generate_Apply(MacroAssembler* masm); | 410 static void Generate_Apply(MacroAssembler* masm); |
| 403 | 411 |
| 404 // ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) | 412 // ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) |
| 405 static void Generate_CallFunction(MacroAssembler* masm, | 413 static void Generate_CallFunction(MacroAssembler* masm, |
| 406 ConvertReceiverMode mode); | 414 ConvertReceiverMode mode, |
| 415 TailCallMode tail_call_mode); |
| 407 static void Generate_CallFunction_ReceiverIsNullOrUndefined( | 416 static void Generate_CallFunction_ReceiverIsNullOrUndefined( |
| 408 MacroAssembler* masm) { | 417 MacroAssembler* masm) { |
| 409 Generate_CallFunction(masm, ConvertReceiverMode::kNullOrUndefined); | 418 Generate_CallFunction(masm, ConvertReceiverMode::kNullOrUndefined, |
| 419 TailCallMode::kDisallow); |
| 410 } | 420 } |
| 411 static void Generate_CallFunction_ReceiverIsNotNullOrUndefined( | 421 static void Generate_CallFunction_ReceiverIsNotNullOrUndefined( |
| 412 MacroAssembler* masm) { | 422 MacroAssembler* masm) { |
| 413 Generate_CallFunction(masm, ConvertReceiverMode::kNotNullOrUndefined); | 423 Generate_CallFunction(masm, ConvertReceiverMode::kNotNullOrUndefined, |
| 424 TailCallMode::kDisallow); |
| 414 } | 425 } |
| 415 static void Generate_CallFunction_ReceiverIsAny(MacroAssembler* masm) { | 426 static void Generate_CallFunction_ReceiverIsAny(MacroAssembler* masm) { |
| 416 Generate_CallFunction(masm, ConvertReceiverMode::kAny); | 427 Generate_CallFunction(masm, ConvertReceiverMode::kAny, |
| 428 TailCallMode::kDisallow); |
| 429 } |
| 430 static void Generate_TailCallFunction_ReceiverIsNullOrUndefined( |
| 431 MacroAssembler* masm) { |
| 432 Generate_CallFunction(masm, ConvertReceiverMode::kNullOrUndefined, |
| 433 TailCallMode::kAllow); |
| 434 } |
| 435 static void Generate_TailCallFunction_ReceiverIsNotNullOrUndefined( |
| 436 MacroAssembler* masm) { |
| 437 Generate_CallFunction(masm, ConvertReceiverMode::kNotNullOrUndefined, |
| 438 TailCallMode::kAllow); |
| 439 } |
| 440 static void Generate_TailCallFunction_ReceiverIsAny(MacroAssembler* masm) { |
| 441 Generate_CallFunction(masm, ConvertReceiverMode::kAny, |
| 442 TailCallMode::kAllow); |
| 417 } | 443 } |
| 418 // ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) | 444 // ES6 section 9.4.1.1 [[Call]] ( thisArgument, argumentsList) |
| 419 static void Generate_CallBoundFunction(MacroAssembler* masm); | 445 static void Generate_CallBoundFunction(MacroAssembler* masm); |
| 420 // ES6 section 7.3.12 Call(F, V, [argumentsList]) | 446 // ES6 section 7.3.12 Call(F, V, [argumentsList]) |
| 421 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode); | 447 static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode); |
| 422 static void Generate_Call_ReceiverIsNullOrUndefined(MacroAssembler* masm) { | 448 static void Generate_Call_ReceiverIsNullOrUndefined(MacroAssembler* masm) { |
| 423 Generate_Call(masm, ConvertReceiverMode::kNullOrUndefined); | 449 Generate_Call(masm, ConvertReceiverMode::kNullOrUndefined); |
| 424 } | 450 } |
| 425 static void Generate_Call_ReceiverIsNotNullOrUndefined(MacroAssembler* masm) { | 451 static void Generate_Call_ReceiverIsNotNullOrUndefined(MacroAssembler* masm) { |
| 426 Generate_Call(masm, ConvertReceiverMode::kNotNullOrUndefined); | 452 Generate_Call(masm, ConvertReceiverMode::kNotNullOrUndefined); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 friend class BuiltinFunctionTable; | 554 friend class BuiltinFunctionTable; |
| 529 friend class Isolate; | 555 friend class Isolate; |
| 530 | 556 |
| 531 DISALLOW_COPY_AND_ASSIGN(Builtins); | 557 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 532 }; | 558 }; |
| 533 | 559 |
| 534 } // namespace internal | 560 } // namespace internal |
| 535 } // namespace v8 | 561 } // namespace v8 |
| 536 | 562 |
| 537 #endif // V8_BUILTINS_H_ | 563 #endif // V8_BUILTINS_H_ |
| OLD | NEW |