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

Side by Side Diff: runtime/vm/assembler_mips.cc

Issue 22389004: Allows compiler bailout to handle errors of any type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 static bool CanEncodeBranchOffset(int32_t offset) { 46 static bool CanEncodeBranchOffset(int32_t offset) {
47 ASSERT(Utils::IsAligned(offset, 4)); 47 ASSERT(Utils::IsAligned(offset, 4));
48 return Utils::IsInt(18, offset); 48 return Utils::IsInt(18, offset);
49 } 49 }
50 50
51 51
52 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t instr) { 52 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t instr) {
53 if (!CanEncodeBranchOffset(offset)) { 53 if (!CanEncodeBranchOffset(offset)) {
54 ASSERT(!use_far_branches()); 54 ASSERT(!use_far_branches());
55 const Error& error = Error::Handle(LanguageError::New( 55 Isolate::Current()->long_jump_base()->Jump(
56 String::Handle(String::New("Branch offset overflow")))); 56 1, Object::branch_offset_error());
57 Isolate::Current()->long_jump_base()->Jump(1, error);
58 } 57 }
59 58
60 // Properly preserve only the bits supported in the instruction. 59 // Properly preserve only the bits supported in the instruction.
61 offset >>= 2; 60 offset >>= 2;
62 offset &= kBranchOffsetMask; 61 offset &= kBranchOffsetMask;
63 return (instr & ~kBranchOffsetMask) | offset; 62 return (instr & ~kBranchOffsetMask) | offset;
64 } 63 }
65 64
66 65
67 static int DecodeBranchOffset(int32_t instr) { 66 static int DecodeBranchOffset(int32_t instr) {
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 Bind(&msg); 977 Bind(&msg);
979 break_(Instr::kMsgMessageCode); 978 break_(Instr::kMsgMessageCode);
980 } 979 }
981 #endif 980 #endif
982 } 981 }
983 982
984 } // namespace dart 983 } // namespace dart
985 984
986 #endif // defined TARGET_ARCH_MIPS 985 #endif // defined TARGET_ARCH_MIPS
987 986
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/compiler.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698