OLD | NEW |
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 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 | 2397 |
2398 // Compute the actual result using the builtin for the binary operation. | 2398 // Compute the actual result using the builtin for the binary operation. |
2399 Object* builtin = isolate()->js_builtins_object()->javascript_builtin( | 2399 Object* builtin = isolate()->js_builtins_object()->javascript_builtin( |
2400 TokenToJSBuiltin(state.op())); | 2400 TokenToJSBuiltin(state.op())); |
2401 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); | 2401 Handle<JSFunction> function = handle(JSFunction::cast(builtin), isolate()); |
2402 bool caught_exception; | 2402 bool caught_exception; |
2403 Handle<Object> result = Execution::Call( | 2403 Handle<Object> result = Execution::Call( |
2404 isolate(), function, left, 1, &right, &caught_exception); | 2404 isolate(), function, left, 1, &right, &caught_exception); |
2405 if (caught_exception) return Failure::Exception(); | 2405 if (caught_exception) return Failure::Exception(); |
2406 | 2406 |
| 2407 // Execution::Call can execute arbitrary JavaScript, hence potentially |
| 2408 // update the state of this very IC, so we must update the stored state. |
| 2409 UpdateTarget(); |
2407 // Compute the new state. | 2410 // Compute the new state. |
2408 State old_state = state; | 2411 State old_state(target()->extra_ic_state()); |
2409 state.Update(left, right, result); | 2412 state.Update(left, right, result); |
2410 | 2413 |
2411 // Check if we have a string operation here. | 2414 // Check if we have a string operation here. |
2412 Handle<Code> target; | 2415 Handle<Code> target; |
2413 if (!allocation_site.is_null() || state.ShouldCreateAllocationMementos()) { | 2416 if (!allocation_site.is_null() || state.ShouldCreateAllocationMementos()) { |
2414 // Setup the allocation site on-demand. | 2417 // Setup the allocation site on-demand. |
2415 if (allocation_site.is_null()) { | 2418 if (allocation_site.is_null()) { |
2416 allocation_site = isolate()->factory()->NewAllocationSite(); | 2419 allocation_site = isolate()->factory()->NewAllocationSite(); |
2417 } | 2420 } |
2418 | 2421 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 #undef ADDR | 2844 #undef ADDR |
2842 }; | 2845 }; |
2843 | 2846 |
2844 | 2847 |
2845 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 2848 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
2846 return IC_utilities[id]; | 2849 return IC_utilities[id]; |
2847 } | 2850 } |
2848 | 2851 |
2849 | 2852 |
2850 } } // namespace v8::internal | 2853 } } // namespace v8::internal |
OLD | NEW |