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

Unified Diff: src/stub-cache.cc

Issue 23431019: Revert "Refactoring PropertyCallbackInfo & FunctionCallbackInfo, step 1." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index fd2160e0a479e26b59c638238ca6489defd6adf9..bdfb32f46014617441990e60673620c0d186d3d9 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -1249,6 +1249,9 @@ RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) {
}
+static const int kAccessorInfoOffsetInInterceptorArgs = 2;
+
+
/**
* Attempts to load a property with an interceptor (which must be present),
* but doesn't search the prototype chain.
@@ -1257,11 +1260,13 @@ RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty) {
* provide any value for the given name.
*/
RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly) {
- ASSERT(args.length() == StubCache::kInterceptorArgsLength);
- Handle<Name> name_handle =
- args.at<Name>(StubCache::kInterceptorArgsNameIndex);
- Handle<InterceptorInfo> interceptor_info =
- args.at<InterceptorInfo>(StubCache::kInterceptorArgsInfoIndex);
+ typedef PropertyCallbackArguments PCA;
+ static const int kArgsOffset = kAccessorInfoOffsetInInterceptorArgs;
+ Handle<Name> name_handle = args.at<Name>(0);
+ Handle<InterceptorInfo> interceptor_info = args.at<InterceptorInfo>(1);
+ ASSERT(kArgsOffset == 2);
+ // No ReturnValue in interceptors.
+ ASSERT_EQ(kArgsOffset + PCA::kArgsLength - 2, args.length());
// TODO(rossberg): Support symbols in the API.
if (name_handle->IsSymbol())
@@ -1274,11 +1279,13 @@ RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly) {
ASSERT(getter != NULL);
Handle<JSObject> receiver =
- args.at<JSObject>(StubCache::kInterceptorArgsThisIndex);
+ args.at<JSObject>(kArgsOffset - PCA::kThisIndex);
Handle<JSObject> holder =
- args.at<JSObject>(StubCache::kInterceptorArgsHolderIndex);
- PropertyCallbackArguments callback_args(
- isolate, interceptor_info->data(), *receiver, *holder);
+ args.at<JSObject>(kArgsOffset - PCA::kHolderIndex);
+ PropertyCallbackArguments callback_args(isolate,
+ interceptor_info->data(),
+ *receiver,
+ *holder);
{
// Use the interceptor getter.
HandleScope scope(isolate);
@@ -1316,15 +1323,17 @@ static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) {
static MaybeObject* LoadWithInterceptor(Arguments* args,
PropertyAttributes* attrs) {
- ASSERT(args->length() == StubCache::kInterceptorArgsLength);
- Handle<Name> name_handle =
- args->at<Name>(StubCache::kInterceptorArgsNameIndex);
- Handle<InterceptorInfo> interceptor_info =
- args->at<InterceptorInfo>(StubCache::kInterceptorArgsInfoIndex);
+ typedef PropertyCallbackArguments PCA;
+ static const int kArgsOffset = kAccessorInfoOffsetInInterceptorArgs;
+ Handle<Name> name_handle = args->at<Name>(0);
+ Handle<InterceptorInfo> interceptor_info = args->at<InterceptorInfo>(1);
+ ASSERT(kArgsOffset == 2);
+ // No ReturnValue in interceptors.
+ ASSERT_EQ(kArgsOffset + PCA::kArgsLength - 2, args->length());
Handle<JSObject> receiver_handle =
- args->at<JSObject>(StubCache::kInterceptorArgsThisIndex);
+ args->at<JSObject>(kArgsOffset - PCA::kThisIndex);
Handle<JSObject> holder_handle =
- args->at<JSObject>(StubCache::kInterceptorArgsHolderIndex);
+ args->at<JSObject>(kArgsOffset - PCA::kHolderIndex);
Isolate* isolate = receiver_handle->GetIsolate();
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698