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

Side by Side Diff: src/ic.cc

Issue 22184004: Desugar bitwise negation into XOR and kill all UnaryOp stuff. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Feedback. Created 7 years, 4 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
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 383
384 switch (target->kind()) { 384 switch (target->kind()) {
385 case Code::LOAD_IC: return LoadIC::Clear(address, target); 385 case Code::LOAD_IC: return LoadIC::Clear(address, target);
386 case Code::KEYED_LOAD_IC: return KeyedLoadIC::Clear(address, target); 386 case Code::KEYED_LOAD_IC: return KeyedLoadIC::Clear(address, target);
387 case Code::STORE_IC: return StoreIC::Clear(address, target); 387 case Code::STORE_IC: return StoreIC::Clear(address, target);
388 case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target); 388 case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target);
389 case Code::CALL_IC: return CallIC::Clear(address, target); 389 case Code::CALL_IC: return CallIC::Clear(address, target);
390 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target); 390 case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target);
391 case Code::COMPARE_IC: return CompareIC::Clear(address, target); 391 case Code::COMPARE_IC: return CompareIC::Clear(address, target);
392 case Code::COMPARE_NIL_IC: return CompareNilIC::Clear(address, target); 392 case Code::COMPARE_NIL_IC: return CompareNilIC::Clear(address, target);
393 case Code::UNARY_OP_IC:
394 case Code::BINARY_OP_IC: 393 case Code::BINARY_OP_IC:
395 case Code::TO_BOOLEAN_IC: 394 case Code::TO_BOOLEAN_IC:
396 // Clearing these is tricky and does not 395 // Clearing these is tricky and does not
397 // make any performance difference. 396 // make any performance difference.
398 return; 397 return;
399 default: UNREACHABLE(); 398 default: UNREACHABLE();
400 } 399 }
401 } 400 }
402 401
403 402
(...skipping 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 Isolate* isolate) { 2581 Isolate* isolate) {
2583 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo; 2582 TypeInfo left_typeinfo, right_typeinfo, result_typeinfo;
2584 BinaryOpStub::decode_types_from_minor_key( 2583 BinaryOpStub::decode_types_from_minor_key(
2585 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo); 2584 minor_key, &left_typeinfo, &right_typeinfo, &result_typeinfo);
2586 *left = TypeInfoToType(left_typeinfo, isolate); 2585 *left = TypeInfoToType(left_typeinfo, isolate);
2587 *right = TypeInfoToType(right_typeinfo, isolate); 2586 *right = TypeInfoToType(right_typeinfo, isolate);
2588 *result = TypeInfoToType(result_typeinfo, isolate); 2587 *result = TypeInfoToType(result_typeinfo, isolate);
2589 } 2588 }
2590 2589
2591 2590
2592 MaybeObject* UnaryOpIC::Transition(Handle<Object> object) {
2593 Code::ExtraICState extra_ic_state = target()->extended_extra_ic_state();
2594 UnaryOpStub stub(extra_ic_state);
2595
2596 stub.UpdateStatus(object);
2597
2598 Handle<Code> code = stub.GetCode(isolate());
2599 set_target(*code);
2600
2601 return stub.Result(object, isolate());
2602 }
2603
2604
2605 RUNTIME_FUNCTION(MaybeObject*, UnaryOpIC_Miss) {
2606 HandleScope scope(isolate);
2607 Handle<Object> object = args.at<Object>(0);
2608 UnaryOpIC ic(isolate);
2609 return ic.Transition(object);
2610 }
2611
2612
2613 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value, 2591 static BinaryOpIC::TypeInfo TypeInfoFromValue(Handle<Object> value,
2614 Token::Value op) { 2592 Token::Value op) {
2615 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value); 2593 v8::internal::TypeInfo type = v8::internal::TypeInfo::FromValue(value);
2616 if (type.IsSmi()) return BinaryOpIC::SMI; 2594 if (type.IsSmi()) return BinaryOpIC::SMI;
2617 if (type.IsInteger32()) { 2595 if (type.IsInteger32()) {
2618 if (kSmiValueSize == 32) return BinaryOpIC::SMI; 2596 if (kSmiValueSize == 32) return BinaryOpIC::SMI;
2619 return BinaryOpIC::INT32; 2597 return BinaryOpIC::INT32;
2620 } 2598 }
2621 if (type.IsNumber()) return BinaryOpIC::NUMBER; 2599 if (type.IsNumber()) return BinaryOpIC::NUMBER;
2622 if (type.IsString()) return BinaryOpIC::STRING; 2600 if (type.IsString()) return BinaryOpIC::STRING;
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 #undef ADDR 3106 #undef ADDR
3129 }; 3107 };
3130 3108
3131 3109
3132 Address IC::AddressFromUtilityId(IC::UtilityId id) { 3110 Address IC::AddressFromUtilityId(IC::UtilityId id) {
3133 return IC_utilities[id]; 3111 return IC_utilities[id];
3134 } 3112 }
3135 3113
3136 3114
3137 } } // namespace v8::internal 3115 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic.h ('k') | src/log.cc » ('j') | src/x64/lithium-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698