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

Side by Side Diff: src/runtime.cc

Issue 113199: X64: General fixes - added inline definitions and changed tome places to intptr_t. (Closed)
Patch Set: Created 11 years, 7 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
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4424 matching lines...) Expand 10 before | Expand all | Expand 10 after
4435 } 4435 }
4436 4436
4437 4437
4438 // A mechanism to return pairs of Object*'s. This is somewhat 4438 // A mechanism to return pairs of Object*'s. This is somewhat
4439 // compiler-dependent as it assumes that a 64-bit value (a long long) 4439 // compiler-dependent as it assumes that a 64-bit value (a long long)
4440 // is returned via two registers (edx:eax on ia32). Both the ia32 and 4440 // is returned via two registers (edx:eax on ia32). Both the ia32 and
4441 // arm platform support this; it is mostly an issue of "coaxing" the 4441 // arm platform support this; it is mostly an issue of "coaxing" the
4442 // compiler to do the right thing. 4442 // compiler to do the right thing.
4443 // 4443 //
4444 // TODO(1236026): This is a non-portable hack that should be removed. 4444 // TODO(1236026): This is a non-portable hack that should be removed.
4445 // TODO(x64): Definitly!
Erik Corry 2009/05/12 09:24:50 spolling!
4445 typedef uint64_t ObjectPair; 4446 typedef uint64_t ObjectPair;
4446 static inline ObjectPair MakePair(Object* x, Object* y) { 4447 static inline ObjectPair MakePair(Object* x, Object* y) {
4448 #ifdef V8_HOST_ARCH_64_BIT
Dean McNamee 2009/05/12 08:22:40 I have just been doing #if, we should be consisten
Lasse Reichstein 2009/05/12 10:32:51 Done
4449 UNIMPLEMENTED();
4450 return 0;
4451 #else
4447 return reinterpret_cast<uint32_t>(x) | 4452 return reinterpret_cast<uint32_t>(x) |
4448 (reinterpret_cast<ObjectPair>(y) << 32); 4453 (reinterpret_cast<ObjectPair>(y) << 32);
4454 #endif
4449 } 4455 }
4450 4456
4451 4457
4452 static inline Object* Unhole(Object* x, PropertyAttributes attributes) { 4458 static inline Object* Unhole(Object* x, PropertyAttributes attributes) {
4453 ASSERT(!x->IsTheHole() || (attributes & READ_ONLY) != 0); 4459 ASSERT(!x->IsTheHole() || (attributes & READ_ONLY) != 0);
4454 USE(attributes); 4460 USE(attributes);
4455 return x->IsTheHole() ? Heap::undefined_value() : x; 4461 return x->IsTheHole() ? Heap::undefined_value() : x;
4456 } 4462 }
4457 4463
4458 4464
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
6024 return *Factory::NewJSArrayWithElements(details); 6030 return *Factory::NewJSArrayWithElements(details);
6025 } 6031 }
6026 6032
6027 6033
6028 static Object* Runtime_GetCFrames(Arguments args) { 6034 static Object* Runtime_GetCFrames(Arguments args) {
6029 HandleScope scope; 6035 HandleScope scope;
6030 ASSERT(args.length() == 1); 6036 ASSERT(args.length() == 1);
6031 Object* result = Runtime_CheckExecutionState(args); 6037 Object* result = Runtime_CheckExecutionState(args);
6032 if (result->IsFailure()) return result; 6038 if (result->IsFailure()) return result;
6033 6039
6040 #ifdef V8_HOST_ARCH_64_BIT
Dean McNamee 2009/05/12 08:22:40 #if
6041 UNIMPLEMENTED();
6042 return Heap::undefined_value();
6043 #else
6044
6034 static const int kMaxCFramesSize = 200; 6045 static const int kMaxCFramesSize = 200;
6035 ScopedVector<OS::StackFrame> frames(kMaxCFramesSize); 6046 ScopedVector<OS::StackFrame> frames(kMaxCFramesSize);
6036 int frames_count = OS::StackWalk(frames); 6047 int frames_count = OS::StackWalk(frames);
6037 if (frames_count == OS::kStackWalkError) { 6048 if (frames_count == OS::kStackWalkError) {
6038 return Heap::undefined_value(); 6049 return Heap::undefined_value();
6039 } 6050 }
6040 6051
6041 Handle<String> address_str = Factory::LookupAsciiSymbol("address"); 6052 Handle<String> address_str = Factory::LookupAsciiSymbol("address");
6042 Handle<String> text_str = Factory::LookupAsciiSymbol("text"); 6053 Handle<String> text_str = Factory::LookupAsciiSymbol("text");
6043 Handle<FixedArray> frames_array = Factory::NewFixedArray(frames_count); 6054 Handle<FixedArray> frames_array = Factory::NewFixedArray(frames_count);
(...skipping 11 matching lines...) Expand all
6055 frame_text = Factory::NewStringFromAscii(str); 6066 frame_text = Factory::NewStringFromAscii(str);
6056 } 6067 }
6057 6068
6058 if (!frame_text.is_null()) { 6069 if (!frame_text.is_null()) {
6059 frame_value->SetProperty(*text_str, *frame_text, NONE); 6070 frame_value->SetProperty(*text_str, *frame_text, NONE);
6060 } 6071 }
6061 6072
6062 frames_array->set(i, *frame_value); 6073 frames_array->set(i, *frame_value);
6063 } 6074 }
6064 return *Factory::NewJSArrayWithElements(frames_array); 6075 return *Factory::NewJSArrayWithElements(frames_array);
6076 #endif // V8_HOST_ARCH_64_BIT
6065 } 6077 }
6066 6078
6067 6079
6068 static Object* Runtime_GetThreadCount(Arguments args) { 6080 static Object* Runtime_GetThreadCount(Arguments args) {
6069 HandleScope scope; 6081 HandleScope scope;
6070 ASSERT(args.length() == 1); 6082 ASSERT(args.length() == 1);
6071 6083
6072 // Check arguments. 6084 // Check arguments.
6073 Object* result = Runtime_CheckExecutionState(args); 6085 Object* result = Runtime_CheckExecutionState(args);
6074 if (result->IsFailure()) return result; 6086 if (result->IsFailure()) return result;
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
7071 } else { 7083 } else {
7072 // Handle last resort GC and make sure to allow future allocations 7084 // Handle last resort GC and make sure to allow future allocations
7073 // to grow the heap without causing GCs (if possible). 7085 // to grow the heap without causing GCs (if possible).
7074 Counters::gc_last_resort_from_js.Increment(); 7086 Counters::gc_last_resort_from_js.Increment();
7075 Heap::CollectAllGarbage(); 7087 Heap::CollectAllGarbage();
7076 } 7088 }
7077 } 7089 }
7078 7090
7079 7091
7080 } } // namespace v8::internal 7092 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698