OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast.h" | 5 #include "src/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 return raw_value()->IsString() | 997 return raw_value()->IsString() |
998 ? raw_value()->AsString()->hash() | 998 ? raw_value()->AsString()->hash() |
999 : ComputeLongHash(double_to_uint64(raw_value()->AsNumber())); | 999 : ComputeLongHash(double_to_uint64(raw_value()->AsNumber())); |
1000 } | 1000 } |
1001 | 1001 |
1002 | 1002 |
1003 // static | 1003 // static |
1004 bool Literal::Match(void* literal1, void* literal2) { | 1004 bool Literal::Match(void* literal1, void* literal2) { |
1005 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1005 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1006 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1006 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1007 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || | 1007 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1008 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1008 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1009 } | 1009 } |
1010 | 1010 |
1011 | 1011 |
1012 } } // namespace v8::internal | 1012 } } // namespace v8::internal |
OLD | NEW |