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

Side by Side Diff: src/objects.cc

Issue 28069: A refinement of cl 28068. (Closed)
Patch Set: Created 11 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
« no previous file with comments | « no previous file | 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 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 6935 matching lines...) Expand 10 before | Expand all | Expand 10 after
6946 ASSERT(obj->HasFastProperties()); 6946 ASSERT(obj->HasFastProperties());
6947 6947
6948 return obj; 6948 return obj;
6949 } 6949 }
6950 6950
6951 6951
6952 // Init line_ends array with code positions of line ends inside script source 6952 // Init line_ends array with code positions of line ends inside script source
6953 void Script::InitLineEnds() { 6953 void Script::InitLineEnds() {
6954 if (!line_ends()->IsUndefined()) return; 6954 if (!line_ends()->IsUndefined()) return;
6955 6955
6956 if (source()->IsUndefined()) { 6956 if (!source()->IsString()) {
6957 set_line_ends(*(Factory::NewArrayLiteral(0))); 6957 ASSERT(source()->IsUndefined());
6958 set_line_ends(*(Factory::NewJSArray(0)));
6958 ASSERT(line_ends()->IsJSArray()); 6959 ASSERT(line_ends()->IsJSArray());
6959 return; 6960 return;
6960 } 6961 }
6961 6962
6962 Handle<String> src(String::cast(source())); 6963 Handle<String> src(String::cast(source()));
6963 const int src_len = src->length(); 6964 const int src_len = src->length();
6964 Handle<String> new_line = Factory::NewStringFromAscii(CStrVector("\n")); 6965 Handle<String> new_line = Factory::NewStringFromAscii(CStrVector("\n"));
6965 6966
6966 // Pass 1: Identify line count 6967 // Pass 1: Identify line count
6967 int line_count = 0; 6968 int line_count = 0;
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
7257 // No break point. 7258 // No break point.
7258 if (break_point_objects()->IsUndefined()) return 0; 7259 if (break_point_objects()->IsUndefined()) return 0;
7259 // Single beak point. 7260 // Single beak point.
7260 if (!break_point_objects()->IsFixedArray()) return 1; 7261 if (!break_point_objects()->IsFixedArray()) return 1;
7261 // Multiple break points. 7262 // Multiple break points.
7262 return FixedArray::cast(break_point_objects())->length(); 7263 return FixedArray::cast(break_point_objects())->length();
7263 } 7264 }
7264 7265
7265 7266
7266 } } // namespace v8::internal 7267 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698