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 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 5 #ifndef V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 6 #define V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // if the return is not delayed by a finally block). | 386 // if the return is not delayed by a finally block). |
387 void EmitUnwindAndReturn(); | 387 void EmitUnwindAndReturn(); |
388 | 388 |
389 // Platform-specific return sequence | 389 // Platform-specific return sequence |
390 void EmitReturnSequence(); | 390 void EmitReturnSequence(); |
391 void EmitProfilingCounterHandlingForReturnSequence(bool is_tail_call); | 391 void EmitProfilingCounterHandlingForReturnSequence(bool is_tail_call); |
392 | 392 |
393 // Platform-specific code sequences for calls | 393 // Platform-specific code sequences for calls |
394 void EmitCall(Call* expr, ConvertReceiverMode = ConvertReceiverMode::kAny); | 394 void EmitCall(Call* expr, ConvertReceiverMode = ConvertReceiverMode::kAny); |
395 void EmitCallWithLoadIC(Call* expr); | 395 void EmitCallWithLoadIC(Call* expr); |
396 void EmitSuperCallWithLoadIC(Call* expr); | |
397 void EmitKeyedCallWithLoadIC(Call* expr, Expression* key); | 396 void EmitKeyedCallWithLoadIC(Call* expr, Expression* key); |
398 void EmitKeyedSuperCallWithLoadIC(Call* expr); | |
399 | 397 |
400 #define FOR_EACH_FULL_CODE_INTRINSIC(F) \ | 398 #define FOR_EACH_FULL_CODE_INTRINSIC(F) \ |
401 F(IsSmi) \ | 399 F(IsSmi) \ |
402 F(IsArray) \ | 400 F(IsArray) \ |
403 F(IsTypedArray) \ | 401 F(IsTypedArray) \ |
404 F(IsRegExp) \ | 402 F(IsRegExp) \ |
405 F(IsJSProxy) \ | 403 F(IsJSProxy) \ |
406 F(Call) \ | 404 F(Call) \ |
407 F(NewObject) \ | 405 F(NewObject) \ |
408 F(IsJSReceiver) \ | 406 F(IsJSReceiver) \ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); | 443 void EmitNewClosure(Handle<SharedFunctionInfo> info, bool pretenure); |
446 | 444 |
447 // Re-usable portions of CallRuntime | 445 // Re-usable portions of CallRuntime |
448 void EmitLoadJSRuntimeFunction(CallRuntime* expr); | 446 void EmitLoadJSRuntimeFunction(CallRuntime* expr); |
449 void EmitCallJSRuntimeFunction(CallRuntime* expr); | 447 void EmitCallJSRuntimeFunction(CallRuntime* expr); |
450 | 448 |
451 // Load a value from a named property. | 449 // Load a value from a named property. |
452 // The receiver is left on the stack by the IC. | 450 // The receiver is left on the stack by the IC. |
453 void EmitNamedPropertyLoad(Property* expr); | 451 void EmitNamedPropertyLoad(Property* expr); |
454 | 452 |
455 // Load a value from super.named property. | |
456 // Expect receiver ('this' value) and home_object on the stack. | |
457 void EmitNamedSuperPropertyLoad(Property* expr); | |
458 | |
459 // Load a value from super[keyed] property. | |
460 // Expect receiver ('this' value), home_object and key on the stack. | |
461 void EmitKeyedSuperPropertyLoad(Property* expr); | |
462 | |
463 // Load a value from a keyed property. | 453 // Load a value from a keyed property. |
464 // The receiver and the key is left on the stack by the IC. | 454 // The receiver and the key is left on the stack by the IC. |
465 void EmitKeyedPropertyLoad(Property* expr); | 455 void EmitKeyedPropertyLoad(Property* expr); |
466 | 456 |
467 // Pushes the property key as a Name on the stack. | 457 // Pushes the property key as a Name on the stack. |
468 void EmitPropertyKey(LiteralProperty* property, BailoutId bailout_id); | 458 void EmitPropertyKey(LiteralProperty* property, BailoutId bailout_id); |
469 | 459 |
470 // Apply the compound assignment operator. Expects the left operand on top | 460 // Apply the compound assignment operator. Expects the left operand on top |
471 // of the stack and the right one in the accumulator. | 461 // of the stack and the right one in the accumulator. |
472 void EmitBinaryOp(BinaryOperation* expr, Token::Value op); | 462 void EmitBinaryOp(BinaryOperation* expr, Token::Value op); |
(...skipping 17 matching lines...) Expand all Loading... |
490 HoleCheckMode hole_check_mode); | 480 HoleCheckMode hole_check_mode); |
491 | 481 |
492 // Helper functions to EmitVariableAssignment | 482 // Helper functions to EmitVariableAssignment |
493 void EmitStoreToStackLocalOrContextSlot(Variable* var, | 483 void EmitStoreToStackLocalOrContextSlot(Variable* var, |
494 MemOperand location); | 484 MemOperand location); |
495 | 485 |
496 // Complete a named property assignment. The receiver is expected on top | 486 // Complete a named property assignment. The receiver is expected on top |
497 // of the stack and the right-hand-side value in the accumulator. | 487 // of the stack and the right-hand-side value in the accumulator. |
498 void EmitNamedPropertyAssignment(Assignment* expr); | 488 void EmitNamedPropertyAssignment(Assignment* expr); |
499 | 489 |
500 // Complete a super named property assignment. The right-hand-side value | |
501 // is expected in accumulator. | |
502 void EmitNamedSuperPropertyStore(Property* prop); | |
503 | |
504 // Complete a super named property assignment. The right-hand-side value | |
505 // is expected in accumulator. | |
506 void EmitKeyedSuperPropertyStore(Property* prop); | |
507 | |
508 // Complete a keyed property assignment. The receiver and key are | 490 // Complete a keyed property assignment. The receiver and key are |
509 // expected on top of the stack and the right-hand-side value in the | 491 // expected on top of the stack and the right-hand-side value in the |
510 // accumulator. | 492 // accumulator. |
511 void EmitKeyedPropertyAssignment(Assignment* expr); | 493 void EmitKeyedPropertyAssignment(Assignment* expr); |
512 | 494 |
513 static bool NeedsHomeObject(Expression* expr) { | 495 static bool NeedsHomeObject(Expression* expr) { |
514 return FunctionLiteral::NeedsHomeObject(expr); | 496 return FunctionLiteral::NeedsHomeObject(expr); |
515 } | 497 } |
516 | 498 |
517 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. | 499 // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 Address start_; | 894 Address start_; |
913 Address instruction_start_; | 895 Address instruction_start_; |
914 uint32_t length_; | 896 uint32_t length_; |
915 }; | 897 }; |
916 | 898 |
917 | 899 |
918 } // namespace internal | 900 } // namespace internal |
919 } // namespace v8 | 901 } // namespace v8 |
920 | 902 |
921 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ | 903 #endif // V8_FULL_CODEGEN_FULL_CODEGEN_H_ |
OLD | NEW |