Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: include/v8.h

Issue 4117010: Refactoring of v8:Arguments (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/apiutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
===================================================================
--- include/v8.h (revision 5743)
+++ include/v8.h (working copy)
@@ -1790,18 +1790,19 @@
inline bool IsConstructCall() const;
inline Local<Value> Data() const;
private:
+ static const int kDataIndex = 0;
+ static const int kCalleeIndex = -1;
+ static const int kHolderIndex = -2;
+
friend class ImplementationUtilities;
- inline Arguments(Local<Value> data,
- Local<Object> holder,
- Local<Function> callee,
- bool is_construct_call,
- void** values, int length);
- Local<Value> data_;
- Local<Object> holder_;
- Local<Function> callee_;
+ inline Arguments(internal::Object** implicit_args,
+ internal::Object** values,
+ int length,
+ bool is_construct_call);
+ internal::Object** implicit_args_;
+ internal::Object** values_;
+ int length_;
bool is_construct_call_;
- void** values_;
- int length_;
};
@@ -3470,14 +3471,13 @@
}
-Arguments::Arguments(v8::Local<v8::Value> data,
- v8::Local<v8::Object> holder,
- v8::Local<v8::Function> callee,
- bool is_construct_call,
- void** values, int length)
- : data_(data), holder_(holder), callee_(callee),
- is_construct_call_(is_construct_call),
- values_(values), length_(length) { }
+Arguments::Arguments(internal::Object** implicit_args,
+ internal::Object** values, int length,
+ bool is_construct_call)
+ : implicit_args_(implicit_args),
+ values_(values),
+ length_(length),
+ is_construct_call_(is_construct_call) { }
Local<Value> Arguments::operator[](int i) const {
@@ -3487,7 +3487,8 @@
Local<Function> Arguments::Callee() const {
- return callee_;
+ return Local<Function>(reinterpret_cast<Function*>(
+ &implicit_args_[kCalleeIndex]));
}
@@ -3497,12 +3498,13 @@
Local<Object> Arguments::Holder() const {
- return holder_;
+ return Local<Object>(reinterpret_cast<Object*>(
+ &implicit_args_[kHolderIndex]));
}
Local<Value> Arguments::Data() const {
- return data_;
+ return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
}
« no previous file with comments | « no previous file | src/apiutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698