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

Side by Side Diff: src/type-info.cc

Issue 18712002: Convert UnaryOpStub to a HydrogenCodeStub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review Created 7 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/property-details.h ('k') | src/types.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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 389
390 390
391 Handle<Type> TypeFeedbackOracle::UnaryType(TypeFeedbackId id) { 391 Handle<Type> TypeFeedbackOracle::UnaryType(TypeFeedbackId id) {
392 Handle<Object> object = GetInfo(id); 392 Handle<Object> object = GetInfo(id);
393 if (!object->IsCode()) { 393 if (!object->IsCode()) {
394 return handle(Type::None(), isolate()); 394 return handle(Type::None(), isolate());
395 } 395 }
396 Handle<Code> code = Handle<Code>::cast(object); 396 Handle<Code> code = Handle<Code>::cast(object);
397 ASSERT(code->is_unary_op_stub()); 397 ASSERT(code->is_unary_op_stub());
398 return UnaryOpIC::TypeInfoToType( 398 return UnaryOpStub(code->extra_ic_state()).GetType(isolate());
399 static_cast<UnaryOpIC::TypeInfo>(code->unary_op_type()), isolate());
400 } 399 }
401 400
402 401
403 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id, 402 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
404 Handle<Type>* left, 403 Handle<Type>* left,
405 Handle<Type>* right, 404 Handle<Type>* right,
406 Handle<Type>* result, 405 Handle<Type>* result,
407 Maybe<int>* fixed_right_arg) { 406 Maybe<int>* fixed_right_arg) {
408 Handle<Object> object = GetInfo(id); 407 Handle<Object> object = GetInfo(id);
409 if (!object->IsCode()) { 408 if (!object->IsCode()) {
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 MaybeObject* maybe_result = dictionary_->AtNumberPut(IdToKey(ast_id), target); 690 MaybeObject* maybe_result = dictionary_->AtNumberPut(IdToKey(ast_id), target);
692 USE(maybe_result); 691 USE(maybe_result);
693 #ifdef DEBUG 692 #ifdef DEBUG
694 Object* result = NULL; 693 Object* result = NULL;
695 // Dictionary has been allocated with sufficient size for all elements. 694 // Dictionary has been allocated with sufficient size for all elements.
696 ASSERT(maybe_result->ToObject(&result)); 695 ASSERT(maybe_result->ToObject(&result));
697 ASSERT(*dictionary_ == result); 696 ASSERT(*dictionary_ == result);
698 #endif 697 #endif
699 } 698 }
700 699
700
701 Representation Representation::FromType(TypeInfo info) {
702 if (info.IsUninitialized()) return Representation::None();
703 // TODO(verwaest): Return Smi rather than Integer32.
704 if (info.IsSmi()) return Representation::Integer32();
705 if (info.IsInteger32()) return Representation::Integer32();
706 if (info.IsDouble()) return Representation::Double();
707 if (info.IsNumber()) return Representation::Double();
708 return Representation::Tagged();
709 }
710
711
701 } } // namespace v8::internal 712 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property-details.h ('k') | src/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698