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

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

Issue 240443005: Some MaybeHandles related cleanups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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') | 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 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 HandleScope scope(isolate); 492 HandleScope scope(isolate);
493 493
494 // TODO(rossberg): Support symbols in the API. 494 // TODO(rossberg): Support symbols in the API.
495 if (name->IsSymbol()) return *value; 495 if (name->IsSymbol()) return *value;
496 Handle<String> str = Handle<String>::cast(name); 496 Handle<String> str = Handle<String>::cast(name);
497 497
498 LOG(isolate, ApiNamedPropertyAccess("store", receiver, *name)); 498 LOG(isolate, ApiNamedPropertyAccess("store", receiver, *name));
499 PropertyCallbackArguments 499 PropertyCallbackArguments
500 custom_args(isolate, callback->data(), receiver, holder); 500 custom_args(isolate, callback->data(), receiver, holder);
501 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value)); 501 custom_args.Call(fun, v8::Utils::ToLocal(str), v8::Utils::ToLocal(value));
502 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 502 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
503 return *value; 503 return *value;
504 } 504 }
505 505
506 506
507 /** 507 /**
508 * Attempts to load a property with an interceptor (which must be present), 508 * Attempts to load a property with an interceptor (which must be present),
509 * but doesn't search the prototype chain. 509 * but doesn't search the prototype chain.
510 * 510 *
511 * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't 511 * Returns |Heap::no_interceptor_result_sentinel()| if interceptor doesn't
512 * provide any value for the given name. 512 * provide any value for the given name.
(...skipping 19 matching lines...) Expand all
532 args.at<JSObject>(StubCache::kInterceptorArgsThisIndex); 532 args.at<JSObject>(StubCache::kInterceptorArgsThisIndex);
533 Handle<JSObject> holder = 533 Handle<JSObject> holder =
534 args.at<JSObject>(StubCache::kInterceptorArgsHolderIndex); 534 args.at<JSObject>(StubCache::kInterceptorArgsHolderIndex);
535 PropertyCallbackArguments callback_args( 535 PropertyCallbackArguments callback_args(
536 isolate, interceptor_info->data(), *receiver, *holder); 536 isolate, interceptor_info->data(), *receiver, *holder);
537 { 537 {
538 // Use the interceptor getter. 538 // Use the interceptor getter.
539 HandleScope scope(isolate); 539 HandleScope scope(isolate);
540 v8::Handle<v8::Value> r = 540 v8::Handle<v8::Value> r =
541 callback_args.Call(getter, v8::Utils::ToLocal(name)); 541 callback_args.Call(getter, v8::Utils::ToLocal(name));
542 RETURN_IF_SCHEDULED_EXCEPTION(isolate); 542 RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate);
543 if (!r.IsEmpty()) { 543 if (!r.IsEmpty()) {
544 Handle<Object> result = v8::Utils::OpenHandle(*r); 544 Handle<Object> result = v8::Utils::OpenHandle(*r);
545 result->VerifyApiCallResultType(); 545 result->VerifyApiCallResultType();
546 return *v8::Utils::OpenHandle(*r); 546 return *v8::Utils::OpenHandle(*r);
547 } 547 }
548 } 548 }
549 549
550 return isolate->heap()->no_interceptor_result_sentinel(); 550 return isolate->heap()->no_interceptor_result_sentinel();
551 } 551 }
552 552
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 Handle<FunctionTemplateInfo>( 1499 Handle<FunctionTemplateInfo>(
1500 FunctionTemplateInfo::cast(signature->receiver())); 1500 FunctionTemplateInfo::cast(signature->receiver()));
1501 } 1501 }
1502 } 1502 }
1503 1503
1504 is_simple_api_call_ = true; 1504 is_simple_api_call_ = true;
1505 } 1505 }
1506 1506
1507 1507
1508 } } // namespace v8::internal 1508 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698