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

Unified Diff: src/deoptimizer.cc

Issue 15735005: Collect type feedback for power-of-2 right operands in BinaryOps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM INT32 stub Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« src/code-stubs.h ('K') | « src/code-stubs.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index bf1de7083453cdd06acf11c79f4e4b4a6b1c92c4..918381953db63c91b33ff1869fe930a255d06ce8 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -1977,56 +1977,6 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator,
}
-static bool ObjectToInt32(Object* obj, int32_t* value) {
- if (obj->IsSmi()) {
- *value = Smi::cast(obj)->value();
- return true;
- }
-
- if (obj->IsHeapNumber()) {
- double num = HeapNumber::cast(obj)->value();
- if (FastI2D(FastD2I(num)) != num) {
- if (FLAG_trace_osr) {
- PrintF("**** %g could not be converted to int32 ****\n",
- HeapNumber::cast(obj)->value());
- }
- return false;
- }
-
- *value = FastD2I(num);
- return true;
- }
-
- return false;
-}
-
-
-static bool ObjectToUint32(Object* obj, uint32_t* value) {
- if (obj->IsSmi()) {
- if (Smi::cast(obj)->value() < 0) return false;
-
- *value = static_cast<uint32_t>(Smi::cast(obj)->value());
- return true;
- }
-
- if (obj->IsHeapNumber()) {
- double num = HeapNumber::cast(obj)->value();
- if ((num < 0) || (FastUI2D(FastD2UI(num)) != num)) {
- if (FLAG_trace_osr) {
- PrintF("**** %g could not be converted to uint32 ****\n",
- HeapNumber::cast(obj)->value());
- }
- return false;
- }
-
- *value = FastD2UI(num);
- return true;
- }
-
- return false;
-}
-
-
bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
int* input_offset) {
disasm::NameConverter converter;
@@ -2070,7 +2020,7 @@ bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
case Translation::INT32_REGISTER: {
int32_t int32_value = 0;
- if (!ObjectToInt32(input_object, &int32_value)) return false;
+ if (!input_object->ToInt32(&int32_value)) return false;
int output_reg = iterator->Next();
if (FLAG_trace_osr) {
@@ -2085,7 +2035,7 @@ bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
case Translation::UINT32_REGISTER: {
uint32_t uint32_value = 0;
- if (!ObjectToUint32(input_object, &uint32_value)) return false;
+ if (!input_object->ToUint32(&uint32_value)) return false;
int output_reg = iterator->Next();
if (FLAG_trace_osr) {
@@ -2132,7 +2082,7 @@ bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
case Translation::INT32_STACK_SLOT: {
int32_t int32_value = 0;
- if (!ObjectToInt32(input_object, &int32_value)) return false;
+ if (!input_object->ToInt32(&int32_value)) return false;
int output_index = iterator->Next();
unsigned output_offset =
@@ -2149,7 +2099,7 @@ bool Deoptimizer::DoOsrTranslateCommand(TranslationIterator* iterator,
case Translation::UINT32_STACK_SLOT: {
uint32_t uint32_value = 0;
- if (!ObjectToUint32(input_object, &uint32_value)) return false;
+ if (!input_object->ToUint32(&uint32_value)) return false;
int output_index = iterator->Next();
unsigned output_offset =
« src/code-stubs.h ('K') | « src/code-stubs.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698