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

Side by Side Diff: src/ic.cc

Issue 7248063: Simplify UnaryOpStub a little bit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 2325
2326 return GENERIC; 2326 return GENERIC;
2327 } 2327 }
2328 2328
2329 2329
2330 RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) { 2330 RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
2331 ASSERT(args.length() == 4); 2331 ASSERT(args.length() == 4);
2332 2332
2333 HandleScope scope(isolate); 2333 HandleScope scope(isolate);
2334 Handle<Object> operand = args.at<Object>(0); 2334 Handle<Object> operand = args.at<Object>(0);
2335 int key = args.smi_at(1); 2335 Token::Value op = static_cast<Token::Value>(args.smi_at(1));
2336 Token::Value op = static_cast<Token::Value>(args.smi_at(2)); 2336 UnaryOverwriteMode mode = static_cast<UnaryOverwriteMode>(args.smi_at(2));
2337 UnaryOpIC::TypeInfo previous_type = 2337 UnaryOpIC::TypeInfo previous_type =
2338 static_cast<UnaryOpIC::TypeInfo>(args.smi_at(3)); 2338 static_cast<UnaryOpIC::TypeInfo>(args.smi_at(3));
2339 2339
2340 UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand); 2340 UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand);
2341 type = UnaryOpIC::ComputeNewType(type, previous_type); 2341 type = UnaryOpIC::ComputeNewType(type, previous_type);
2342 2342
2343 UnaryOpStub stub(key, type); 2343 UnaryOpStub stub(op, mode, type);
2344 Handle<Code> code = stub.GetCode(); 2344 Handle<Code> code = stub.GetCode();
2345 if (!code.is_null()) { 2345 if (!code.is_null()) {
2346 if (FLAG_trace_ic) { 2346 if (FLAG_trace_ic) {
2347 PrintF("[UnaryOpIC (%s->%s)#%s]\n", 2347 PrintF("[UnaryOpIC (%s->%s)#%s]\n",
2348 UnaryOpIC::GetName(previous_type), 2348 UnaryOpIC::GetName(previous_type),
2349 UnaryOpIC::GetName(type), 2349 UnaryOpIC::GetName(type),
2350 Token::Name(op)); 2350 Token::Name(op));
2351 } 2351 }
2352 UnaryOpIC ic(isolate); 2352 UnaryOpIC ic(isolate);
2353 ic.patch(*code); 2353 ic.patch(*code);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 #undef ADDR 2560 #undef ADDR
2561 }; 2561 };
2562 2562
2563 2563
2564 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2564 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2565 return IC_utilities[id]; 2565 return IC_utilities[id];
2566 } 2566 }
2567 2567
2568 2568
2569 } } // namespace v8::internal 2569 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698