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

Unified Diff: src/handles.cc

Issue 385035: Restore info needed to register profile ticks in functions from... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
===================================================================
--- src/handles.cc (revision 3266)
+++ src/handles.cc (working copy)
@@ -427,12 +427,12 @@
// Init line_ends array with code positions of line ends inside script
// source.
void InitScriptLineEnds(Handle<Script> script) {
- if (!script->line_ends()->IsUndefined()) return;
+ if (!script->line_ends_fixed_array()->IsUndefined()) return;
if (!script->source()->IsString()) {
ASSERT(script->source()->IsUndefined());
- script->set_line_ends(*(Factory::NewJSArray(0)));
- ASSERT(script->line_ends()->IsJSArray());
+ script->set_line_ends_fixed_array(*(Factory::NewFixedArray(0)));
+ ASSERT(script->line_ends_fixed_array()->IsFixedArray());
return;
}
@@ -465,9 +465,8 @@
}
ASSERT(array_index == line_count);
- Handle<JSArray> object = Factory::NewJSArrayWithElements(array);
- script->set_line_ends(*object);
- ASSERT(script->line_ends()->IsJSArray());
+ script->set_line_ends_fixed_array(*array);
+ ASSERT(script->line_ends_fixed_array()->IsFixedArray());
}
@@ -475,17 +474,18 @@
int GetScriptLineNumber(Handle<Script> script, int code_pos) {
InitScriptLineEnds(script);
AssertNoAllocation no_allocation;
- JSArray* line_ends_array = JSArray::cast(script->line_ends());
- const int line_ends_len = (Smi::cast(line_ends_array->length()))->value();
+ FixedArray* line_ends_array =
+ FixedArray::cast(script->line_ends_fixed_array());
+ const int line_ends_len = line_ends_array->length();
int line = -1;
if (line_ends_len > 0 &&
- code_pos <= (Smi::cast(line_ends_array->GetElement(0)))->value()) {
+ code_pos <= (Smi::cast(line_ends_array->get(0)))->value()) {
line = 0;
} else {
for (int i = 1; i < line_ends_len; ++i) {
- if ((Smi::cast(line_ends_array->GetElement(i - 1)))->value() < code_pos &&
- code_pos <= (Smi::cast(line_ends_array->GetElement(i)))->value()) {
+ if ((Smi::cast(line_ends_array->get(i - 1)))->value() < code_pos &&
+ code_pos <= (Smi::cast(line_ends_array->get(i)))->value()) {
line = i;
break;
}
« no previous file with comments | « src/factory.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698