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

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

Issue 101663002: Revert "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: 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,
410 Token::Value op) { 411 Token::Value op) {
411 Handle<Object> object = GetInfo(id); 412 Handle<Object> object = GetInfo(id);
412 if (!object->IsCode()) { 413 if (!object->IsCode()) {
413 // For some binary ops we don't have ICs, e.g. Token::COMMA, but for the 414 // For some binary ops we don't have ICs, e.g. Token::COMMA, but for the
414 // operations covered by the BinaryOpIC we should always have them. 415 // operations covered by the BinaryOpIC we should always have them.
415 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN || 416 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN ||
416 op > BinaryOpIC::State::LAST_TOKEN); 417 op > BinaryOpIC::State::LAST_TOKEN);
417 *left = *right = *result = handle(Type::None(), isolate_); 418 *left = *right = *result = handle(Type::None(), isolate_);
419 *fixed_right_arg = Maybe<int>();
418 return; 420 return;
419 } 421 }
420 Handle<Code> code = Handle<Code>::cast(object); 422 Handle<Code> code = Handle<Code>::cast(object);
421 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); 423 ASSERT_EQ(Code::BINARY_OP_IC, code->kind());
422 BinaryOpIC::State state(code->extended_extra_ic_state()); 424 BinaryOpIC::State state(code->extended_extra_ic_state());
423 ASSERT_EQ(op, state.op()); 425 ASSERT_EQ(op, state.op());
424 426
425 *left = state.GetLeftType(isolate()); 427 *left = state.GetLeftType(isolate());
426 *right = state.GetRightType(isolate()); 428 *right = state.GetRightType(isolate());
427 *result = state.GetResultType(isolate()); 429 *result = state.GetResultType(isolate());
430 *fixed_right_arg = state.fixed_right_arg();
428 } 431 }
429 432
430 433
431 Handle<Type> TypeFeedbackOracle::ClauseType(TypeFeedbackId id) { 434 Handle<Type> TypeFeedbackOracle::ClauseType(TypeFeedbackId id) {
432 Handle<Object> info = GetInfo(id); 435 Handle<Object> info = GetInfo(id);
433 Handle<Type> result(Type::None(), isolate_); 436 Handle<Type> result(Type::None(), isolate_);
434 if (info->IsCode() && Handle<Code>::cast(info)->is_compare_ic_stub()) { 437 if (info->IsCode() && Handle<Code>::cast(info)->is_compare_ic_stub()) {
435 Handle<Code> code = Handle<Code>::cast(info); 438 Handle<Code> code = Handle<Code>::cast(info);
436 CompareIC::State state = ICCompareStub::CompareState(code->stub_info()); 439 CompareIC::State state = ICCompareStub::CompareState(code->stub_info());
437 result = CompareIC::StateToType(isolate_, state); 440 result = CompareIC::StateToType(isolate_, state);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 if (info.IsUninitialized()) return Representation::None(); 756 if (info.IsUninitialized()) return Representation::None();
754 if (info.IsSmi()) return Representation::Smi(); 757 if (info.IsSmi()) return Representation::Smi();
755 if (info.IsInteger32()) return Representation::Integer32(); 758 if (info.IsInteger32()) return Representation::Integer32();
756 if (info.IsDouble()) return Representation::Double(); 759 if (info.IsDouble()) return Representation::Double();
757 if (info.IsNumber()) return Representation::Double(); 760 if (info.IsNumber()) return Representation::Double();
758 return Representation::Tagged(); 761 return Representation::Tagged();
759 } 762 }
760 763
761 764
762 } } // namespace v8::internal 765 } } // 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