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

Side by Side Diff: src/arguments.cc

Issue 25260005: Revert "Refactor PropertyCallbackInfo & FunctionCallbackInfo, part 3." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arguments.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 20 matching lines...) Expand all
31 #include "vm-state-inl.h" 31 #include "vm-state-inl.h"
32 32
33 namespace v8 { 33 namespace v8 {
34 namespace internal { 34 namespace internal {
35 35
36 36
37 template<typename T> 37 template<typename T>
38 template<typename V> 38 template<typename V>
39 v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) { 39 v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) {
40 // Check the ReturnValue. 40 // Check the ReturnValue.
41 Object** handle = &this->begin()[kReturnValueOffset]; 41 Object** handle = &this->end()[kReturnValueOffset];
42 // Nothing was set, return empty handle as per previous behaviour. 42 // Nothing was set, return empty handle as per previous behaviour.
43 if ((*handle)->IsTheHole()) return v8::Handle<V>(); 43 if ((*handle)->IsTheHole()) return v8::Handle<V>();
44 return Utils::Convert<Object, V>(Handle<Object>(handle)); 44 return Utils::Convert<Object, V>(Handle<Object>(handle));
45 } 45 }
46 46
47 47
48 v8::Handle<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) { 48 v8::Handle<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
49 Isolate* isolate = this->isolate(); 49 Isolate* isolate = this->isolate();
50 VMState<EXTERNAL> state(isolate); 50 VMState<EXTERNAL> state(isolate);
51 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); 51 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
52 FunctionCallbackInfo<v8::Value> info(begin(), 52 FunctionCallbackInfo<v8::Value> info(end(),
53 argv_, 53 argv_,
54 argc_, 54 argc_,
55 is_construct_call_); 55 is_construct_call_);
56 f(info); 56 f(info);
57 return GetReturnValue<v8::Value>(isolate); 57 return GetReturnValue<v8::Value>(isolate);
58 } 58 }
59 59
60 60
61 #define WRITE_CALL_0(Function, ReturnValue) \ 61 #define WRITE_CALL_0(Function, ReturnValue) \
62 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f) { \ 62 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f) { \
63 Isolate* isolate = this->isolate(); \ 63 Isolate* isolate = this->isolate(); \
64 VMState<EXTERNAL> state(isolate); \ 64 VMState<EXTERNAL> state(isolate); \
65 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 65 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
66 PropertyCallbackInfo<ReturnValue> info(begin()); \ 66 PropertyCallbackInfo<ReturnValue> info(end()); \
67 f(info); \ 67 f(info); \
68 return GetReturnValue<ReturnValue>(isolate); \ 68 return GetReturnValue<ReturnValue>(isolate); \
69 } 69 }
70 70
71 71
72 #define WRITE_CALL_1(Function, ReturnValue, Arg1) \ 72 #define WRITE_CALL_1(Function, ReturnValue, Arg1) \
73 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \ 73 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
74 Arg1 arg1) { \ 74 Arg1 arg1) { \
75 Isolate* isolate = this->isolate(); \ 75 Isolate* isolate = this->isolate(); \
76 VMState<EXTERNAL> state(isolate); \ 76 VMState<EXTERNAL> state(isolate); \
77 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 77 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
78 PropertyCallbackInfo<ReturnValue> info(begin()); \ 78 PropertyCallbackInfo<ReturnValue> info(end()); \
79 f(arg1, info); \ 79 f(arg1, info); \
80 return GetReturnValue<ReturnValue>(isolate); \ 80 return GetReturnValue<ReturnValue>(isolate); \
81 } 81 }
82 82
83 83
84 #define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \ 84 #define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
85 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \ 85 v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
86 Arg1 arg1, \ 86 Arg1 arg1, \
87 Arg2 arg2) { \ 87 Arg2 arg2) { \
88 Isolate* isolate = this->isolate(); \ 88 Isolate* isolate = this->isolate(); \
89 VMState<EXTERNAL> state(isolate); \ 89 VMState<EXTERNAL> state(isolate); \
90 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 90 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
91 PropertyCallbackInfo<ReturnValue> info(begin()); \ 91 PropertyCallbackInfo<ReturnValue> info(end()); \
92 f(arg1, arg2, info); \ 92 f(arg1, arg2, info); \
93 return GetReturnValue<ReturnValue>(isolate); \ 93 return GetReturnValue<ReturnValue>(isolate); \
94 } 94 }
95 95
96 96
97 #define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \ 97 #define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
98 void PropertyCallbackArguments::Call(Function f, \ 98 void PropertyCallbackArguments::Call(Function f, \
99 Arg1 arg1, \ 99 Arg1 arg1, \
100 Arg2 arg2) { \ 100 Arg2 arg2) { \
101 Isolate* isolate = this->isolate(); \ 101 Isolate* isolate = this->isolate(); \
102 VMState<EXTERNAL> state(isolate); \ 102 VMState<EXTERNAL> state(isolate); \
103 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ 103 ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
104 PropertyCallbackInfo<ReturnValue> info(begin()); \ 104 PropertyCallbackInfo<ReturnValue> info(end()); \
105 f(arg1, arg2, info); \ 105 f(arg1, arg2, info); \
106 } 106 }
107 107
108 108
109 FOR_EACH_CALLBACK_TABLE_MAPPING_0(WRITE_CALL_0) 109 FOR_EACH_CALLBACK_TABLE_MAPPING_0(WRITE_CALL_0)
110 FOR_EACH_CALLBACK_TABLE_MAPPING_1(WRITE_CALL_1) 110 FOR_EACH_CALLBACK_TABLE_MAPPING_1(WRITE_CALL_1)
111 FOR_EACH_CALLBACK_TABLE_MAPPING_2(WRITE_CALL_2) 111 FOR_EACH_CALLBACK_TABLE_MAPPING_2(WRITE_CALL_2)
112 FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(WRITE_CALL_2_VOID) 112 FOR_EACH_CALLBACK_TABLE_MAPPING_2_VOID_RETURN(WRITE_CALL_2_VOID)
113 113
114 #undef WRITE_CALL_0 114 #undef WRITE_CALL_0
115 #undef WRITE_CALL_1 115 #undef WRITE_CALL_1
116 #undef WRITE_CALL_2 116 #undef WRITE_CALL_2
117 #undef WRITE_CALL_2_VOID 117 #undef WRITE_CALL_2_VOID
118 118
119 119
120 } } // namespace v8::internal 120 } } // namespace v8::internal
121
OLDNEW
« no previous file with comments | « src/arguments.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698