| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 635 |
| 636 // The number of arguments expected. nargs is -1 if the function takes | 636 // The number of arguments expected. nargs is -1 if the function takes |
| 637 // a variable number of arguments. | 637 // a variable number of arguments. |
| 638 int nargs; | 638 int nargs; |
| 639 // Size of result. Most functions return a single pointer, size 1. | 639 // Size of result. Most functions return a single pointer, size 1. |
| 640 int result_size; | 640 int result_size; |
| 641 }; | 641 }; |
| 642 | 642 |
| 643 static const int kNotFound = -1; | 643 static const int kNotFound = -1; |
| 644 | 644 |
| 645 // Add symbols for all the intrinsic function names to a StringDictionary. | 645 // Add internalized strings for all the intrinsic function names to a |
| 646 // StringDictionary. |
| 646 // Returns failure if an allocation fails. In this case, it must be | 647 // Returns failure if an allocation fails. In this case, it must be |
| 647 // retried with a new, empty StringDictionary, not with the same one. | 648 // retried with a new, empty StringDictionary, not with the same one. |
| 648 // Alternatively, heap initialization can be completely restarted. | 649 // Alternatively, heap initialization can be completely restarted. |
| 649 MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames( | 650 MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames( |
| 650 Heap* heap, Object* dictionary); | 651 Heap* heap, Object* dictionary); |
| 651 | 652 |
| 652 // Get the intrinsic function with the given name, which must be a symbol. | 653 // Get the intrinsic function with the given name, which must be internalized. |
| 653 static const Function* FunctionForSymbol(Handle<String> name); | 654 static const Function* FunctionForName(Handle<String> name); |
| 654 | 655 |
| 655 // Get the intrinsic function with the given FunctionId. | 656 // Get the intrinsic function with the given FunctionId. |
| 656 static const Function* FunctionForId(FunctionId id); | 657 static const Function* FunctionForId(FunctionId id); |
| 657 | 658 |
| 658 // General-purpose helper functions for runtime system. | 659 // General-purpose helper functions for runtime system. |
| 659 static int StringMatch(Isolate* isolate, | 660 static int StringMatch(Isolate* isolate, |
| 660 Handle<String> sub, | 661 Handle<String> sub, |
| 661 Handle<String> pat, | 662 Handle<String> pat, |
| 662 int index); | 663 int index); |
| 663 | 664 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 //--------------------------------------------------------------------------- | 712 //--------------------------------------------------------------------------- |
| 712 // Constants used by interface to runtime functions. | 713 // Constants used by interface to runtime functions. |
| 713 | 714 |
| 714 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; | 715 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
| 715 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; | 716 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
| 716 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; | 717 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; |
| 717 | 718 |
| 718 } } // namespace v8::internal | 719 } } // namespace v8::internal |
| 719 | 720 |
| 720 #endif // V8_RUNTIME_H_ | 721 #endif // V8_RUNTIME_H_ |
| OLD | NEW |