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

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

Issue 10014006: Try/catch in graph builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 } 5486 }
5487 return result.raw(); 5487 return result.raw();
5488 } 5488 }
5489 5489
5490 5490
5491 const char* PcDescriptors::KindAsStr(intptr_t index) const { 5491 const char* PcDescriptors::KindAsStr(intptr_t index) const {
5492 switch (DescriptorKind(index)) { 5492 switch (DescriptorKind(index)) {
5493 case PcDescriptors::kDeopt: return "deopt"; 5493 case PcDescriptors::kDeopt: return "deopt";
5494 case PcDescriptors::kPatchCode: return "patch"; 5494 case PcDescriptors::kPatchCode: return "patch";
5495 case PcDescriptors::kIcCall: return "ic-call"; 5495 case PcDescriptors::kIcCall: return "ic-call";
5496 case PcDescriptors::kFuncCall: return "func-call"; 5496 case PcDescriptors::kFuncCall: return "fn-call";
5497 case PcDescriptors::kReturn: return "return"; 5497 case PcDescriptors::kReturn: return "return";
5498 case PcDescriptors::kTypeTest: return "type-test"; 5498 case PcDescriptors::kTypeTest: return "ty-test";
5499 case PcDescriptors::kOther: return "other"; 5499 case PcDescriptors::kOther: return "other";
5500 } 5500 }
5501 UNREACHABLE(); 5501 UNREACHABLE();
5502 return ""; 5502 return "";
5503 } 5503 }
5504 5504
5505 5505
5506 const char* PcDescriptors::ToCString() const { 5506 const char* PcDescriptors::ToCString() const {
5507 if (Length() == 0) { 5507 if (Length() == 0) {
5508 return "No pc descriptors\n"; 5508 return "No pc descriptors\n";
5509 } 5509 }
5510 const char* kFormat = "0x%x, %s %ld %ld, %ld\n"; 5510 const char* kFormat = "0x%x\t%s\t%ld\t%ld\t%ld\n";
5511 // First compute the buffer size required. 5511 // First compute the buffer size required.
5512 intptr_t len = 0; 5512 intptr_t len = 0;
5513 for (intptr_t i = 0; i < Length(); i++) { 5513 for (intptr_t i = 0; i < Length(); i++) {
5514 len += OS::SNPrint(NULL, 0, kFormat, 5514 len += OS::SNPrint(NULL, 0, kFormat,
5515 PC(i), KindAsStr(i), NodeId(i), TryIndex(i), TokenIndex(i)); 5515 PC(i), KindAsStr(i), NodeId(i), TryIndex(i), TokenIndex(i));
5516 } 5516 }
5517 // Allocate the buffer. 5517 // Allocate the buffer.
5518 char* buffer = reinterpret_cast<char*>( 5518 char* buffer = reinterpret_cast<char*>(
5519 Isolate::Current()->current_zone()->Allocate(len + 1)); 5519 Isolate::Current()->current_zone()->Allocate(len + 1));
5520 // Layout the fields in the buffer. 5520 // Layout the fields in the buffer.
(...skipping 3609 matching lines...) Expand 10 before | Expand all | Expand 10 after
9130 const String& str = String::Handle(pattern()); 9130 const String& str = String::Handle(pattern());
9131 const char* format = "JSRegExp: pattern=%s flags=%s"; 9131 const char* format = "JSRegExp: pattern=%s flags=%s";
9132 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 9132 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
9133 char* chars = reinterpret_cast<char*>( 9133 char* chars = reinterpret_cast<char*>(
9134 Isolate::Current()->current_zone()->Allocate(len + 1)); 9134 Isolate::Current()->current_zone()->Allocate(len + 1));
9135 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 9135 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
9136 return chars; 9136 return chars;
9137 } 9137 }
9138 9138
9139 } // namespace dart 9139 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698