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

Unified Diff: src/frame-element.h

Issue 1277001: Store type information with constants. ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frame-element.h
===================================================================
--- src/frame-element.h (revision 4250)
+++ src/frame-element.h (working copy)
@@ -28,7 +28,7 @@
#ifndef V8_FRAME_ELEMENT_H_
#define V8_FRAME_ELEMENT_H_
-#include "number-info.h"
+#include "number-info-inl.h"
#include "macro-assembler.h"
#include "zone.h"
@@ -58,13 +58,7 @@
// Copied elements do not have number info. Instead
// we have to inspect their backing element in the frame.
ASSERT(!is_copy());
- if (!is_constant()) {
- return NumberInfo::FromInt(NumberInfoField::decode(value_));
- }
- Handle<Object> value = handle();
- if (value->IsSmi()) return NumberInfo::Smi();
- if (value->IsHeapNumber()) return NumberInfo::HeapNumber();
- return NumberInfo::Unknown();
+ return NumberInfo::FromInt(NumberInfoField::decode(value_));
}
inline void set_number_info(NumberInfo info) {
@@ -107,7 +101,8 @@
// compile time.
static FrameElement ConstantElement(Handle<Object> value,
SyncFlag is_synced) {
- FrameElement result(value, is_synced);
+ NumberInfo info = NumberInfo::TypeFromValue(value);
+ FrameElement result(value, is_synced, info);
return result;
}
@@ -232,11 +227,11 @@
}
// Used to construct constant elements.
- FrameElement(Handle<Object> value, SyncFlag is_synced) {
+ FrameElement(Handle<Object> value, SyncFlag is_synced, NumberInfo info) {
value_ = TypeField::encode(CONSTANT)
| CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED)
- | NumberInfoField::encode(NumberInfo::Uninitialized().ToInt())
+ | NumberInfoField::encode(info.ToInt())
| DataField::encode(ConstantList()->length());
ConstantList()->Add(value);
}
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698