Handle Symbols in the LBranch instruction on x64.
authorsvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Aug 2013 13:33:41 +0000 (13:33 +0000)
committersvenpanne@chromium.org <svenpanne@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Aug 2013 13:33:41 +0000 (13:33 +0000)
This was an omission in https://code.google.com/p/v8/source/detail?r=14051.

R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/22578002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/code-stubs.cc
src/x64/lithium-codegen-x64.cc

index d472fa2..f656bf7 100644 (file)
@@ -469,6 +469,9 @@ void CompareNilICStub::UpdateStatus(Handle<Object> object) {
 
 template<class StateType>
 void HydrogenCodeStub::TraceTransition(StateType from, StateType to) {
+  // Note: Although a no-op transition is semantically OK, it is hinting at a
+  // bug somewhere in our state transition machinery.
+  ASSERT(from != to);
   #ifdef DEBUG
   if (!FLAG_trace_ic) return;
   char buffer[100];
index d62041e..cc63510 100644 (file)
@@ -2016,6 +2016,12 @@ void LCodeGen::DoBranch(LBranch* instr) {
         __ bind(&not_string);
       }
 
+      if (expected.Contains(ToBooleanStub::SYMBOL)) {
+        // Symbol value -> true.
+        __ CmpInstanceType(map, SYMBOL_TYPE);
+        __ j(equal, instr->TrueLabel(chunk_));
+      }
+
       if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) {
         // heap number -> false iff +0, -0, or NaN.
         Label not_heap_number;