Changeset 10634 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Sep 27, 2005, 3:37:33 PM (20 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 3 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/collector.cpp
r10457 r10634 22 22 #include "collector.h" 23 23 24 #include "fast_malloc.h"24 #include <kxmlcore/FastMalloc.h> 25 25 #include "internal.h" 26 26 #include "list.h" … … 119 119 numOversizeCells = max(MIN_ARRAY_SIZE, numOversizeCells * GROWTH_FACTOR); 120 120 heap.numOversizeCells = numOversizeCells; 121 heap.oversizeCells = static_cast<CollectorCell **>( kjs_fast_realloc(heap.oversizeCells, numOversizeCells * sizeof(CollectorCell *)));121 heap.oversizeCells = static_cast<CollectorCell **>(fastRealloc(heap.oversizeCells, numOversizeCells * sizeof(CollectorCell *))); 122 122 } 123 123 124 void *newCell = kjs_fast_malloc(s);124 void *newCell = fastMalloc(s); 125 125 heap.oversizeCells[usedOversizeCells] = static_cast<CollectorCell *>(newCell); 126 126 heap.usedOversizeCells = usedOversizeCells + 1; … … 157 157 numBlocks = max(MIN_ARRAY_SIZE, numBlocks * GROWTH_FACTOR); 158 158 heap.numBlocks = numBlocks; 159 heap.blocks = static_cast<CollectorBlock **>( kjs_fast_realloc(heap.blocks, numBlocks * sizeof(CollectorBlock *)));160 } 161 162 targetBlock = static_cast<CollectorBlock *>( kjs_fast_calloc(1, sizeof(CollectorBlock)));159 heap.blocks = static_cast<CollectorBlock **>(fastRealloc(heap.blocks, numBlocks * sizeof(CollectorBlock *))); 160 } 161 162 targetBlock = static_cast<CollectorBlock *>(fastCalloc(1, sizeof(CollectorBlock))); 163 163 targetBlock->freeList = targetBlock->cells; 164 164 targetBlockUsedCells = 0; … … 455 455 if (emptyBlocks > SPARE_EMPTY_BLOCKS) { 456 456 #if !DEBUG_COLLECTOR 457 kjs_fast_free(curBlock);457 fastFree(curBlock); 458 458 #endif 459 459 // swap with the last block so we compact as we go … … 464 464 if (heap.numBlocks > MIN_ARRAY_SIZE && heap.usedBlocks < heap.numBlocks / LOW_WATER_FACTOR) { 465 465 heap.numBlocks = heap.numBlocks / GROWTH_FACTOR; 466 heap.blocks = (CollectorBlock **) kjs_fast_realloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *));466 heap.blocks = (CollectorBlock **)fastRealloc(heap.blocks, heap.numBlocks * sizeof(CollectorBlock *)); 467 467 } 468 468 } … … 482 482 heap.oversizeCells[cell]->u.freeCell.zeroIfFree = 0; 483 483 #else 484 kjs_fast_free(imp);484 fastFree(imp); 485 485 #endif 486 486 … … 493 493 if (heap.numOversizeCells > MIN_ARRAY_SIZE && heap.usedOversizeCells < heap.numOversizeCells / LOW_WATER_FACTOR) { 494 494 heap.numOversizeCells = heap.numOversizeCells / GROWTH_FACTOR; 495 heap.oversizeCells = (CollectorCell **) kjs_fast_realloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *));495 heap.oversizeCells = (CollectorCell **)fastRealloc(heap.oversizeCells, heap.numOversizeCells * sizeof(CollectorCell *)); 496 496 } 497 497 } else { -
trunk/JavaScriptCore/kjs/config.h
r10456 r10634 20 20 #define HAVE_PCREPOSIX 1 21 21 #define HAVE_STRING_H 1 22 #define HAVE_STDINT_H 1 23 24 #define HAVE_MMAP 1 25 #define HAVE_SBRK 1 22 26 23 27 #ifdef __ppc__ … … 27 31 /* define to debug garbage collection */ 28 32 #undef DEBUG_COLLECTOR 33 34 #define KXC_CHANGES 1 -
trunk/JavaScriptCore/kjs/function.cpp
r10457 r10634 32 32 #include "debugger.h" 33 33 #include "context.h" 34 #include "shared_ptr.h"35 34 36 35 #include <stdio.h> … … 42 41 43 42 #include <unicode/uchar.h> 44 45 using namespace KXMLCore;46 43 47 44 namespace KJS { -
trunk/JavaScriptCore/kjs/function.h
r10456 r10634 82 82 virtual Completion execute(ExecState *exec); 83 83 CodeType codeType() const { return FunctionCode; } 84 KXMLCore::SharedPtr<FunctionBodyNode> body;84 SharedPtr<FunctionBodyNode> body; 85 85 86 86 virtual const ClassInfo *classInfo() const { return &info; } -
trunk/JavaScriptCore/kjs/function_object.cpp
r10399 r10634 35 35 36 36 using namespace KJS; 37 using namespace KXMLCore;38 37 39 38 // ------------------------------ FunctionPrototypeImp ------------------------- -
trunk/JavaScriptCore/kjs/identifier.cpp
r10465 r10634 36 36 #include "identifier.h" 37 37 38 #include "fast_malloc.h"38 #include <kxmlcore/FastMalloc.h> 39 39 #include <string.h> // for strlen 40 40 #include <new> // for placement new … … 127 127 } 128 128 129 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * length));129 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length)); 130 130 for (int j = 0; j != length; j++) 131 131 d[j] = c[j]; … … 166 166 } 167 167 168 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * length));168 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length)); 169 169 for (int j = 0; j != length; j++) 170 170 d[j] = s[j]; -
trunk/JavaScriptCore/kjs/internal.cpp
r10586 r10634 52 52 53 53 extern int kjsyyparse(); 54 55 using namespace KXMLCore;56 54 57 55 namespace KJS { -
trunk/JavaScriptCore/kjs/internal.h
r10563 r10634 33 33 #include "interpreter.h" 34 34 #include "scope_chain.h" 35 #include "shared_ptr.h"35 #include <kxmlcore/SharedPtr.h> 36 36 37 37 #if !WIN32 … … 203 203 class Parser { 204 204 public: 205 static KXMLCore::SharedPtr<ProgramNode> parse(const UString &sourceURL, int startingLineNumber,206 207 205 static SharedPtr<ProgramNode> parse(const UString &sourceURL, int startingLineNumber, 206 const UChar *code, unsigned int length, int *sourceId = 0, 207 int *errLine = 0, UString *errMsg = 0); 208 208 static void accept(ProgramNode *prog); 209 209 -
trunk/JavaScriptCore/kjs/nodes.h
r10621 r10634 26 26 #define _NODES_H_ 27 27 28 #include "fast_malloc.h"29 #include "shared_ptr.h"28 #include <kxmlcore/FastMalloc.h> 29 #include <kxmlcore/SharedPtr.h> 30 30 31 31 #include "internal.h" … … 78 78 }; 79 79 80 class Node {80 class Node : public FastAllocated { 81 81 public: 82 82 Node(); 83 83 virtual ~Node(); 84 85 KJS_FAST_ALLOCATED;86 84 87 85 virtual ValueImp *evaluate(ExecState *exec) = 0; … … 226 224 227 225 private: 228 KXMLCore::SharedPtr<Node> group;226 SharedPtr<Node> group; 229 227 }; 230 228 … … 239 237 private: 240 238 friend class ArrayNode; 241 KXMLCore::SharedPtr<ElementNode> list;239 SharedPtr<ElementNode> list; 242 240 int elision; 243 KXMLCore::SharedPtr<Node> node;241 SharedPtr<Node> node; 244 242 }; 245 243 … … 254 252 virtual void streamTo(SourceStream &s) const; 255 253 private: 256 KXMLCore::SharedPtr<ElementNode> element;254 SharedPtr<ElementNode> element; 257 255 int elision; 258 256 bool opt; … … 270 268 private: 271 269 friend class ObjectLiteralNode; 272 KXMLCore::SharedPtr<PropertyNode> name;273 KXMLCore::SharedPtr<Node> assign;274 KXMLCore::SharedPtr<PropertyValueNode> list;270 SharedPtr<PropertyNode> name; 271 SharedPtr<Node> assign; 272 SharedPtr<PropertyValueNode> list; 275 273 }; 276 274 … … 282 280 virtual void streamTo(SourceStream &s) const; 283 281 private: 284 KXMLCore::SharedPtr<PropertyValueNode> list;282 SharedPtr<PropertyValueNode> list; 285 283 }; 286 284 … … 308 306 309 307 private: 310 KXMLCore::SharedPtr<Node> expr1;311 KXMLCore::SharedPtr<Node> expr2;308 SharedPtr<Node> expr1; 309 SharedPtr<Node> expr2; 312 310 }; 313 311 … … 324 322 325 323 private: 326 KXMLCore::SharedPtr<Node> expr;324 SharedPtr<Node> expr; 327 325 Identifier ident; 328 326 }; … … 339 337 private: 340 338 friend class ArgumentsNode; 341 KXMLCore::SharedPtr<ArgumentListNode> list;342 KXMLCore::SharedPtr<Node> expr;339 SharedPtr<ArgumentListNode> list; 340 SharedPtr<Node> expr; 343 341 }; 344 342 … … 352 350 virtual void streamTo(SourceStream &s) const; 353 351 private: 354 KXMLCore::SharedPtr<ArgumentListNode> list;352 SharedPtr<ArgumentListNode> list; 355 353 }; 356 354 … … 362 360 virtual void streamTo(SourceStream &s) const; 363 361 private: 364 KXMLCore::SharedPtr<Node> expr;365 KXMLCore::SharedPtr<ArgumentsNode> args;362 SharedPtr<Node> expr; 363 SharedPtr<ArgumentsNode> args; 366 364 }; 367 365 … … 372 370 virtual void streamTo(SourceStream &s) const; 373 371 private: 374 KXMLCore::SharedPtr<Node> expr;375 KXMLCore::SharedPtr<ArgumentsNode> args;372 SharedPtr<Node> expr; 373 SharedPtr<ArgumentsNode> args; 376 374 }; 377 375 … … 383 381 private: 384 382 Identifier ident; 385 KXMLCore::SharedPtr<ArgumentsNode> args;383 SharedPtr<ArgumentsNode> args; 386 384 }; 387 385 … … 392 390 virtual void streamTo(SourceStream &s) const; 393 391 protected: 394 KXMLCore::SharedPtr<Node> base;395 KXMLCore::SharedPtr<Node> subscript;396 KXMLCore::SharedPtr<ArgumentsNode> args;392 SharedPtr<Node> base; 393 SharedPtr<Node> subscript; 394 SharedPtr<ArgumentsNode> args; 397 395 }; 398 396 … … 409 407 virtual void streamTo(SourceStream &s) const; 410 408 protected: 411 KXMLCore::SharedPtr<Node> base;409 SharedPtr<Node> base; 412 410 Identifier ident; 413 KXMLCore::SharedPtr<ArgumentsNode> args;411 SharedPtr<ArgumentsNode> args; 414 412 }; 415 413 … … 436 434 virtual void streamTo(SourceStream &s) const; 437 435 private: 438 KXMLCore::SharedPtr<Node> m_base;439 KXMLCore::SharedPtr<Node> m_subscript;436 SharedPtr<Node> m_base; 437 SharedPtr<Node> m_subscript; 440 438 Operator m_oper; 441 439 }; … … 447 445 virtual void streamTo(SourceStream &s) const; 448 446 private: 449 KXMLCore::SharedPtr<Node> m_base;447 SharedPtr<Node> m_base; 450 448 Identifier m_ident; 451 449 Operator m_oper; … … 467 465 virtual void streamTo(SourceStream &s) const; 468 466 private: 469 KXMLCore::SharedPtr<Node> m_base;470 KXMLCore::SharedPtr<Node> m_subscript;467 SharedPtr<Node> m_base; 468 SharedPtr<Node> m_subscript; 471 469 }; 472 470 … … 477 475 virtual void streamTo(SourceStream &s) const; 478 476 private: 479 KXMLCore::SharedPtr<Node> m_base;477 SharedPtr<Node> m_base; 480 478 Identifier m_ident; 481 479 }; … … 487 485 virtual void streamTo(SourceStream &s) const; 488 486 private: 489 KXMLCore::SharedPtr<Node> m_expr;487 SharedPtr<Node> m_expr; 490 488 }; 491 489 … … 496 494 virtual void streamTo(SourceStream &s) const; 497 495 private: 498 KXMLCore::SharedPtr<Node> expr;496 SharedPtr<Node> expr; 499 497 }; 500 498 … … 514 512 virtual void streamTo(SourceStream &s) const; 515 513 private: 516 KXMLCore::SharedPtr<Node> m_expr;514 SharedPtr<Node> m_expr; 517 515 }; 518 516 … … 533 531 virtual void streamTo(SourceStream &s) const; 534 532 private: 535 KXMLCore::SharedPtr<Node> m_base;536 KXMLCore::SharedPtr<Node> m_subscript;533 SharedPtr<Node> m_base; 534 SharedPtr<Node> m_subscript; 537 535 Operator m_oper; 538 536 }; … … 544 542 virtual void streamTo(SourceStream &s) const; 545 543 private: 546 KXMLCore::SharedPtr<Node> m_base;544 SharedPtr<Node> m_base; 547 545 Identifier m_ident; 548 546 Operator m_oper; … … 555 553 virtual void streamTo(SourceStream &s) const; 556 554 private: 557 KXMLCore::SharedPtr<Node> expr;555 SharedPtr<Node> expr; 558 556 }; 559 557 … … 564 562 virtual void streamTo(SourceStream &s) const; 565 563 private: 566 KXMLCore::SharedPtr<Node> expr;564 SharedPtr<Node> expr; 567 565 }; 568 566 … … 573 571 virtual void streamTo(SourceStream &s) const; 574 572 private: 575 KXMLCore::SharedPtr<Node> expr;573 SharedPtr<Node> expr; 576 574 }; 577 575 … … 582 580 virtual void streamTo(SourceStream &s) const; 583 581 private: 584 KXMLCore::SharedPtr<Node> expr;582 SharedPtr<Node> expr; 585 583 }; 586 584 … … 591 589 virtual void streamTo(SourceStream &s) const; 592 590 private: 593 KXMLCore::SharedPtr<Node> term1;594 KXMLCore::SharedPtr<Node> term2;591 SharedPtr<Node> term1; 592 SharedPtr<Node> term2; 595 593 char oper; 596 594 }; … … 602 600 virtual void streamTo(SourceStream &s) const; 603 601 private: 604 KXMLCore::SharedPtr<Node> term1;605 KXMLCore::SharedPtr<Node> term2;602 SharedPtr<Node> term1; 603 SharedPtr<Node> term2; 606 604 char oper; 607 605 }; … … 614 612 virtual void streamTo(SourceStream &s) const; 615 613 private: 616 KXMLCore::SharedPtr<Node> term1;617 KXMLCore::SharedPtr<Node> term2;614 SharedPtr<Node> term1; 615 SharedPtr<Node> term2; 618 616 Operator oper; 619 617 }; … … 626 624 virtual void streamTo(SourceStream &s) const; 627 625 private: 628 KXMLCore::SharedPtr<Node> expr1;629 KXMLCore::SharedPtr<Node> expr2;626 SharedPtr<Node> expr1; 627 SharedPtr<Node> expr2; 630 628 Operator oper; 631 629 }; … … 638 636 virtual void streamTo(SourceStream &s) const; 639 637 private: 640 KXMLCore::SharedPtr<Node> expr1;641 KXMLCore::SharedPtr<Node> expr2;638 SharedPtr<Node> expr1; 639 SharedPtr<Node> expr2; 642 640 Operator oper; 643 641 }; … … 650 648 virtual void streamTo(SourceStream &s) const; 651 649 private: 652 KXMLCore::SharedPtr<Node> expr1;653 KXMLCore::SharedPtr<Node> expr2;650 SharedPtr<Node> expr1; 651 SharedPtr<Node> expr2; 654 652 Operator oper; 655 653 }; … … 665 663 virtual void streamTo(SourceStream &s) const; 666 664 private: 667 KXMLCore::SharedPtr<Node> expr1;668 KXMLCore::SharedPtr<Node> expr2;665 SharedPtr<Node> expr1; 666 SharedPtr<Node> expr2; 669 667 Operator oper; 670 668 }; … … 680 678 virtual void streamTo(SourceStream &s) const; 681 679 private: 682 KXMLCore::SharedPtr<Node> logical;683 KXMLCore::SharedPtr<Node> expr1;684 KXMLCore::SharedPtr<Node> expr2;680 SharedPtr<Node> logical; 681 SharedPtr<Node> expr1; 682 SharedPtr<Node> expr2; 685 683 }; 686 684 … … 694 692 Identifier m_ident; 695 693 Operator m_oper; 696 KXMLCore::SharedPtr<Node> m_right;694 SharedPtr<Node> m_right; 697 695 }; 698 696 … … 704 702 virtual void streamTo(SourceStream &s) const; 705 703 protected: 706 KXMLCore::SharedPtr<Node> m_base;707 KXMLCore::SharedPtr<Node> m_subscript;704 SharedPtr<Node> m_base; 705 SharedPtr<Node> m_subscript; 708 706 Operator m_oper; 709 KXMLCore::SharedPtr<Node> m_right;707 SharedPtr<Node> m_right; 710 708 }; 711 709 … … 717 715 virtual void streamTo(SourceStream &s) const; 718 716 protected: 719 KXMLCore::SharedPtr<Node> m_base;717 SharedPtr<Node> m_base; 720 718 Identifier m_ident; 721 719 Operator m_oper; 722 KXMLCore::SharedPtr<Node> m_right;720 SharedPtr<Node> m_right; 723 721 }; 724 722 … … 729 727 virtual void streamTo(SourceStream &s) const; 730 728 private: 731 KXMLCore::SharedPtr<Node> expr1;732 KXMLCore::SharedPtr<Node> expr2;729 SharedPtr<Node> expr1; 730 SharedPtr<Node> expr2; 733 731 }; 734 732 … … 743 741 private: 744 742 friend class CaseClauseNode; 745 KXMLCore::SharedPtr<StatementNode> statement;746 KXMLCore::SharedPtr<StatListNode> list;743 SharedPtr<StatementNode> statement; 744 SharedPtr<StatListNode> list; 747 745 }; 748 746 … … 753 751 virtual void streamTo(SourceStream &s) const; 754 752 private: 755 KXMLCore::SharedPtr<Node> expr;753 SharedPtr<Node> expr; 756 754 }; 757 755 … … 766 764 Type varType; 767 765 Identifier ident; 768 KXMLCore::SharedPtr<AssignExprNode> init;766 SharedPtr<AssignExprNode> init; 769 767 }; 770 768 … … 781 779 friend class ForNode; 782 780 friend class VarStatementNode; 783 KXMLCore::SharedPtr<VarDeclListNode> list;784 KXMLCore::SharedPtr<VarDeclNode> var;781 SharedPtr<VarDeclListNode> list; 782 SharedPtr<VarDeclNode> var; 785 783 }; 786 784 … … 792 790 virtual void streamTo(SourceStream &s) const; 793 791 private: 794 KXMLCore::SharedPtr<VarDeclListNode> list;792 SharedPtr<VarDeclListNode> list; 795 793 }; 796 794 … … 802 800 virtual void streamTo(SourceStream &s) const; 803 801 protected: 804 KXMLCore::SharedPtr<SourceElementsNode> source;802 SharedPtr<SourceElementsNode> source; 805 803 }; 806 804 … … 818 816 virtual void streamTo(SourceStream &s) const; 819 817 private: 820 KXMLCore::SharedPtr<Node> expr;818 SharedPtr<Node> expr; 821 819 }; 822 820 … … 829 827 virtual void streamTo(SourceStream &s) const; 830 828 private: 831 KXMLCore::SharedPtr<Node> expr;832 KXMLCore::SharedPtr<StatementNode> statement1;833 KXMLCore::SharedPtr<StatementNode> statement2;829 SharedPtr<Node> expr; 830 SharedPtr<StatementNode> statement1; 831 SharedPtr<StatementNode> statement2; 834 832 }; 835 833 … … 841 839 virtual void streamTo(SourceStream &s) const; 842 840 private: 843 KXMLCore::SharedPtr<StatementNode> statement;844 KXMLCore::SharedPtr<Node> expr;841 SharedPtr<StatementNode> statement; 842 SharedPtr<Node> expr; 845 843 }; 846 844 … … 852 850 virtual void streamTo(SourceStream &s) const; 853 851 private: 854 KXMLCore::SharedPtr<Node> expr;855 KXMLCore::SharedPtr<StatementNode> statement;852 SharedPtr<Node> expr; 853 SharedPtr<StatementNode> statement; 856 854 }; 857 855 … … 866 864 virtual void streamTo(SourceStream &s) const; 867 865 private: 868 KXMLCore::SharedPtr<Node> expr1;869 KXMLCore::SharedPtr<Node> expr2;870 KXMLCore::SharedPtr<Node> expr3;871 KXMLCore::SharedPtr<StatementNode> statement;866 SharedPtr<Node> expr1; 867 SharedPtr<Node> expr2; 868 SharedPtr<Node> expr3; 869 SharedPtr<StatementNode> statement; 872 870 }; 873 871 … … 881 879 private: 882 880 Identifier ident; 883 KXMLCore::SharedPtr<AssignExprNode> init;884 KXMLCore::SharedPtr<Node> lexpr;885 KXMLCore::SharedPtr<Node> expr;886 KXMLCore::SharedPtr<VarDeclNode> varDecl;887 KXMLCore::SharedPtr<StatementNode> statement;881 SharedPtr<AssignExprNode> init; 882 SharedPtr<Node> lexpr; 883 SharedPtr<Node> expr; 884 SharedPtr<VarDeclNode> varDecl; 885 SharedPtr<StatementNode> statement; 888 886 }; 889 887 … … 914 912 virtual void streamTo(SourceStream &s) const; 915 913 private: 916 KXMLCore::SharedPtr<Node> value;914 SharedPtr<Node> value; 917 915 }; 918 916 … … 924 922 virtual void streamTo(SourceStream &s) const; 925 923 private: 926 KXMLCore::SharedPtr<Node> expr;927 KXMLCore::SharedPtr<StatementNode> statement;924 SharedPtr<Node> expr; 925 SharedPtr<StatementNode> statement; 928 926 }; 929 927 … … 938 936 virtual void streamTo(SourceStream &s) const; 939 937 private: 940 KXMLCore::SharedPtr<Node> expr;941 KXMLCore::SharedPtr<StatListNode> list;938 SharedPtr<Node> expr; 939 SharedPtr<StatListNode> list; 942 940 }; 943 941 … … 955 953 private: 956 954 friend class CaseBlockNode; 957 KXMLCore::SharedPtr<CaseClauseNode> cl;958 KXMLCore::SharedPtr<ClauseListNode> nx;955 SharedPtr<CaseClauseNode> cl; 956 SharedPtr<ClauseListNode> nx; 959 957 }; 960 958 … … 967 965 virtual void streamTo(SourceStream &s) const; 968 966 private: 969 KXMLCore::SharedPtr<ClauseListNode> list1;970 KXMLCore::SharedPtr<CaseClauseNode> def;971 KXMLCore::SharedPtr<ClauseListNode> list2;967 SharedPtr<ClauseListNode> list1; 968 SharedPtr<CaseClauseNode> def; 969 SharedPtr<ClauseListNode> list2; 972 970 }; 973 971 … … 979 977 virtual void streamTo(SourceStream &s) const; 980 978 private: 981 KXMLCore::SharedPtr<Node> expr;982 KXMLCore::SharedPtr<CaseBlockNode> block;979 SharedPtr<Node> expr; 980 SharedPtr<CaseBlockNode> block; 983 981 }; 984 982 … … 991 989 private: 992 990 Identifier label; 993 KXMLCore::SharedPtr<StatementNode> statement;991 SharedPtr<StatementNode> statement; 994 992 }; 995 993 … … 1000 998 virtual void streamTo(SourceStream &s) const; 1001 999 private: 1002 KXMLCore::SharedPtr<Node> expr;1000 SharedPtr<Node> expr; 1003 1001 }; 1004 1002 … … 1012 1010 private: 1013 1011 Identifier ident; 1014 KXMLCore::SharedPtr<StatementNode> block;1012 SharedPtr<StatementNode> block; 1015 1013 }; 1016 1014 … … 1022 1020 virtual void streamTo(SourceStream &s) const; 1023 1021 private: 1024 KXMLCore::SharedPtr<StatementNode> block;1022 SharedPtr<StatementNode> block; 1025 1023 }; 1026 1024 … … 1037 1035 virtual void streamTo(SourceStream &s) const; 1038 1036 private: 1039 KXMLCore::SharedPtr<StatementNode> block;1040 KXMLCore::SharedPtr<CatchNode> _catch;1041 KXMLCore::SharedPtr<FinallyNode> _final;1037 SharedPtr<StatementNode> block; 1038 SharedPtr<CatchNode> _catch; 1039 SharedPtr<FinallyNode> _final; 1042 1040 }; 1043 1041 … … 1056 1054 friend class FuncExprNode; 1057 1055 Identifier id; 1058 KXMLCore::SharedPtr<ParameterNode> next;1056 SharedPtr<ParameterNode> next; 1059 1057 }; 1060 1058 … … 1079 1077 1080 1078 Identifier ident; 1081 KXMLCore::SharedPtr<ParameterNode> param;1082 KXMLCore::SharedPtr<FunctionBodyNode> body;1079 SharedPtr<ParameterNode> param; 1080 SharedPtr<FunctionBodyNode> body; 1083 1081 }; 1084 1082 … … 1095 1093 private: 1096 1094 Identifier ident; 1097 KXMLCore::SharedPtr<ParameterNode> param;1098 KXMLCore::SharedPtr<FunctionBodyNode> body;1095 SharedPtr<ParameterNode> param; 1096 SharedPtr<FunctionBodyNode> body; 1099 1097 }; 1100 1098 … … 1112 1110 private: 1113 1111 friend class BlockNode; 1114 KXMLCore::SharedPtr<StatementNode> element; // 'this' element1115 KXMLCore::SharedPtr<SourceElementsNode> elements; // pointer to next1112 SharedPtr<StatementNode> element; // 'this' element 1113 SharedPtr<SourceElementsNode> elements; // pointer to next 1116 1114 }; 1117 1115 -
trunk/JavaScriptCore/kjs/nodes2string.cpp
r10621 r10634 24 24 #include "nodes.h" 25 25 26 using KXMLCore::SharedPtr;27 28 26 namespace KJS { 29 27 /** -
trunk/JavaScriptCore/kjs/property_map.cpp
r10563 r10634 22 22 #include "property_map.h" 23 23 24 #include "fast_malloc.h"24 #include <kxmlcore/FastMalloc.h> 25 25 #include "object.h" 26 26 #include "protect.h" … … 123 123 ++minimumKeysToProcess; 124 124 } 125 kjs_fast_free(_table);125 fastFree(_table); 126 126 } 127 127 … … 425 425 int oldTableKeyCount = oldTable ? oldTable->keyCount : 0; 426 426 427 _table = (Table *) kjs_fast_calloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) );427 _table = (Table *)fastCalloc(1, sizeof(Table) + (newTableSize - 1) * sizeof(Entry) ); 428 428 _table->size = newTableSize; 429 429 _table->sizeMask = newTableSize - 1; … … 459 459 _table->lastIndexUsed = lastIndexUsed; 460 460 461 kjs_fast_free(oldTable);461 fastFree(oldTable); 462 462 463 463 checkConsistency(); -
trunk/JavaScriptCore/kjs/scope_chain.h
r10168 r10634 23 23 #define KJS_SCOPE_CHAIN_H 24 24 25 #include "fast_malloc.h"25 #include <kxmlcore/FastMalloc.h> 26 26 27 27 namespace KJS { … … 29 29 class ObjectImp; 30 30 31 class ScopeChainNode {31 class ScopeChainNode : public FastAllocated { 32 32 public: 33 33 ScopeChainNode(ScopeChainNode *n, ObjectImp *o) 34 34 : next(n), object(o), refCount(1) { } 35 36 KJS_FAST_ALLOCATED;37 35 38 36 ScopeChainNode *next; -
trunk/JavaScriptCore/kjs/string_object.cpp
r10563 r10634 766 766 UString s; 767 767 if (args.size()) { 768 UChar *buf = static_cast<UChar *>( kjs_fast_malloc(args.size() * sizeof(UChar)));768 UChar *buf = static_cast<UChar *>(fastMalloc(args.size() * sizeof(UChar))); 769 769 UChar *p = buf; 770 770 ListIterator it = args.begin(); -
trunk/JavaScriptCore/kjs/ustring.cpp
r10556 r10634 36 36 #endif 37 37 38 #include "fast_malloc.h"39 38 #include "ustring.h" 40 39 #include "operations.h" … … 180 179 { 181 180 int sizeInBytes = l * sizeof(UChar); 182 UChar *copyD = static_cast<UChar *>( kjs_fast_malloc(sizeInBytes));181 UChar *copyD = static_cast<UChar *>(fastMalloc(sizeInBytes)); 183 182 memcpy(copyD, d, sizeInBytes); 184 183 … … 239 238 baseString->deref(); 240 239 } else { 241 kjs_fast_free(buf);240 fastFree(buf); 242 241 } 243 242 delete this; … … 361 360 if (requiredLength > r->capacity) { 362 361 int newCapacity = expandedSize(requiredLength, r->preCapacity); 363 r->buf = static_cast<UChar *>( kjs_fast_realloc(r->buf, newCapacity * sizeof(UChar)));362 r->buf = static_cast<UChar *>(fastRealloc(r->buf, newCapacity * sizeof(UChar))); 364 363 r->capacity = newCapacity - r->preCapacity; 365 364 } … … 377 376 int delta = newCapacity - r->capacity - r->preCapacity; 378 377 379 UChar *newBuf = static_cast<UChar *>( kjs_fast_malloc(newCapacity * sizeof(UChar)));378 UChar *newBuf = static_cast<UChar *>(fastMalloc(newCapacity * sizeof(UChar))); 380 379 memcpy(newBuf + delta, r->buf, (r->capacity + r->preCapacity) * sizeof(UChar)); 381 kjs_fast_free(r->buf);380 fastFree(r->buf); 382 381 r->buf = newBuf; 383 382 … … 392 391 UString::UString(char c) 393 392 { 394 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar)));393 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar))); 395 394 d[0] = c; 396 395 rep = Rep::create(d, 1); … … 408 407 return; 409 408 } 410 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * length));409 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * length)); 411 410 for (int i = 0; i < length; i++) 412 411 d[i].uc = c[i]; … … 473 472 // a does not qualify for append, and b does not qualify for prepend, gotta make a whole new string 474 473 int newCapacity = expandedSize(length, 0); 475 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * newCapacity));474 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity)); 476 475 memcpy(d, a.data(), aSize * sizeof(UChar)); 477 476 memcpy(d + aSize, b.data(), bSize * sizeof(UChar)); … … 644 643 } 645 644 646 UChar *buffer = static_cast<UChar *>( kjs_fast_malloc(totalLength * sizeof(UChar)));645 UChar *buffer = static_cast<UChar *>(fastMalloc(totalLength * sizeof(UChar))); 647 646 648 647 int maxCount = max(rangeCount, separatorCount); … … 697 696 // this is shared with someone using more capacity, gotta make a whole new string 698 697 int newCapacity = expandedSize(length, 0); 699 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * newCapacity));698 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity)); 700 699 memcpy(d, data(), thisSize * sizeof(UChar)); 701 700 memcpy(const_cast<UChar *>(d + thisSize), t.data(), tSize * sizeof(UChar)); … … 741 740 // this is shared with someone using more capacity, gotta make a whole new string 742 741 int newCapacity = expandedSize(length, 0); 743 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * newCapacity));742 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity)); 744 743 memcpy(d, data(), thisSize * sizeof(UChar)); 745 744 for (int i = 0; i < tSize; ++i) … … 762 761 // this is empty - must make a new rep because we don't want to pollute the shared empty one 763 762 int newCapacity = expandedSize(1, 0); 764 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * newCapacity));763 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity)); 765 764 d[0] = c; 766 765 release(); … … 785 784 // this is shared with someone using more capacity, gotta make a whole new string 786 785 int newCapacity = expandedSize((length + 1), 0); 787 UChar *d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * newCapacity));786 UChar *d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * newCapacity)); 788 787 memcpy(d, data(), length * sizeof(UChar)); 789 788 d[length] = c; … … 847 846 } else { 848 847 release(); 849 d = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * l));848 d = static_cast<UChar *>(fastMalloc(sizeof(UChar) * l)); 850 849 rep = Rep::create(d, l); 851 850 } … … 1153 1152 if (rep->rc > 1 || rep->baseString) { 1154 1153 int l = size(); 1155 UChar *n = static_cast<UChar *>( kjs_fast_malloc(sizeof(UChar) * l));1154 UChar *n = static_cast<UChar *>(fastMalloc(sizeof(UChar) * l)); 1156 1155 memcpy(n, data(), l * sizeof(UChar)); 1157 1156 release(); -
trunk/JavaScriptCore/kjs/ustring.h
r10556 r10634 25 25 #define _KJS_USTRING_H_ 26 26 27 #include "fast_malloc.h"27 #include <kxmlcore/FastMalloc.h> 28 28 29 29 #if APPLE_CHANGES … … 194 194 * @short Unicode string class 195 195 */ 196 class UString {196 class UString : public FastAllocated { 197 197 friend bool operator==(const UString&, const UString&); 198 198 friend class UCharReference; … … 205 205 */ 206 206 struct Rep { 207 208 FAST_ALLOCATED_POD; 209 207 210 static Rep *create(UChar *d, int l); 208 211 static Rep *createCopying(const UChar *d, int l); … … 217 220 static unsigned computeHash(const char *); 218 221 219 KJS_FAST_ALLOCATED;220 221 222 void ref() { ++rc; } 222 223 void deref() { if (--rc == 0) destroy(); } … … 291 292 */ 292 293 ~UString() { release(); } 293 294 KJS_FAST_ALLOCATED;295 294 296 295 /**
Note:
See TracChangeset
for help on using the changeset viewer.