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 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 years, 10 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/flag-definitions.h ('k') | src/ia32/builtins-ia32.cc » ('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 00c8e1b590f958c2fbfce050175b565e0ba9af1b..cd536885ae03898c86cf165ffde57e34b7bcb19c 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4635,7 +4635,19 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) {
typecheck->SetSuccessorAt(1, not_spec_object);
current_block()->Finish(typecheck);
if_spec_object->AddLeaveInlined(return_value, state);
- not_spec_object->AddLeaveInlined(receiver, state);
+ if (!FLAG_harmony_symbols) {
+ not_spec_object->AddLeaveInlined(receiver, state);
+ } else {
+ HHasInstanceTypeAndBranch* symbolcheck =
+ new(zone()) HHasInstanceTypeAndBranch(return_value, SYMBOL_TYPE);
+ HBasicBlock* is_symbol = graph()->CreateBasicBlock();
+ HBasicBlock* not_symbol = graph()->CreateBasicBlock();
+ symbolcheck->SetSuccessorAt(0, is_symbol);
+ symbolcheck->SetSuccessorAt(1, not_symbol);
+ not_spec_object->Finish(symbolcheck);
+ is_symbol->AddLeaveInlined(return_value, state);
+ not_symbol->AddLeaveInlined(receiver, state);
+ }
}
} else if (state->inlining_kind() == SETTER_CALL_RETURN) {
// Return from an inlined setter call. The returned value is never used, the
@@ -9488,6 +9500,16 @@ void HOptimizedGraphBuilder::GenerateIsSpecObject(CallRuntime* call) {
}
+void HOptimizedGraphBuilder::GenerateIsSymbol(CallRuntime* call) {
+ ASSERT(call->arguments()->length() == 1);
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
+ HValue* value = Pop();
+ HHasInstanceTypeAndBranch* result =
+ new(zone()) HHasInstanceTypeAndBranch(value, SYMBOL_TYPE);
+ return ast_context()->ReturnControl(result, call->id());
+}
+
+
void HOptimizedGraphBuilder::GenerateIsFunction(CallRuntime* call) {
ASSERT(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
« no previous file with comments | « src/flag-definitions.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698