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

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

Issue 99173002: Use constant types to represent the fixed right arg of a MOD. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment. Created 7 years 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/type-info.h ('k') | src/typing.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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 *combined_type = stub.GetType(isolate_, map); 400 *combined_type = stub.GetType(isolate_, map);
401 *left_type = *right_type = stub.GetInputType(isolate_, map); 401 *left_type = *right_type = stub.GetInputType(isolate_, map);
402 } 402 }
403 } 403 }
404 404
405 405
406 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id, 406 void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
407 Handle<Type>* left, 407 Handle<Type>* left,
408 Handle<Type>* right, 408 Handle<Type>* right,
409 Handle<Type>* result, 409 Handle<Type>* result,
410 Maybe<int>* fixed_right_arg,
411 Token::Value op) { 410 Token::Value op) {
412 Handle<Object> object = GetInfo(id); 411 Handle<Object> object = GetInfo(id);
413 if (!object->IsCode()) { 412 if (!object->IsCode()) {
414 // For some binary ops we don't have ICs, e.g. Token::COMMA, but for the 413 // For some binary ops we don't have ICs, e.g. Token::COMMA, but for the
415 // operations covered by the BinaryOpIC we should always have them. 414 // operations covered by the BinaryOpIC we should always have them.
416 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN || 415 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN ||
417 op > BinaryOpIC::State::LAST_TOKEN); 416 op > BinaryOpIC::State::LAST_TOKEN);
418 *left = *right = *result = handle(Type::None(), isolate_); 417 *left = *right = *result = handle(Type::None(), isolate_);
419 *fixed_right_arg = Maybe<int>();
420 return; 418 return;
421 } 419 }
422 Handle<Code> code = Handle<Code>::cast(object); 420 Handle<Code> code = Handle<Code>::cast(object);
423 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); 421 ASSERT_EQ(Code::BINARY_OP_IC, code->kind());
424 BinaryOpIC::State state(code->extended_extra_ic_state()); 422 BinaryOpIC::State state(code->extended_extra_ic_state());
425 ASSERT_EQ(op, state.op()); 423 ASSERT_EQ(op, state.op());
426 424
427 *left = state.GetLeftType(isolate()); 425 *left = state.GetLeftType(isolate());
428 *right = state.GetRightType(isolate()); 426 *right = state.GetRightType(isolate());
429 *result = state.GetResultType(isolate()); 427 *result = state.GetResultType(isolate());
430 *fixed_right_arg = state.fixed_right_arg();
431 } 428 }
432 429
433 430
434 Handle<Type> TypeFeedbackOracle::ClauseType(TypeFeedbackId id) { 431 Handle<Type> TypeFeedbackOracle::ClauseType(TypeFeedbackId id) {
435 Handle<Object> info = GetInfo(id); 432 Handle<Object> info = GetInfo(id);
436 Handle<Type> result(Type::None(), isolate_); 433 Handle<Type> result(Type::None(), isolate_);
437 if (info->IsCode() && Handle<Code>::cast(info)->is_compare_ic_stub()) { 434 if (info->IsCode() && Handle<Code>::cast(info)->is_compare_ic_stub()) {
438 Handle<Code> code = Handle<Code>::cast(info); 435 Handle<Code> code = Handle<Code>::cast(info);
439 CompareIC::State state = ICCompareStub::CompareState(code->stub_info()); 436 CompareIC::State state = ICCompareStub::CompareState(code->stub_info());
440 result = CompareIC::StateToType(isolate_, state); 437 result = CompareIC::StateToType(isolate_, state);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 if (info.IsUninitialized()) return Representation::None(); 753 if (info.IsUninitialized()) return Representation::None();
757 if (info.IsSmi()) return Representation::Smi(); 754 if (info.IsSmi()) return Representation::Smi();
758 if (info.IsInteger32()) return Representation::Integer32(); 755 if (info.IsInteger32()) return Representation::Integer32();
759 if (info.IsDouble()) return Representation::Double(); 756 if (info.IsDouble()) return Representation::Double();
760 if (info.IsNumber()) return Representation::Double(); 757 if (info.IsNumber()) return Representation::Double();
761 return Representation::Tagged(); 758 return Representation::Tagged();
762 } 759 }
763 760
764 761
765 } } // namespace v8::internal 762 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/type-info.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698