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

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 comment 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
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 00c8e1b590f958c2fbfce050175b565e0ba9af1b..9566fb121faf87dd26521c2ebababce0cba6a4d5 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4635,7 +4635,15 @@ 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);
+ HHasInstanceTypeAndBranch* symbolcheck =
Michael Starzinger 2013/02/26 20:41:49 For the inlining in Crankshaft we only need this p
rossberg 2013/02/27 13:12:23 Done.
+ 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 +9496,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') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698