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

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

Issue 227723002: VM: Implement closure calls as instance calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: minimal inlining tweaks Created 6 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
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 "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 18023 matching lines...) Expand 10 before | Expand all | Expand 10 after
18034 if (function.IsNull()) { 18034 if (function.IsNull()) {
18035 // Check if null function object indicates a stack trace overflow. 18035 // Check if null function object indicates a stack trace overflow.
18036 if ((i < (Length() - 1)) && 18036 if ((i < (Length() - 1)) &&
18037 (FunctionAtFrame(i + 1) != Function::null())) { 18037 (FunctionAtFrame(i + 1) != Function::null())) {
18038 const char* kTruncated = "...\n...\n"; 18038 const char* kTruncated = "...\n...\n";
18039 intptr_t truncated_len = strlen(kTruncated) + 1; 18039 intptr_t truncated_len = strlen(kTruncated) + 1;
18040 char* chars = isolate->current_zone()->Alloc<char>(truncated_len); 18040 char* chars = isolate->current_zone()->Alloc<char>(truncated_len);
18041 OS::SNPrint(chars, truncated_len, "%s", kTruncated); 18041 OS::SNPrint(chars, truncated_len, "%s", kTruncated);
18042 frame_strings.Add(chars); 18042 frame_strings.Add(chars);
18043 } 18043 }
18044 } else if (function.is_visible() || FLAG_verbose_stacktrace) { 18044 } else if (function.is_visible() || FLAG_verbose_stacktrace) {
Ivan Posva 2014/04/10 04:38:55 What if the function is not visible, but it has in
Florian Schneider 2014/04/10 08:49:25 Yes, that should be fixed too.
18045 code = CodeAtFrame(i); 18045 code = CodeAtFrame(i);
18046 ASSERT(function.raw() == code.function()); 18046 ASSERT(function.raw() == code.function());
18047 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i)); 18047 uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i));
18048 if (code.is_optimized() && expand_inlined()) { 18048 if (code.is_optimized() && expand_inlined()) {
18049 // Traverse inlined frames. 18049 // Traverse inlined frames.
18050 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) { 18050 for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) {
18051 function = it.function(); 18051 function = it.function();
18052 code = it.code(); 18052 if (function.is_visible() || FLAG_verbose_stacktrace) {
18053 ASSERT(function.raw() == code.function()); 18053 code = it.code();
18054 uword pc = it.pc(); 18054 ASSERT(function.raw() == code.function());
18055 ASSERT(pc != 0); 18055 uword pc = it.pc();
18056 ASSERT(code.EntryPoint() <= pc); 18056 ASSERT(pc != 0);
18057 ASSERT(pc < (code.EntryPoint() + code.Size())); 18057 ASSERT(code.EntryPoint() <= pc);
18058 total_len += PrintOneStacktrace( 18058 ASSERT(pc < (code.EntryPoint() + code.Size()));
18059 isolate, &frame_strings, pc, function, code, *frame_index); 18059 total_len += PrintOneStacktrace(
18060 isolate, &frame_strings, pc, function, code, *frame_index);
18061 }
18060 (*frame_index)++; // To account for inlined frames. 18062 (*frame_index)++; // To account for inlined frames.
18061 } 18063 }
18062 } else { 18064 } else {
18063 total_len += PrintOneStacktrace( 18065 total_len += PrintOneStacktrace(
18064 isolate, &frame_strings, pc, function, code, *frame_index); 18066 isolate, &frame_strings, pc, function, code, *frame_index);
18065 (*frame_index)++; 18067 (*frame_index)++;
18066 } 18068 }
18067 } 18069 }
18068 } 18070 }
18069 18071
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
18260 return "_MirrorReference"; 18262 return "_MirrorReference";
18261 } 18263 }
18262 18264
18263 18265
18264 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 18266 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
18265 Instance::PrintToJSONStream(stream, ref); 18267 Instance::PrintToJSONStream(stream, ref);
18266 } 18268 }
18267 18269
18268 18270
18269 } // namespace dart 18271 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698