OLD | NEW |
1 // Copyright 2006-2008 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // Custom arguments replicate a small segment of stack that can be | 85 // Custom arguments replicate a small segment of stack that can be |
86 // accessed through an Arguments object the same way the actual stack | 86 // accessed through an Arguments object the same way the actual stack |
87 // can. | 87 // can. |
88 class CustomArguments : public Relocatable { | 88 class CustomArguments : public Relocatable { |
89 public: | 89 public: |
90 inline CustomArguments(Isolate* isolate, | 90 inline CustomArguments(Isolate* isolate, |
91 Object* data, | 91 Object* data, |
92 Object* self, | 92 Object* self, |
93 JSObject* holder) : Relocatable(isolate) { | 93 JSObject* holder) : Relocatable(isolate) { |
94 values_[2] = self; | 94 ASSERT(reinterpret_cast<Object*>(isolate)->IsSmi()); |
95 values_[1] = holder; | 95 values_[3] = self; |
96 values_[0] = data; | 96 values_[2] = holder; |
| 97 values_[1] = data; |
| 98 values_[0] = reinterpret_cast<Object*>(isolate); |
97 } | 99 } |
98 | 100 |
99 inline explicit CustomArguments(Isolate* isolate) : Relocatable(isolate) { | 101 inline explicit CustomArguments(Isolate* isolate) : Relocatable(isolate) { |
100 #ifdef DEBUG | 102 #ifdef DEBUG |
101 for (size_t i = 0; i < ARRAY_SIZE(values_); i++) { | 103 for (size_t i = 0; i < ARRAY_SIZE(values_); i++) { |
102 values_[i] = reinterpret_cast<Object*>(kZapValue); | 104 values_[i] = reinterpret_cast<Object*>(kZapValue); |
103 } | 105 } |
104 #endif | 106 #endif |
105 } | 107 } |
106 | 108 |
107 void IterateInstance(ObjectVisitor* v); | 109 void IterateInstance(ObjectVisitor* v); |
108 Object** end() { return values_ + ARRAY_SIZE(values_) - 1; } | 110 Object** end() { return values_ + ARRAY_SIZE(values_) - 1; } |
109 private: | 111 private: |
110 Object* values_[3]; | 112 Object* values_[4]; |
111 }; | 113 }; |
112 | 114 |
113 | 115 |
114 #define DECLARE_RUNTIME_FUNCTION(Type, Name) \ | 116 #define DECLARE_RUNTIME_FUNCTION(Type, Name) \ |
115 Type Name(Arguments args, Isolate* isolate) | 117 Type Name(Arguments args, Isolate* isolate) |
116 | 118 |
117 | 119 |
118 #define RUNTIME_FUNCTION(Type, Name) \ | 120 #define RUNTIME_FUNCTION(Type, Name) \ |
119 Type Name(Arguments args, Isolate* isolate) | 121 Type Name(Arguments args, Isolate* isolate) |
120 | 122 |
121 | 123 |
122 #define RUNTIME_ARGUMENTS(isolate, args) args, isolate | 124 #define RUNTIME_ARGUMENTS(isolate, args) args, isolate |
123 | 125 |
124 | 126 |
125 } } // namespace v8::internal | 127 } } // namespace v8::internal |
126 | 128 |
127 #endif // V8_ARGUMENTS_H_ | 129 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |