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

Side by Side Diff: src/objects-inl.h

Issue 269003: Fix a crash in Logger::LogCompiledFunctions due to a presence of scripts with disposed source. (Closed)
Patch Set: Fixed comments Created 11 years, 2 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
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-log.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 kStartPositionAndTypeOffset) 2354 kStartPositionAndTypeOffset)
2355 INT_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) 2355 INT_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset)
2356 INT_ACCESSORS(SharedFunctionInfo, function_token_position, 2356 INT_ACCESSORS(SharedFunctionInfo, function_token_position,
2357 kFunctionTokenPositionOffset) 2357 kFunctionTokenPositionOffset)
2358 INT_ACCESSORS(SharedFunctionInfo, compiler_hints, 2358 INT_ACCESSORS(SharedFunctionInfo, compiler_hints,
2359 kCompilerHintsOffset) 2359 kCompilerHintsOffset)
2360 INT_ACCESSORS(SharedFunctionInfo, this_property_assignments_count, 2360 INT_ACCESSORS(SharedFunctionInfo, this_property_assignments_count,
2361 kThisPropertyAssignmentsCountOffset) 2361 kThisPropertyAssignmentsCountOffset)
2362 2362
2363 2363
2364 bool Script::HasValidSource() {
2365 Object* src = this->source();
2366 if (!src->IsString()) return true;
2367 String* src_str = String::cast(src);
2368 if (!StringShape(src_str).IsExternal()) return true;
2369 if (src_str->IsAsciiRepresentation()) {
2370 return ExternalAsciiString::cast(src)->resource() != NULL;
2371 } else if (src_str->IsTwoByteRepresentation()) {
2372 return ExternalTwoByteString::cast(src)->resource() != NULL;
2373 }
2374 return true;
2375 }
2376
2377
2364 void SharedFunctionInfo::DontAdaptArguments() { 2378 void SharedFunctionInfo::DontAdaptArguments() {
2365 ASSERT(code()->kind() == Code::BUILTIN); 2379 ASSERT(code()->kind() == Code::BUILTIN);
2366 set_formal_parameter_count(kDontAdaptArgumentsSentinel); 2380 set_formal_parameter_count(kDontAdaptArgumentsSentinel);
2367 } 2381 }
2368 2382
2369 2383
2370 int SharedFunctionInfo::start_position() { 2384 int SharedFunctionInfo::start_position() {
2371 return start_position_and_type() >> kStartPositionShift; 2385 return start_position_and_type() >> kStartPositionShift;
2372 } 2386 }
2373 2387
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 #undef WRITE_INT_FIELD 2892 #undef WRITE_INT_FIELD
2879 #undef READ_SHORT_FIELD 2893 #undef READ_SHORT_FIELD
2880 #undef WRITE_SHORT_FIELD 2894 #undef WRITE_SHORT_FIELD
2881 #undef READ_BYTE_FIELD 2895 #undef READ_BYTE_FIELD
2882 #undef WRITE_BYTE_FIELD 2896 #undef WRITE_BYTE_FIELD
2883 2897
2884 2898
2885 } } // namespace v8::internal 2899 } } // namespace v8::internal
2886 2900
2887 #endif // V8_OBJECTS_INL_H_ 2901 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698