| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_FACTORY_H_ | 5 #ifndef V8_FACTORY_H_ |
| 6 #define V8_FACTORY_H_ | 6 #define V8_FACTORY_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 | 10 |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 Handle<Code> CopyCode(Handle<Code> code, Vector<byte> reloc_info); | 530 Handle<Code> CopyCode(Handle<Code> code, Vector<byte> reloc_info); |
| 531 | 531 |
| 532 // Interface for creating error objects. | 532 // Interface for creating error objects. |
| 533 | 533 |
| 534 Handle<Object> NewError(const char* maker, const char* message, | 534 Handle<Object> NewError(const char* maker, const char* message, |
| 535 Handle<JSArray> args); | 535 Handle<JSArray> args); |
| 536 Handle<String> EmergencyNewError(const char* message, Handle<JSArray> args); | 536 Handle<String> EmergencyNewError(const char* message, Handle<JSArray> args); |
| 537 Handle<Object> NewError(const char* maker, const char* message, | 537 Handle<Object> NewError(const char* maker, const char* message, |
| 538 Vector<Handle<Object> > args); | 538 Vector<Handle<Object> > args); |
| 539 Handle<Object> NewError(const char* message, Vector<Handle<Object> > args); | 539 Handle<Object> NewError(const char* message, Vector<Handle<Object> > args); |
| 540 Handle<Object> NewError(const char* maker, | |
| 541 MessageTemplate::Template template_index, | |
| 542 Handle<Object> arg0, Handle<Object> arg1, | |
| 543 Handle<Object> arg2); | |
| 544 | 540 |
| 545 Handle<Object> NewError(Handle<String> message); | 541 Handle<Object> NewError(Handle<String> message); |
| 546 Handle<Object> NewError(const char* constructor, Handle<String> message); | 542 Handle<Object> NewError(const char* constructor, Handle<String> message); |
| 547 | 543 |
| 548 Handle<Object> NewTypeError(const char* message, | 544 Handle<Object> NewTypeError(const char* message, |
| 549 Vector<Handle<Object> > args); | 545 Vector<Handle<Object> > args); |
| 550 Handle<Object> NewTypeError(MessageTemplate::Template template_index, | |
| 551 Handle<Object> arg0 = Handle<Object>(), | |
| 552 Handle<Object> arg1 = Handle<Object>(), | |
| 553 Handle<Object> arg2 = Handle<Object>()); | |
| 554 Handle<Object> NewTypeError(Handle<String> message); | 546 Handle<Object> NewTypeError(Handle<String> message); |
| 555 | 547 |
| 556 Handle<Object> NewRangeError(const char* message, | 548 Handle<Object> NewRangeError(const char* message, |
| 557 Vector<Handle<Object> > args); | 549 Vector<Handle<Object> > args); |
| 558 Handle<Object> NewRangeError(Handle<String> message); | 550 Handle<Object> NewRangeError(Handle<String> message); |
| 559 | 551 |
| 560 Handle<Object> NewInvalidStringLengthError() { | 552 Handle<Object> NewInvalidStringLengthError() { |
| 561 return NewRangeError("invalid_string_length", | 553 return NewRangeError("invalid_string_length", |
| 562 HandleVector<Object>(NULL, 0)); | 554 HandleVector<Object>(NULL, 0)); |
| 563 } | 555 } |
| 564 | 556 |
| 565 Handle<Object> NewSyntaxError(const char* message, Handle<JSArray> args); | 557 Handle<Object> NewSyntaxError(const char* message, Handle<JSArray> args); |
| 566 Handle<Object> NewSyntaxError(Handle<String> message); | 558 Handle<Object> NewSyntaxError(Handle<String> message); |
| 567 | 559 |
| 568 Handle<Object> NewReferenceError(const char* message, | 560 Handle<Object> NewReferenceError(const char* message, |
| 569 Vector<Handle<Object> > args); | 561 Vector<Handle<Object> > args); |
| 570 Handle<Object> NewReferenceError(const char* message, Handle<JSArray> args); | 562 Handle<Object> NewReferenceError(const char* message, Handle<JSArray> args); |
| 571 Handle<Object> NewReferenceError(Handle<String> message); | 563 Handle<Object> NewReferenceError(Handle<String> message); |
| 572 | 564 |
| 573 Handle<Object> NewEvalError(const char* message, | 565 Handle<Object> NewEvalError(const char* message, |
| 574 Vector<Handle<Object> > args); | 566 Vector<Handle<Object> > args); |
| 575 | 567 |
| 568 Handle<Object> NewError(const char* maker, |
| 569 MessageTemplate::Template template_index, |
| 570 Handle<Object> arg0, Handle<Object> arg1, |
| 571 Handle<Object> arg2); |
| 572 |
| 573 Handle<Object> NewError(MessageTemplate::Template template_index, |
| 574 Handle<Object> arg0 = Handle<Object>(), |
| 575 Handle<Object> arg1 = Handle<Object>(), |
| 576 Handle<Object> arg2 = Handle<Object>()); |
| 577 |
| 578 Handle<Object> NewTypeError(MessageTemplate::Template template_index, |
| 579 Handle<Object> arg0 = Handle<Object>(), |
| 580 Handle<Object> arg1 = Handle<Object>(), |
| 581 Handle<Object> arg2 = Handle<Object>()); |
| 582 |
| 583 Handle<Object> NewEvalError(MessageTemplate::Template template_index, |
| 584 Handle<Object> arg0 = Handle<Object>(), |
| 585 Handle<Object> arg1 = Handle<Object>(), |
| 586 Handle<Object> arg2 = Handle<Object>()); |
| 587 |
| 576 Handle<String> NumberToString(Handle<Object> number, | 588 Handle<String> NumberToString(Handle<Object> number, |
| 577 bool check_number_string_cache = true); | 589 bool check_number_string_cache = true); |
| 578 | 590 |
| 579 Handle<String> Uint32ToString(uint32_t value) { | 591 Handle<String> Uint32ToString(uint32_t value) { |
| 580 return NumberToString(NewNumberFromUint(value)); | 592 return NumberToString(NewNumberFromUint(value)); |
| 581 } | 593 } |
| 582 | 594 |
| 583 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); | 595 Handle<JSFunction> InstallMembers(Handle<JSFunction> function); |
| 584 | 596 |
| 585 #define ROOT_ACCESSOR(type, name, camel_name) \ | 597 #define ROOT_ACCESSOR(type, name, camel_name) \ |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 // Reinitialize a JSProxy into an (empty) JS object of respective type and | 740 // Reinitialize a JSProxy into an (empty) JS object of respective type and |
| 729 // size, but keeping the original prototype. The receiver must have at least | 741 // size, but keeping the original prototype. The receiver must have at least |
| 730 // the size of the new object. The object is reinitialized and behaves as an | 742 // the size of the new object. The object is reinitialized and behaves as an |
| 731 // object that has been freshly allocated. | 743 // object that has been freshly allocated. |
| 732 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); | 744 void ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, int size); |
| 733 }; | 745 }; |
| 734 | 746 |
| 735 } } // namespace v8::internal | 747 } } // namespace v8::internal |
| 736 | 748 |
| 737 #endif // V8_FACTORY_H_ | 749 #endif // V8_FACTORY_H_ |
| OLD | NEW |