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

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

Issue 9475031: Cleaned up usage of Function::code, since it may be misunderstood that it points to the only Code o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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/object.h ('k') | runtime/vm/opt_code_generator_ia32.cc » ('j') | 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 3567 matching lines...) Expand 10 before | Expand all | Expand 10 after
3578 for (intptr_t i = 0; i < num_parameters; i++) { 3578 for (intptr_t i = 0; i < num_parameters; i++) {
3579 type = ParameterTypeAt(i); 3579 type = ParameterTypeAt(i);
3580 if (!type.IsInstantiated()) { 3580 if (!type.IsInstantiated()) {
3581 return false; 3581 return false;
3582 } 3582 }
3583 } 3583 }
3584 return true; 3584 return true;
3585 } 3585 }
3586 3586
3587 3587
3588 bool Function::HasOptimizedCode() const {
3589 return HasCode() && Code::Handle(raw_ptr()->code_).is_optimized();
3590 }
3591
3592
3588 const char* Function::ToCString() const { 3593 const char* Function::ToCString() const {
3589 const char* f0 = is_static() ? " static" : ""; 3594 const char* f0 = is_static() ? " static" : "";
3590 const char* f1 = NULL; 3595 const char* f1 = NULL;
3591 const char* f2 = is_const() ? " const" : ""; 3596 const char* f2 = is_const() ? " const" : "";
3592 switch (kind()) { 3597 switch (kind()) {
3593 case RawFunction::kFunction: 3598 case RawFunction::kFunction:
3594 case RawFunction::kClosureFunction: 3599 case RawFunction::kClosureFunction:
3595 case RawFunction::kGetterFunction: 3600 case RawFunction::kGetterFunction:
3596 case RawFunction::kSetterFunction: 3601 case RawFunction::kSetterFunction:
3597 f1 = ""; 3602 f1 = "";
(...skipping 4390 matching lines...) Expand 10 before | Expand all | Expand 10 after
7988 ASSERT(Isolate::Current() != NULL); 7993 ASSERT(Isolate::Current() != NULL);
7989 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table(); 7994 CodeIndexTable* code_index_table = Isolate::Current()->code_index_table();
7990 ASSERT(code_index_table != NULL); 7995 ASSERT(code_index_table != NULL);
7991 Function& function = Function::Handle(); 7996 Function& function = Function::Handle();
7992 Code& code = Code::Handle(); 7997 Code& code = Code::Handle();
7993 Smi& pc_offset = Smi::Handle(); 7998 Smi& pc_offset = Smi::Handle();
7994 const Array& function_array = Array::Handle(raw_ptr()->function_array_); 7999 const Array& function_array = Array::Handle(raw_ptr()->function_array_);
7995 const Array& code_array = Array::Handle(raw_ptr()->code_array_); 8000 const Array& code_array = Array::Handle(raw_ptr()->code_array_);
7996 const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_); 8001 const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_);
7997 for (intptr_t i = 0; i < frame_pcs.length(); i++) { 8002 for (intptr_t i = 0; i < frame_pcs.length(); i++) {
7998 function = code_index_table->LookupFunction(frame_pcs[i]); 8003 code = code_index_table->LookupCode(frame_pcs[i]);
8004 ASSERT(!code.IsNull());
8005 function = code.function();
7999 function_array.SetAt((index + i), function); 8006 function_array.SetAt((index + i), function);
8000 code = function.code();
8001 code_array.SetAt((index + i), code); 8007 code_array.SetAt((index + i), code);
8002 pc_offset = Smi::New(frame_pcs[i] - code.EntryPoint()); 8008 pc_offset = Smi::New(frame_pcs[i] - code.EntryPoint());
8003 pc_offset_array.SetAt((index + i), pc_offset); 8009 pc_offset_array.SetAt((index + i), pc_offset);
8004 } 8010 }
8005 } 8011 }
8006 8012
8007 8013
8008 RawStacktrace* Stacktrace::New(const GrowableArray<uword>& stack_frame_pcs, 8014 RawStacktrace* Stacktrace::New(const GrowableArray<uword>& stack_frame_pcs,
8009 Heap::Space space) { 8015 Heap::Space space) {
8010 const Class& cls = Class::Handle( 8016 const Class& cls = Class::Handle(
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
8325 result.set_num_args_tested(num_args_tested); 8331 result.set_num_args_tested(num_args_tested);
8326 // Number of array elements in one test entry (num_args_tested + 1) 8332 // Number of array elements in one test entry (num_args_tested + 1)
8327 intptr_t len = num_args_tested + 1; 8333 intptr_t len = num_args_tested + 1;
8328 // IC data array must be null terminated (sentinel entry). 8334 // IC data array must be null terminated (sentinel entry).
8329 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); 8335 Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
8330 result.set_ic_data(ic_data); 8336 result.set_ic_data(ic_data);
8331 return result.raw(); 8337 return result.raw();
8332 } 8338 }
8333 8339
8334 } // namespace dart 8340 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/opt_code_generator_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698