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

Unified Diff: src/variables.h

Issue 18901003: Compute expected type for variables (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« src/typing.cc ('K') | « src/typing.cc ('k') | src/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.h
diff --git a/src/variables.h b/src/variables.h
index 39451d5dfb1df987e0a2528365be3354760e019f..57fd44c2dfeee0aaa334a7277ca12d5422ad71a4 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -29,6 +29,7 @@
#define V8_VARIABLES_H_
#include "zone.h"
+#include "types.h"
#include "interface.h"
namespace v8 {
@@ -143,6 +144,9 @@ class Variable: public ZoneObject {
local_if_not_shadowed_ = local;
}
+ Handle<Type> expected_type() { return expected_type_; }
+ void set_expected_type(Handle<Type> type) { expected_type_ = type; }
+
Location location() const { return location_; }
int index() const { return index_; }
InitializationFlag initialization_flag() const {
@@ -162,6 +166,7 @@ class Variable: public ZoneObject {
Handle<String> name_;
VariableMode mode_;
Kind kind_;
+ Handle<Type> expected_type_; // Intersection of all reads
Jakob Kummerow 2013/07/09 16:01:50 nit: trailing full stop. And, uhm, "Union" ;-)
Location location_;
int index_;
int initializer_position_;
« src/typing.cc ('K') | « src/typing.cc ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698