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

Side by Side Diff: src/builtins.cc

Issue 6680007: [Isolates] Pass isolate to HandleScope across builtins.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Created 9 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 JSObject::cast(global_context->array_function()->prototype()); 404 JSObject::cast(global_context->array_function()->prototype());
405 return receiver->GetPrototype() == array_proto && 405 return receiver->GetPrototype() == array_proto &&
406 ArrayPrototypeHasNoElements(heap, global_context, array_proto); 406 ArrayPrototypeHasNoElements(heap, global_context, array_proto);
407 } 407 }
408 408
409 409
410 MUST_USE_RESULT static MaybeObject* CallJsBuiltin( 410 MUST_USE_RESULT static MaybeObject* CallJsBuiltin(
411 Isolate* isolate, 411 Isolate* isolate,
412 const char* name, 412 const char* name,
413 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) { 413 BuiltinArguments<NO_EXTRA_ARGUMENTS> args) {
414 HandleScope handleScope; 414 HandleScope handleScope(isolate);
415 415
416 Handle<Object> js_builtin = 416 Handle<Object> js_builtin =
417 GetProperty(Handle<JSObject>( 417 GetProperty(Handle<JSObject>(
418 isolate->global_context()->builtins()), 418 isolate->global_context()->builtins()),
419 name); 419 name);
420 ASSERT(js_builtin->IsJSFunction()); 420 ASSERT(js_builtin->IsJSFunction());
421 Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin)); 421 Handle<JSFunction> function(Handle<JSFunction>::cast(js_builtin));
422 ScopedVector<Object**> argv(args.length() - 1); 422 ScopedVector<Object**> argv(args.length() - 1);
423 int n_args = args.length() - 1; 423 int n_args = args.length() - 1;
424 for (int i = 0; i < n_args; i++) { 424 for (int i = 0; i < n_args; i++) {
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 return holder; 1031 return holder;
1032 } 1032 }
1033 1033
1034 1034
1035 template <bool is_construct> 1035 template <bool is_construct>
1036 MUST_USE_RESULT static MaybeObject* HandleApiCallHelper( 1036 MUST_USE_RESULT static MaybeObject* HandleApiCallHelper(
1037 BuiltinArguments<NEEDS_CALLED_FUNCTION> args, Isolate* isolate) { 1037 BuiltinArguments<NEEDS_CALLED_FUNCTION> args, Isolate* isolate) {
1038 ASSERT(is_construct == CalledAsConstructor(isolate)); 1038 ASSERT(is_construct == CalledAsConstructor(isolate));
1039 Heap* heap = isolate->heap(); 1039 Heap* heap = isolate->heap();
1040 1040
1041 HandleScope scope; 1041 HandleScope scope(isolate);
1042 Handle<JSFunction> function = args.called_function(); 1042 Handle<JSFunction> function = args.called_function();
1043 ASSERT(function->shared()->IsApiFunction()); 1043 ASSERT(function->shared()->IsApiFunction());
1044 1044
1045 FunctionTemplateInfo* fun_data = function->shared()->get_api_func_data(); 1045 FunctionTemplateInfo* fun_data = function->shared()->get_api_func_data();
1046 if (is_construct) { 1046 if (is_construct) {
1047 Handle<FunctionTemplateInfo> desc(fun_data); 1047 Handle<FunctionTemplateInfo> desc(fun_data);
1048 bool pending_exception = false; 1048 bool pending_exception = false;
1049 isolate->factory()->ConfigureInstance( 1049 isolate->factory()->ConfigureInstance(
1050 desc, Handle<JSObject>::cast(args.receiver()), &pending_exception); 1050 desc, Handle<JSObject>::cast(args.receiver()), &pending_exception);
1051 ASSERT(isolate->has_pending_exception() == pending_exception); 1051 ASSERT(isolate->has_pending_exception() == pending_exception);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 constructor->shared()->get_api_func_data()->instance_call_handler(); 1205 constructor->shared()->get_api_func_data()->instance_call_handler();
1206 ASSERT(!handler->IsUndefined()); 1206 ASSERT(!handler->IsUndefined());
1207 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler); 1207 CallHandlerInfo* call_data = CallHandlerInfo::cast(handler);
1208 Object* callback_obj = call_data->callback(); 1208 Object* callback_obj = call_data->callback();
1209 v8::InvocationCallback callback = 1209 v8::InvocationCallback callback =
1210 v8::ToCData<v8::InvocationCallback>(callback_obj); 1210 v8::ToCData<v8::InvocationCallback>(callback_obj);
1211 1211
1212 // Get the data for the call and perform the callback. 1212 // Get the data for the call and perform the callback.
1213 Object* result; 1213 Object* result;
1214 { 1214 {
1215 HandleScope scope; 1215 HandleScope scope(isolate);
1216 1216
1217 LOG(ApiObjectAccess("call non-function", obj)); 1217 LOG(ApiObjectAccess("call non-function", obj));
1218 1218
1219 CustomArguments custom(isolate); 1219 CustomArguments custom(isolate);
1220 v8::ImplementationUtilities::PrepareArgumentsData(custom.end(), 1220 v8::ImplementationUtilities::PrepareArgumentsData(custom.end(),
1221 call_data->data(), constructor, obj); 1221 call_data->data(), constructor, obj);
1222 v8::Arguments new_args = v8::ImplementationUtilities::NewArguments( 1222 v8::Arguments new_args = v8::ImplementationUtilities::NewArguments(
1223 custom.end(), 1223 custom.end(),
1224 &args[0] - 1, 1224 &args[0] - 1,
1225 args.length() - 1, 1225 args.length() - 1,
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 if (entry->contains(pc)) { 1647 if (entry->contains(pc)) {
1648 return names_[i]; 1648 return names_[i];
1649 } 1649 }
1650 } 1650 }
1651 } 1651 }
1652 return NULL; 1652 return NULL;
1653 } 1653 }
1654 1654
1655 1655
1656 } } // namespace v8::internal 1656 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698