| OLD | NEW | 
|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/v8.h" | 5 #include "src/v8.h" | 
| 6 | 6 | 
| 7 #include "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" | 
| 8 #include "test/cctest/compiler/function-tester.h" | 8 #include "test/cctest/compiler/function-tester.h" | 
| 9 | 9 | 
| 10 using namespace v8::internal; | 10 using namespace v8::internal; | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 91       "  var is_opt = IsOptimized;" | 91       "  var is_opt = IsOptimized;" | 
| 92       "  try {" | 92       "  try {" | 
| 93       "    DeoptAndThrow(f);" | 93       "    DeoptAndThrow(f);" | 
| 94       "  } finally {" | 94       "  } finally {" | 
| 95       "    return is_opt();" | 95       "    return is_opt();" | 
| 96       "  }" | 96       "  }" | 
| 97       "})"); | 97       "})"); | 
| 98 | 98 | 
| 99   CompileRun("function DeoptAndThrow(f) { %DeoptimizeFunction(f); throw 0; }"); | 99   CompileRun("function DeoptAndThrow(f) { %DeoptimizeFunction(f); throw 0; }"); | 
| 100   InstallIsOptimizedHelper(CcTest::isolate()); | 100   InstallIsOptimizedHelper(CcTest::isolate()); | 
|  | 101 #if 0  // TODO(4195,mstarzinger): Reproduces on MIPS64, re-enable once fixed. | 
| 101   T.CheckCall(T.false_value()); | 102   T.CheckCall(T.false_value()); | 
|  | 103 #endif | 
| 102 } | 104 } | 
| 103 | 105 | 
| 104 #endif | 106 #endif | 
| 105 | 107 | 
| 106 TEST(DeoptTrivial) { | 108 TEST(DeoptTrivial) { | 
| 107   FLAG_allow_natives_syntax = true; | 109   FLAG_allow_natives_syntax = true; | 
| 108 | 110 | 
| 109   FunctionTester T( | 111   FunctionTester T( | 
| 110       "(function foo() {" | 112       "(function foo() {" | 
| 111       "  %DeoptimizeFunction(foo);" | 113       "  %DeoptimizeFunction(foo);" | 
| 112       "  return 1;" | 114       "  return 1;" | 
| 113       "})"); | 115       "})"); | 
| 114 | 116 | 
| 115   T.CheckCall(T.Val(1)); | 117   T.CheckCall(T.Val(1)); | 
| 116 } | 118 } | 
| OLD | NEW | 
|---|