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

Side by Side Diff: src/ic.cc

Issue 231883007: Return MaybeHandle from Invoke. (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/handles.cc ('k') | src/isolate.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 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 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 2390
2391 MaybeObject* BinaryOpIC::Transition(Handle<AllocationSite> allocation_site, 2391 MaybeObject* BinaryOpIC::Transition(Handle<AllocationSite> allocation_site,
2392 Handle<Object> left, 2392 Handle<Object> left,
2393 Handle<Object> right) { 2393 Handle<Object> right) {
2394 State state(target()->extra_ic_state()); 2394 State state(target()->extra_ic_state());
2395 2395
2396 // Compute the actual result using the builtin for the binary operation. 2396 // Compute the actual result using the builtin for the binary operation.
2397 Object* builtin = isolate()->js_builtins_object()->javascript_builtin( 2397 Object* builtin = isolate()->js_builtins_object()->javascript_builtin(
2398 TokenToJSBuiltin(state.op())); 2398 TokenToJSBuiltin(state.op()));
2399 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); 2399 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate());
2400 bool caught_exception; 2400 Handle<Object> result;
2401 Handle<Object> result = Execution::Call( 2401 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
2402 isolate(), function, left, 1, &right, &caught_exception); 2402 isolate(), result,
2403 if (caught_exception) return Failure::Exception(); 2403 Execution::Call(isolate(), function, left, 1, &right));
2404 2404
2405 // Execution::Call can execute arbitrary JavaScript, hence potentially 2405 // Execution::Call can execute arbitrary JavaScript, hence potentially
2406 // update the state of this very IC, so we must update the stored state. 2406 // update the state of this very IC, so we must update the stored state.
2407 UpdateTarget(); 2407 UpdateTarget();
2408 // Compute the new state. 2408 // Compute the new state.
2409 State old_state(target()->extra_ic_state()); 2409 State old_state(target()->extra_ic_state());
2410 state.Update(left, right, result); 2410 state.Update(left, right, result);
2411 2411
2412 // Check if we have a string operation here. 2412 // Check if we have a string operation here.
2413 Handle<Code> target; 2413 Handle<Code> target;
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
2842 #undef ADDR 2842 #undef ADDR
2843 }; 2843 };
2844 2844
2845 2845
2846 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2846 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2847 return IC_utilities[id]; 2847 return IC_utilities[id];
2848 } 2848 }
2849 2849
2850 2850
2851 } } // namespace v8::internal 2851 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698