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

Unified Diff: src/hydrogen.cc

Issue 1227893005: TypeofMode replaces TypeofState and ContextualMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 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
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index d747cfb52d2b5106a322b7eaad59758ab7df3a3e..52c7de40f0f415bc96e6ddbfb9c9721f0c904b64 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4044,7 +4044,7 @@ AstContext::AstContext(HOptimizedGraphBuilder* owner, Expression::Context kind)
: owner_(owner),
kind_(kind),
outer_(owner->ast_context()),
- for_typeof_(false) {
+ typeof_mode_(NOT_INSIDE_TYPEOF) {
owner->set_ast_context(this); // Push.
#ifdef DEBUG
DCHECK(owner->environment()->frame_type() == JS_FUNCTION);
@@ -4292,7 +4292,7 @@ void HOptimizedGraphBuilder::VisitForValue(Expression* expr,
void HOptimizedGraphBuilder::VisitForTypeOf(Expression* expr) {
ValueContext for_value(this, ARGUMENTS_NOT_ALLOWED);
- for_value.set_for_typeof(true);
+ for_value.set_typeof_mode(INSIDE_TYPEOF);
Visit(expr);
}
@@ -5563,10 +5563,8 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
HValue* global_object = Add<HLoadNamedField>(
context(), nullptr,
HObjectAccess::ForContextSlot(Context::GLOBAL_OBJECT_INDEX));
- HLoadGlobalGeneric* instr =
- New<HLoadGlobalGeneric>(global_object,
- variable->name(),
- ast_context()->is_for_typeof());
+ HLoadGlobalGeneric* instr = New<HLoadGlobalGeneric>(
+ global_object, variable->name(), ast_context()->typeof_mode());
instr->SetVectorAndSlot(handle(current_feedback_vector(), isolate()),
expr->VariableFeedbackSlot());
return ast_context()->ReturnInstruction(instr, expr->id());
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698