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

Side by Side Diff: src/stub-cache.cc

Issue 14139033: Clean up VMState a little bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed mistake Created 7 years, 8 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/runtime.cc ('k') | src/v8globals.h » ('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 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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 1104
1105 // TODO(rossberg): Support symbols in the API. 1105 // TODO(rossberg): Support symbols in the API.
1106 if (name->IsSymbol()) return *value; 1106 if (name->IsSymbol()) return *value;
1107 Handle<String> str = Handle<String>::cast(name); 1107 Handle<String> str = Handle<String>::cast(name);
1108 1108
1109 LOG(isolate, ApiNamedPropertyAccess("store", recv, *name)); 1109 LOG(isolate, ApiNamedPropertyAccess("store", recv, *name));
1110 CustomArguments custom_args(isolate, callback->data(), recv, recv); 1110 CustomArguments custom_args(isolate, callback->data(), recv, recv);
1111 v8::AccessorInfo info(custom_args.end()); 1111 v8::AccessorInfo info(custom_args.end());
1112 { 1112 {
1113 // Leaving JavaScript. 1113 // Leaving JavaScript.
1114 VMState state(isolate, EXTERNAL); 1114 VMState<EXTERNAL> state(isolate);
1115 ExternalCallbackScope call_scope(isolate, setter_address); 1115 ExternalCallbackScope call_scope(isolate, setter_address);
1116 fun(v8::Utils::ToLocal(str), v8::Utils::ToLocal(value), info); 1116 fun(v8::Utils::ToLocal(str), v8::Utils::ToLocal(value), info);
1117 } 1117 }
1118 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 1118 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1119 return *value; 1119 return *value;
1120 } 1120 }
1121 1121
1122 1122
1123 static const int kAccessorInfoOffsetInInterceptorArgs = 2; 1123 static const int kAccessorInfoOffsetInInterceptorArgs = 2;
1124 1124
(...skipping 25 matching lines...) Expand all
1150 ASSERT(getter != NULL); 1150 ASSERT(getter != NULL);
1151 1151
1152 { 1152 {
1153 // Use the interceptor getter. 1153 // Use the interceptor getter.
1154 v8::AccessorInfo info(args.arguments() - 1154 v8::AccessorInfo info(args.arguments() -
1155 kAccessorInfoOffsetInInterceptorArgs); 1155 kAccessorInfoOffsetInInterceptorArgs);
1156 HandleScope scope(isolate); 1156 HandleScope scope(isolate);
1157 v8::Handle<v8::Value> r; 1157 v8::Handle<v8::Value> r;
1158 { 1158 {
1159 // Leaving JavaScript. 1159 // Leaving JavaScript.
1160 VMState state(isolate, EXTERNAL); 1160 VMState<EXTERNAL> state(isolate);
1161 r = getter(v8::Utils::ToLocal(name), info); 1161 r = getter(v8::Utils::ToLocal(name), info);
1162 } 1162 }
1163 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 1163 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1164 if (!r.IsEmpty()) { 1164 if (!r.IsEmpty()) {
1165 Handle<Object> result = v8::Utils::OpenHandle(*r); 1165 Handle<Object> result = v8::Utils::OpenHandle(*r);
1166 result->VerifyApiCallResultType(); 1166 result->VerifyApiCallResultType();
1167 return *v8::Utils::OpenHandle(*r); 1167 return *v8::Utils::OpenHandle(*r);
1168 } 1168 }
1169 } 1169 }
1170 1170
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 ASSERT(getter != NULL); 1213 ASSERT(getter != NULL);
1214 1214
1215 { 1215 {
1216 // Use the interceptor getter. 1216 // Use the interceptor getter.
1217 v8::AccessorInfo info(args->arguments() - 1217 v8::AccessorInfo info(args->arguments() -
1218 kAccessorInfoOffsetInInterceptorArgs); 1218 kAccessorInfoOffsetInInterceptorArgs);
1219 HandleScope scope(isolate); 1219 HandleScope scope(isolate);
1220 v8::Handle<v8::Value> r; 1220 v8::Handle<v8::Value> r;
1221 { 1221 {
1222 // Leaving JavaScript. 1222 // Leaving JavaScript.
1223 VMState state(isolate, EXTERNAL); 1223 VMState<EXTERNAL> state(isolate);
1224 r = getter(v8::Utils::ToLocal(name), info); 1224 r = getter(v8::Utils::ToLocal(name), info);
1225 } 1225 }
1226 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 1226 RETURN_IF_SCHEDULED_EXCEPTION(isolate);
1227 if (!r.IsEmpty()) { 1227 if (!r.IsEmpty()) {
1228 *attrs = NONE; 1228 *attrs = NONE;
1229 Handle<Object> result = v8::Utils::OpenHandle(*r); 1229 Handle<Object> result = v8::Utils::OpenHandle(*r);
1230 result->VerifyApiCallResultType(); 1230 result->VerifyApiCallResultType();
1231 return *result; 1231 return *result;
1232 } 1232 }
1233 } 1233 }
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 Handle<FunctionTemplateInfo>( 2099 Handle<FunctionTemplateInfo>(
2100 FunctionTemplateInfo::cast(signature->receiver())); 2100 FunctionTemplateInfo::cast(signature->receiver()));
2101 } 2101 }
2102 } 2102 }
2103 2103
2104 is_simple_api_call_ = true; 2104 is_simple_api_call_ = true;
2105 } 2105 }
2106 2106
2107 2107
2108 } } // namespace v8::internal 2108 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/v8globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698